Closed Bug 1117105 Opened 9 years ago Closed 9 years ago

Better AJAX save feedback on editing Survey questions

Categories

(Webtools Graveyard :: Air Mozilla, defect, P3)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: peterbe, Unassigned)

References

Details

Attachments

(1 file)

When you edit a question that belongs to a survey you type in a textarea box and then press the "Save" button belonging to textarea.

There's no feedback that it's in the progress of saving or that it has saved.
Also, note that the textarea gets updated after an AJAX save, so just after starting the AJAX request we should lock the textarea too. 
https://github.com/mozilla/airmozilla/blob/b704e6225ffe4384600a44707c0034cd79342123/airmozilla/manage/static/manage/js/survey-edit.js#L45
A simply solution would be something like::

        $('button.btn-primary span').text('Saving...');
        $.post(form.attr('action'), data)
        .then(function(response) {
            if (response.error) {
                alert('Unable to save. Error: ' + response.error);
            } else {
                textarea.val(response.question);
                $('button.btn-primary span').text('Saved');
                setTimeout(function() {
                    $('button.btn-primary span').text('Save');
                }, 2 * 1000);
            }
        }).fail(function() {
            console.warn(arguments);
            alert('Unable to complete the save right now.');
        });
Anurag? Something you would be interested in?
Sure. I was wondering, if instead of using an alert message we could produce an in page error message, on the lines of this attachment?
Attachment #8543997 - Flags: feedback?(peterbe)
As in with the same alert error message, just in this form.
Comment on attachment 8543997 [details]
Screen Shot 2015-01-05 at 7.58.44 PM.png

I would say, let's not worry about the alert() right now. I really don't like alert() dialogs but it's fine. That code is only there if something desperately rare goes wrong. Which 99% of the time it won't.

Also, this particular bug is just about the feedback on the UI when saving. So if we wanted to work on the error message we can do that in another bug. I think it's a lower priority.
Attachment #8543997 - Flags: feedback?(peterbe)
Priority: -- → P1
Priority: P1 → P3
Surveys seem to be used quite infrequently.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: