Closed Bug 973459 Opened 10 years ago Closed 9 years ago

[settings] refactor Cellular & Data panel with AMD pattern

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gasolin, Assigned: arthurcc)

References

Details

Attachments

(1 file)

Overview Description:

Refactor Cellular & Data 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 → arthur.chen
Comment on attachment 8597003 [details] [review]
[gaia] crh0716:973459 > mozilla-b2g:master

This is still in the development state so I'm requesting feedback only for two files:
 apps/settings/js/modules/feature_model.js
 apps/settings/js/panels/operator_settings/model/auto_selection_model.js

FeatureModel aims to provide a robust model solving the problem of quick toggling performed by users. In this design the final state of the feature is guaranteed to be the last target state set by users.

The model provides observable properties for setting/reporting the current state and the target state of a feature. The target state can be set at any speed without limitation but the model will not send the request to the underlying feature until it is become available of handling.

To initialize the model you will need to provide it with a object describing how to set state to your underlying feature. Details are provided in the comments in the script.

Please take a look at it when you get a chance and any feedback is welcome, thanks!
Attachment #8597003 - Flags: feedback?(ejchen)
Comment on attachment 8597003 [details] [review]
[gaia] crh0716:973459 > mozilla-b2g:master

I just checked your patch and left some questions there, thanks Arthur :)
Attachment #8597003 - Flags: feedback?(ejchen)
Comment on attachment 8597003 [details] [review]
[gaia] crh0716:973459 > mozilla-b2g:master

I've revised the patch and respond in the github. Mind take a look at it again? Thanks.
Attachment #8597003 - Flags: feedback?(ejchen)
Comment on attachment 8597003 [details] [review]
[gaia] crh0716:973459 > mozilla-b2g:master

f+ with some nits for these two files. Thanks Arthur !!
Attachment #8597003 - Flags: feedback?(ejchen) → feedback+
Comment on attachment 8597003 [details] [review]
[gaia] crh0716:973459 > mozilla-b2g:master

EJ, I'm requesting feedback on the entire patch before diving into writing unit tests.

The panel comprises four parts: a network type selector, a roaming preference selector, a automatic selection toggle, and a section for searching for and connecting to operators.

Each of the parts are handled by a view module that links to a certain manager responsible for that part (or being able to provide information for that part). The managers are created for each mozMobileConnection instance then we are able to have completely separated states that would not interfere with each other.

When entering the panel, we link the view modules to the managers of the current target sim card. By doing this we can ensure the panel present the information of the correct sim card and all actions are made against it.

Let me know what you think, thanks!
Attachment #8597003 - Flags: feedback?(ejchen)
Comment on attachment 8597003 [details] [review]
[gaia] crh0716:973459 > mozilla-b2g:master

Arthur, I think this patch is good with f+, feel free to write tests and I can try to do a full review later when you are done. And also, I left some comments in GitHub, please go check it when you have time ! Thanks !
Attachment #8597003 - Flags: feedback?(ejchen) → feedback+
Comment on attachment 8597003 [details] [review]
[gaia] crh0716:973459 > mozilla-b2g:master

Hi EJ, I've already added unit tests. Please help review the patch when you get a chance, thanks.
Attachment #8597003 - Flags: review?(ejchen)
Comment on attachment 8597003 [details] [review]
[gaia] crh0716:973459 > mozilla-b2g:master

Thanks Arthur, please check my comments on GitHub before landing ! r++
Attachment #8597003 - Flags: review?(ejchen) → review+
Thanks, EJ!
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: