Closed Bug 973441 Opened 12 years ago Closed 11 years ago

[settings] refactor Date & Time panel with AMD pattern

Categories

(Firefox OS Graveyard :: Gaia::Settings, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S2 (15aug)

People

(Reporter: gasolin, Assigned: gasolin)

References

Details

(Whiteboard: [p=8])

Attachments

(2 files, 1 obsolete file)

46 bytes, text/x-github-pull-request
Details | Review
46 bytes, text/x-github-pull-request
arthurcc
: review+
Details | Review
Overview Description: Refactor Date & Time panel with AMD pattern referring to https://github.com/crh0716/gaia/tree/settings2_iterative to make it modularize and more easier to maintain Steps to Reproduce: 1) run make test-perf APP=settings 2) run make test-integration APP=settings Expected Results: pass all settings test and act the same as original implementation Additional Information:
Assignee: nobody → gduan
Blocks: 1023735
take it as the pre-work for bug 1023735
Assignee: gduan → gasolin
Attached file pull request redirect to github (obsolete) —
workable WIP, unit tests needed
Comment on attachment 8450077 [details] [review] pull request redirect to github feedback request while adding test cases
Attachment #8450077 - Flags: feedback?(ejchen)
Attachment #8450077 - Flags: feedback?(arthur.chen)
Status: NEW → ASSIGNED
Target Milestone: --- → 2.0 S6 (18july)
Comment on attachment 8450077 [details] [review] pull request redirect to github Thanks for the patch, Fred! I was thinking the module could be more general and separated from UI elements. Which means we may have a DateTime module that is a singleton and Observable providing functions for setting date, time, and time zone... etc. By doing this the module is easier to test because it is not involved with DOM elements.
Attachment #8450077 - Flags: feedback?(arthur.chen)
Attached file PR2
add DateTime module to observe settings values
Attachment #8450077 - Attachment is obsolete: true
Attachment #8450077 - Flags: feedback?(ejchen)
Comment on attachment 8451532 [details] [review] PR2 set for feedback again.
Attachment #8451532 - Flags: feedback?(ejchen)
Attachment #8451532 - Flags: feedback?(arthur.chen)
Comment on attachment 8451532 [details] [review] PR2 The DateTime singleton should at least provide functions like `setDate`, `setTime`, and a function for toggling setting time automatically. And it should also be an observable at the same time providing current date and time for UI binding. Now we support creating an Observable with functions on it. Please refer to display/wallpaper.js.
Attachment #8451532 - Flags: feedback?(arthur.chen)
DateTimeUI removed, delegate its duty to panel.js and DateTime module
Whiteboard: [p=3]
Target Milestone: 2.0 S6 (18july) → 2.1 S1 (1aug)
Comment on attachment 8451532 [details] [review] PR2 test cases added, please kindly review it
Attachment #8451532 - Flags: review?(arthur.chen)
Comment on attachment 8451532 [details] [review] PR2 Thanks for the patch. I left some comments in github. Note that DateTime module is for users of the module being able to configure date, time, and timezone and getting the current date and time more easily. Manipulation to UI elements should not be done in the module. And I noticed two bugs. The first one is the check box for automatically setting time is not shown even I used a sim card that supports it. The other is that the time no longer updates after I turn off and turn on the screen (this may also occurs on date).
Attachment #8451532 - Flags: review?(arthur.chen)
Whiteboard: [p=3] → [p=5]
WIP: Update DateTime module, now it provide 'date', 'clock' for observe. 1. the check box for automatically setting time is not shown in neither Simulator nor debug device, but only shown on device with pvt build (no matter there's SIM card or not). 2. fixed by DateTime observer
Comment on attachment 8451532 [details] [review] PR2 test fine on frame with SIM card. please kindly review it again
Attachment #8451532 - Flags: review?(arthur.chen)
Target Milestone: 2.1 S1 (1aug) → 2.1 S2 (15aug)
Comment on attachment 8451532 [details] [review] PR2 The architecture looks good to me, but there are a few calling sequence problems. Please check my comments in github. I'll continue to review the tests after the problems are addressed, thanks.
Attachment #8451532 - Flags: review?(arthur.chen)
comment addressed and add more jsdocs. Please kindly review it again
Attachment #8468272 - Flags: review?(arthur.chen)
Comment on attachment 8468272 [details] [review] pull request redirect to github 3 I just did a few tests, there are still bugs: - Enable "set automatically", timezone is not set correctly. Please make sure all the behaviors are the same as before. Especially the cases like set a time zone manually -> enable auto time -> close app -> open app -> disable auto time -> the time zone should be the user selected one.
Attachment #8468272 - Flags: review?(arthur.chen)
Attachment #8451532 - Flags: feedback?(ejchen)
Thanks for addressing more issues for refactor. For the "set automatically" bug, I can reproduce it in master either. After checking the DateTime modification history, https://github.com/mozilla-b2g/gaia/commits/master/apps/settings/js/date_time.js There's only Bug 1042774 modified the gaia code in master. I reverted it and that bug still occurred. To further confirm the bug, set auto timezone and restart the phone, the statusbar clock shows manual timezone but not auto timezone. I think the issue might be come from gecko part. let's track it separately in bug 1050091.
Comment on attachment 8468272 [details] [review] pull request redirect to github 3 besides above issue, all comments are addressed. Please kindly review it again
Attachment #8468272 - Flags: review?(arthur.chen)
The trace result shows tz_select change in bug 1026098 cause bug 1050091
Comment on attachment 8468272 [details] [review] pull request redirect to github 3 r=me, thank you!!
Attachment #8468272 - Flags: review?(arthur.chen) → review+
Whiteboard: [p=5] → [p=8]
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Unable to verify until the depends on ,bug 968686, is closed out and verified
QA Whiteboard: [QAnalyst-verify-]
It seems as though the user is able to toggle set Date and Time correctly, unable to verify as stated in comment 21
QA Whiteboard: [QAnalyst-verify-] → [QAnalyst-Triage?][QAnalyst-verify-]
Flags: needinfo?(ktucker)
I added the [QAnalyst-verify-] tag because I am unsure that I can fully verify this bug, as some of the issues mentioned might be backend
QA Whiteboard: [QAnalyst-Triage?][QAnalyst-verify-] → [QAnalyst-Triage+][QAnalyst-verify-]
Flags: needinfo?(ktucker)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: