Open Bug 728681 Opened 12 years ago Updated 2 years ago

consolidate checks of numeric fields in Account manager

Categories

(MailNews Core :: Account Manager, enhancement)

enhancement

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: aceman, Assigned: aceman)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: polish, ux-error-prevention)

+++ This bug was initially created as a clone of Bug #532391 comment 2 +++

There are several pairs of fields of the pattern: checkbox and numeric field.
The numeric field is only enabled when the checkbox is enabled.
Examples of such pair is the "check for new messages every X minutes" or "ask me before downloading X messages". Some of the fields have some checks whether the entered value is correct and within sane boundaries. Some of the fields do not have such check.
The purpose of this bug is to build a shared set of checks and add the checks where they are missing.

The proposed model of operation for those fields:
- the numeric fields will have 'type="number" size="X" min="X" increment="X"' as appropriate. This makes the widget itself sanitize values read from prefs.js into the specified boundaries. It does not allow the user to input values outside the boundaries. It adds the small arrow widgets to increase/decrease the value.
- the checkbox field will have an oncommand function that will enable/disable the corresponding numeric field depending on the state of the checkbox.

Open questions:
- should 0 still be allowed in some fields as a special value? It was used to disable the checkbox automatically if 0 is entered (in "Check for new messages every X days").
- should max= attribute be added to the numeric fields to disallow some insane values? Like 10000000 minutes? It would need decision what are insane values and whether the backend would choke on them.

The plan:
- merge the onCheckItem function from am-server.js and am-offline.js and move it into amUtils.js .
- update the field declarations where needed and make them call the onCheckItem function.
- the fields where these checks need update are for example:
a) RSS "Check for new articles every X minutes"
b) POP3/News (Synch & storage) "Messages larger than X KB"
c) POP3/News (Synch & storage) "Messages more than X days old"
d) Junk mail "automatically delete junk mail older than X days"
etc.
Blocks: 729147
Blocks: 755454
No longer blocks: 755454
Depends on: 755454
The common function was moved to am-prefs.js per comment
https://bugzilla.mozilla.org/show_bug.cgi?id=755454#c4.

The resulting patch from all this would be too big so I am doing some panels in separate bugs (linked here).
Status: NEW → ASSIGNED
Depends on: 755518
Depends on: 755885
Depends on: 755898
No longer depends on: 755898
Depends on: 755898
Blocks: 755898
Depends on: 725488
No longer depends on: 755898
No longer blocks: 729147
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.