Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile migration fixes #5

Merged
merged 18 commits into from
Jul 17, 2023

Conversation

Abby-Wheelis
Copy link
Owner

These changes fix some of the issue that I was stuck on in More-Profile-Migrations, as well as implement a react-native-paper picker for the preferred reminder time

JGreenlee and others added 18 commits July 13, 2023 20:55
Since the entire SettingRow now handles the onPress for the action, we no longer need onValueChange in the switch. This would cause the action to be called twice.
In general-settings, the `$scope.settings` object is used to store all of the current values of options that are represeted by the Profile Tab.
As we migrate to ProfileSettings, this should be stored as state in React. This change handles only `collect` settings; everything that was previously stored under `$scope.settings.collect`.

We accomplish this with useState and a new function `refreshCollectSettings`, which is called 1) on config load and 2) whenever any setting relating to collection is changed

`settingsScope` needed to be retrieved in a different way. Previously it was passed from AngularJS a prop; this caused the ProfileSettings component to be re-initialized every time any scope value changed. This made it impossible to persist state in ProfileSettings.
Now we will retrieve the scope with a DOM lookup; we find the root element of the scope, then ask Angular for the scope attached to that element.
These settings are now stored in collectSettings of ProfileSettings. All references to $scope.settings.collect have been removed / commented out.
this was named wrong by accident
These properties are no longer used by ProfileSettings. The general-settings scope is now retrieved globally via a DOM lookup.
in order to have functional user data dropdown, moved userData methods back to general-settings and getting them from the scope
no longer using Platform because Modal is better and no longer importing an object as a parameter
the way the link to the qr code document was being accessed was broken - this seems to fix it, but testing in the devapp is difficult
deleted commented out code that was confirmed to be working in ProfileSettings!
the actionsheet coming from ControlCollectionHelper was buggy - this rough migration allows React to handle the popup, while using CCH's forceTransition to complete the action
like controlSettings, move the logic handling for settings.notification out of general-settings and into ProfileSettings - refreshed when the config is loaded and when the pref reminder time is updated
the ReminderTime element is a custom settingRow with a datepicker that appears when the setting is clicked
deleting redundant code from general-settings, improving formatting, updating comments
@Abby-Wheelis Abby-Wheelis merged commit 04d39b6 into More-Profile-Migrations Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants