If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Better AJAX save feedback on editing Survey questions

RESOLVED WONTFIX

Status

Webtools
Air Mozilla
P3
normal
RESOLVED WONTFIX
3 years ago
2 years ago

People

(Reporter: peterbe, Unassigned)

Tracking

Trunk
x86
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
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.
(Reporter)

Comment 1

3 years ago
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
(Reporter)

Comment 2

3 years ago
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.');
        });
(Reporter)

Comment 3

3 years ago
Anurag? Something you would be interested in?

Comment 4

3 years ago
Created attachment 8543997 [details]
Screen Shot 2015-01-05 at 7.58.44 PM.png

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)

Comment 5

3 years ago
As in with the same alert error message, just in this form.
(Reporter)

Comment 6

3 years ago
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
(Reporter)

Updated

3 years ago
Priority: P1 → P3
Surveys seem to be used quite infrequently.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.