Edgewall Software
Modify

Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#11014 closed defect (fixed)

BatchModification can't be used when JavaScript is disabled

Reported by: Ryan J Ollos <ryan.j.ollos@…> Owned by: Ryan J Ollos <ryan.j.ollos@…>
Priority: normal Milestone: 1.0.1
Component: query system Version:
Severity: normal Keywords: batch-modify
Cc: Branch:
Release Notes:

Hide all of the BatchModify elements when JavaScript is disabled since BatchModify requires JavaScript.

API Changes:
Internal Changes:

Description

The column of checkboxes is added by JavaScript code, so there is no way to select tickets when JavaScript is disabled. As far as I know, Trac still has the goal of being providing full basic functionality without JavaScript.

Therefore I propose to create a patch that moves addition of the checkboxes to the template. This would also be a good opportunity to put a few functional tests in place for the BatchModify functionality.

If we don't wish to provide BatchModify when JavaScript is not present, then alternatively I'd propose that the Batch Modify form controls be hidden when JavaScript is not present. This could probably be accomplished by hiding them by default in the CSS, and having the JavaScript code set them visible.

Attachments (2)

t11014-r11483-1.patch (1.1 KB ) - added by anonymous 11 years ago.
t11014-r11483-2.patch (1.2 KB ) - added by anonymous 11 years ago.

Download all attachments as: .zip

Change History (16)

in reply to:  description ; comment:1 by Christian Boos, 11 years ago

Replying to Ryan J Ollos <ryan.j.ollos@…>:

The column of checkboxes is added by JavaScript code, so there is no way to select tickets when JavaScript is disabled. As far as I know, Trac still has the goal of being providing full basic functionality without JavaScript.

No.

Therefore I propose to create a patch that moves addition of the checkboxes to the template. This would also be a good opportunity to put a few functional tests in place for the BatchModify functionality.

No.

If we don't wish to provide BatchModify when JavaScript is not present, then alternatively I'd propose that the Batch Modify form controls be hidden when JavaScript is not present. This could probably be accomplished by hiding them by default in the CSS, and having the JavaScript code set them visible.

I think that would be OK.

in reply to:  1 ; comment:2 by Ryan J Ollos <ryan.j.ollos@…>, 11 years ago

Replying to cboos:

Therefore I propose to create a patch that moves addition of the checkboxes to the template. This would also be a good opportunity to put a few functional tests in place for the BatchModify functionality.

No.

Just for my own education, could you help me understand why you don't want to go this route?

in reply to:  2 ; comment:3 by Christian Boos, 11 years ago

Replying to Ryan J Ollos <ryan.j.ollos@…>:

Replying to cboos:

Therefore I propose to create a patch that moves addition of the checkboxes to the template. This would also be a good opportunity to put a few functional tests in place for the BatchModify functionality.

No.

Just for my own education, could you help me understand why you don't want to go this route?

TracDev/Performance#Genshi is a good place to start ;-)

This translates into: we don't want more Genshi and less JavaScript, but rather the opposite. While this hasn't been "officially" discussed on trac-dev, I think there seems to be a common understanding that this would be a good thing.

But this shouldn't prevent us to think about possible functional testing strategies (e.g. using http://phantomjs.org perhaps as described here Python Testing - PhantomJS with Selenium WebDriver, or using http://jeanphix.me/Ghost.py).

in reply to:  3 ; comment:4 by Ryan J Ollos <ryan.j.ollos@…>, 11 years ago

Replying to cboos:

… While this hasn't been "officially" discussed on trac-dev, I think there seems to be a common understanding that this would be a good thing.

I remember you mentioning this on the trac-dev list just after the release of 1.0, when describing how to move forward with Genshi in light of the performance issue. I had just thought that the official stance was still for graceful degradation. I'm not for/against any particular strategy, so I'm happy to proceed with the patch per your suggestion, and I suppose by hiding the non-functional batch modify form when JS is not prsent, that can be considered graceful degradation.

But this shouldn't prevent us to think about possible functional testing strategies

Ah, I'm glad you mentioned. I'd been thinking about raising a similar question on the mailing list lately. I'll take a look.

In light of the feedback I propose (simply because this is how I've seen it done before):

  • Hide the elements by setting the display:none property.
  • Add a visible class that has the display:inline property.
  • Add the visible class using JavaScript.

I haven't looked closely at the code yet, but just wanted to sketch out the patch to make sure I'm on the right track.

in reply to:  4 comment:5 by Christian Boos, 11 years ago

Replying to Ryan J Ollos <ryan.j.ollos@…>:

  • Add a visible class that has the display:inline property.
  • Add the visible class using JavaScript.

or simply a $("...").show() of the appropriate stuff at document load time.

comment:6 by Ryan J Ollos <ryan.j.ollos@…>, 11 years ago

Thanks. I will work up a patch after I complete the other 3 tickets I'm working at the moment.

in reply to:  3 comment:7 by Remy Blank, 11 years ago

Replying to cboos:

This translates into: we don't want more Genshi and less JavaScript, but rather the opposite. While this hasn't been "officially" discussed on trac-dev, I think there seems to be a common understanding that this would be a good thing.

I tend to agree with that, too, but we indeed never discussed it. AFAIK except for batch ticket changes, Trac always has a "degraded" mode for all functionality requiring JavaScript. If we re-visit this decision, we should probably also remove these fallbacks.

by anonymous, 11 years ago

Attachment: t11014-r11483-1.patch added

by anonymous, 11 years ago

Attachment: t11014-r11483-2.patch added

comment:8 by Ryan J Ollos <ryan.j.ollos@…>, 11 years ago

I didn't see how to use show since it restores the display property to what is was originally, however we can change the css directly by calling css: t11014-r11483-1.patch. Alternatively, we can use a class to keep the properties in the css: t11014-r11483-2.patch.

comment:9 by Remy Blank, 11 years ago

Milestone: 1.0.1
Owner: set to Remy Blank
Status: newassigned

in reply to:  8 ; comment:10 by Remy Blank, 11 years ago

Resolution: fixed
Status: assignedclosed

Replying to Ryan J Ollos <ryan.j.ollos@…>:

I didn't see how to use show since it restores the display property to what is was originally,

Did you try? Just calling .show() on the form does the trick. Patch applied in [11507], using .show() and calling it at the very bottom, when everything is set up.

comment:11 by Remy Blank, 11 years ago

Owner: changed from Remy Blank to Ryan J Ollos <ryan.j.ollos@…>

in reply to:  10 comment:12 by Ryan J Ollos <ryan.j.ollos@…>, 11 years ago

Replying to rblank:

Did you try?

I hadn't tried. I guess I was depending too much on the documentation (or my interpretation of the documentation).

Thanks though, that one-liner will be useful in a plugin I'm working on as well.

comment:13 by Ryan J Ollos <ryan.j.ollos@…>, 11 years ago

Release Notes: modified (diff)

comment:14 by Ryan J Ollos, 10 years ago

Keywords: batch-modify added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos <ryan.j.ollos@…>.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos <ryan.j.ollos@…> to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.