Modify

Opened 16 years ago

Last modified 11 years ago

#4250 reopened enhancement

[PATCH] Annoying javascript confirm() and Load button.

Reported by: Sébastien GISSINGER Owned by: Richard Liao
Priority: normal Component: TracTicketTemplatePlugin
Severity: normal Keywords: confirmation dialog
Cc: alillards Trac Release: 0.11

Description

Could you remove OK/Cancel javascript on ticket type change (new/modify).
Filling automatically textareas with template must be a normal way of doing in your plugin, no need to confirm if i want or/not, i installed the plugin to do it.
In my mind, if people don't like the preformatted template they remove it by themselves but a template is made to be followed not Cancelled.

And could make the same in Admin by removing the Load button. Fill the textarea when changing ticket type automatically. Even if the page blink and you do not intend to do Ajax, i think this a much better way to do.

Mimimizing user interactions must be a standard in software developpement. Users mustn't need to search the information, the information must comme by itself to the user.

Cheers.

Attachments (0)

Change History (13)

comment:1 Changed 16 years ago by Sébastien GISSINGER

Resolution: worksforme
Status: newclosed

Some patch files to do what i explained.

There is still a little bad comportment when you first access to Admin > Ticket Template. If the first type selected in the ComboBox is empty (not even a space) it's loaded as is. Or it would load the default ticket template.

To apply these patch files :

comment:2 in reply to:  1 Changed 16 years ago by Sébastien GISSINGER

Replying to sgissinger:

Some patch files to do what i explained.

There is still a little bad comportment when you first access to Admin > Ticket Template. If the first type selected in the ComboBox is empty (not even a space) it's loaded as is. Or it would load the default ticket template.

To apply these patch files :

Could not attach files so external links

Admin Patch File
User Patch File

comment:3 Changed 16 years ago by Sébastien GISSINGER

Resolution: worksforme
Status: closedreopened

Re-open so you can follow it.

comment:4 Changed 16 years ago by Richard Liao

It's would be more annoying if user have input a lot of words and replaced by the preformatted template without any warning. The annoying confirm dialog give them a chance to keep their work :)

As for the Load button, your suggestion is a surely good to improve user experience. I will fix it soon.

comment:5 Changed 16 years ago by Sébastien GISSINGER

Ok, I didn't notice the confirm being used for this purpose. Hehe in my case, if the user do one mistake he surely won't do a second one. A kind of learning lesson. :)

comment:6 Changed 15 years ago by Adrian Fritz

Summary: Annoying javascript confirm() and Load button.[PATCH] Annoying javascript confirm() and Load button.

comment:7 Changed 15 years ago by Adrian Fritz

Indicated links are broken. A search at such domain returns nothing. Maybe sgissinger can try reloading files again.

comment:8 in reply to:  7 Changed 14 years ago by Steffen Hoffmann

Keywords: confirmation dialog added

Replying to AdrianFritz:

Indicated links are broken. A search at such domain returns nothing. Maybe sgissinger can try reloading files again.

Still true; sgissinger, please try again to provide the replacement files here, please.

comment:9 in reply to:  4 ; Changed 13 years ago by alillards

Replying to richard:

It's would be more annoying if user have input a lot of words and replaced by the preformatted template without any warning. The annoying confirm dialog give them a chance to keep their work :)

I also think the confirmation dialog is annoying, so how about this alternative: If the user has input text in certain fields, ask for confirmation. Else, assume the ticket is empty and apply the template without asking.

comment:10 Changed 13 years ago by alillards

Cc: alillards added; anonymous removed

comment:11 Changed 11 years ago by Andras Korn

Perhaps something like this in templates/tt_newticket.js would do it?

        function onCustomChanged(evt) {
            var tt_name = $("#tt_custom_select").val();
            if (! tt_name) {
                return;
            }

            var ticketType = queryResult.field_value_mapping_custom[tt_name];
            if (typeof ticketType === "undefined") return;
            if (evt.type == "change") {
                var answer = confirm("${_('Replace ticket content with template?')}");
                if (!answer) {
                    return;
                }
            }

            // apply custom template
            _updateTargetElem(ticketType);
        }
Last edited 11 years ago by Ryan J Ollos (previous) (diff)

comment:12 Changed 11 years ago by Andras Korn

Full patch:

  • 0.11/tickettemplate/templates/tt_newticket.js

     
    196196                return;
    197197            }
    198198
     199            var ticketType = queryResult.field_value_mapping_custom[tt_name];
     200            if (typeof ticketType === "undefined") return;
    199201            if (evt.type == "change") {
    200202                var answer = confirm("${_('Replace ticket content with template?')}");
    201203                if (!answer) {
     
    204206            }
    205207
    206208            // apply custom template
    207             var ticketType = queryResult.field_value_mapping_custom[tt_name];
    208209            _updateTargetElem(ticketType);
    209210        }
    210211
     
    333334                return;
    334335            }
    335336
     337            var ticketType = queryResult.field_value_mapping_custom[tt_name];
     338            if (typeof ticketType === "undefined") return;
    336339            if (evt.type == "change" && isLoad == false) {
    337340                var answer = confirm("${_('Replace ticket content with template?')}");
    338341                if (!answer) {
     
    340343                }
    341344            }
    342345
    343             var ticketType = queryResult.field_value_mapping[tt_name];
    344346            if (!ticketType) {
    345347                ticketType = queryResult.field_value_mapping['default'];
    346348            }

Appears to work on first sight.

Last edited 11 years ago by Ryan J Ollos (previous) (diff)

comment:13 in reply to:  9 Changed 11 years ago by brian@…

Replying to chester_copperpot:

I also think the confirmation dialog is annoying, so how about this alternative: If the user has input text in certain fields, ask for confirmation. Else, assume the ticket is empty and apply the template without asking.

Agreed! The confirmation dialog is only annoying when it has no possibility of deleting user data. #11544 should be considered with any changes to the confirm behavior.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as reopened The owner will remain Richard Liao.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.