-
Notifications
You must be signed in to change notification settings - Fork 0
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
Settings: Metric Configuration: Save Definitions (and Replace Mocks) (6/n) #108
Conversation
…and UI update functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to leave this one to @terryttsai to review since it's heavier on logic! I will say that I definitely think we can/should invest in a store + refactor after this. We should definitely have the time this week!
updatedSettingsArray = updatedSetting.settings; | ||
} else { | ||
updatedSettingsArray = prev[metricKey].settings?.map((setting) => { | ||
if (setting.key === updatedSetting.settings?.[0].key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to store settings mapped by key? e.g. instead of settings?: MetricConfigurationSettings[]
it would be settings: Dict[str, MetricConfigurationSetting]
. Not only would this be faster, I feel like it would make the code simpler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, it feels easier and quicker to map through the array itself - the render is quicker too because it'll just map through the array itself. To me it feels like mapping an array by key and using it always requires an extra step in taking an existing array, mapping it to the object, and then eventually you'll have to converting that mapped object back to an array to render the list. Happy to continue discussing this! Maybe there's something I'm not seeing/understanding?
In L172 - it's taking the first item in the array because it's only updating one item at a time (with the exception of reverting to default) - so there will only ever be one item.
If we are able to create a store and reorganize, I think the UI update logic would naturally be simplified - but definitely a big refactor as we'll also need to update how things are rendered. If we have time to work on a store, I would love some help because it will be a bit of a beast. @terryttsai - if you have any interest/capacity - I would love to work together on this and figure out the best way to refactor and reorganize into a store.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I see what you're saying about rendering being easier if we store as an array, but I'm still not sure I agree with the "quicker" part -- converting an array to a map is a one-time O(n) operation, and the benefit of paying that one-time cost is that it means all lookups can be O(1) instead of O(n). In line 171, we're iterating through all settings and looking for the one that matches, so that's O(n), whereas it could just be O(1). In practice, with our data size, that really doesn't matter -- I was more thinking that the code could be cleaner because you could just do something like this:
settings = prev[metricKey].settings
settings[updatingSetting.key] = updatingSetting
return {
...prev,
[updatedSetting.key]: {
...prev[metricKey],
settings: settings,
},
It's quite possible what I'm suggesting does not make sense or does not work in the JS world, though!
Also 100% to you and @terryttsai working together on a refactor, if you both agree that it makes sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I should've used a better word - when I said "quicker" I definitely was not referring to time complexity at all! I should've said something like "fewer transformational (from array > object > array) steps in my mind".
Thank you for clarifying how you were seeing this - very helpful to see the example! This makes sense and absolutely could work in JS world. I can try that and let you know how it works - definitely agree that it is cleaner!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, I don't think I can actually just try this within this current structure - but, will keep this in mind for when we can refactor to mapping objects such as this to a key: value structure and storing them to get the benefit of a quick lookup as you explained!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
settings = prev[metricKey].settings settings[updatingSetting.key] = updatingSetting return { ...prev, [updatedSetting.key]: { ...prev[metricKey], settings: settings, },
One thing I noticed in this example - we would have to remap the settings object back to an array (i.e. Object.values(settings)
) before we return the updated object - would that then add another O(n) operation or am I confusing myself now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was imagining we'd change the type in the store (or wherever it gets sent back to) as well! But yea, this is just an idea to think about moving forward, it's certainly not blocking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So although rendering from an array is a bit nicer than having to convert an object into an array first, if we're updating values in the array by key, like in this metric settings array, I would store the array as a dict instead, so our updaters look like what Lili suggested above, this makes it clearer what we're intending to update and it's more efficient than looping through the entire array each time we update.
When we render, at that point it can be converted back into an array for rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all makes sense - thank you both for sharing your thoughts on a cleaner way to implement this with a dictionary!
publisher/src/components/MetricConfiguration/MetricConfiguration.tsx
Outdated
Show resolved
Hide resolved
@@ -117,6 +126,18 @@ export const MetricConfiguration: React.FC<{ | |||
}); | |||
|
|||
setListOfMetrics(listOfMetricsForMetricNavigation); | |||
|
|||
/** Update activeDimension when settings are updated */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What settings update causes this to be triggered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kicked my butt on Friday - I couldn't figure out why certain things were not updating and it's because activeDimension
needs to also update when there's a change to the metricSettings. The MetricDefinitions component currently relies on an up to date activeDimension
.
@@ -139,6 +160,34 @@ export const MetricConfiguration: React.FC<{ | |||
}; | |||
} | |||
|
|||
if (typeOfUpdate === "METRIC_SETTING") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So looking at the updateMetricSettings
method, I'm not caught up on what we're thinking of for a refactor, but I can imagine these update methods being part of the metric settings mobx store and any component can call it and update the metric settings structure?
And furthermore that store can provide all of these metric configuration components the metric settings data + updaters, and there won't be a need to pass individual Xstate
and setXstate
react state objects and setters between all these components?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love to sync on this - haven't formulated any plans yet! But yes exactly, the way I'm thinking about this is inline with what you described - a bit similar to the data entry store and how it updates.
updatedSettingsArray = updatedSetting.settings; | ||
} else { | ||
updatedSettingsArray = prev[metricKey].settings?.map((setting) => { | ||
if (setting.key === updatedSetting.settings?.[0].key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So although rendering from an array is a bit nicer than having to convert an object into an array first, if we're updating values in the array by key, like in this metric settings array, I would store the array as a dict instead, so our updaters look like what Lili suggested above, this makes it clearer what we're intending to update and it's more efficient than looping through the entire array each time we update.
When we render, at that point it can be converted back into an array for rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code in its current paradigm looks good to me for playtesting!
… Adjustments (1/n) (#110) * Remove tabs in metric list when agency has only one system * Change casing to capitalized case on Monthly Annual badges * Reduce spacing of Settings menu * Scroll gap adjustment * Settings: Metric Configuration: Playtesting Followups - Selection States (2/n) (#112) * Add arrow vector, add logic for persisting on click, update hover and active states, clean up * Settings: Metric Configuration: Playtesting Followups - Default Definition Hover State (3/n) (#113) * Add hover feature to display the default settings when user hovers over the revert button * Update to Choose instead of Revert per design * Clean up * Settings: Metric Configuration: Playtesting Followups - Enable Dimension Selection When Disaggregation is Off (4/n) (#115) * When disaggregation and dimensions are all off, checking on a dimension will turn on the disaggregation * Styling bug fixes * Implement responsiveness per design (#117) Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com>
if ( | ||
disaggregation.key !== updatedSetting.disaggregations?.[0].key | ||
) { | ||
return disaggregation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reversing the order of these! I do actually think this is a lot better! The way I think about it is, before when when reading it, my brain goes "Ok lots of stuff is happening here if the key matches, but there's a nagging curiosity in my head about what happens when it doesn't match" vs now it's like "Ok, I know what happens when the key is NOT equal -- nothing happens -- now I can focus all my energy on what happens when the key DOES match!"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way you explain it makes so much sense!
* Restructure settings files, rename, extract styles * Refactor settings page and set up existing components in new structure * Styling adjustment * Change text to Your Account * Settings: Metric Configuration (1/n) (#64) * Initial work on metric config refactor in settings * Continue iterating on refactor up to the breakdown page * Remove routing to old metrics page - remove from menu * Styling adjustment * Fix key warning Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Metric Details & Breakdowns (2/n) (#66) * Initial work on metric config refactor in settings * Continue iterating on refactor up to the breakdown page * Styling adjustment * Change MetricView to MetricConfiguration and update all imports - remove MetricViewMocks Restyle metric details up to breakdown dimensions New breakdown copy Refactor breakdowns with toggles * Refactor disaggregations to use checkboxes and remove toggle switch * Add definitions panel, add icon * Style clean up - comments * Clean up * Feedback: reduce height in metric boxes, only use filteredMetricSettings optimization Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Definitions (3/n) (#83) * Initial work on MetricDefinitions component * Continue fleshing out definitions component, move metric context config to overall metric definition panel, set up mocks for definitions, add and update types, fix adjustments dependent on changes * Adjust styles for scrolling * Clean up * Style and comment clean up * Fix type * Use undefined vs empty string * Fix key warning * Settings: Metric Configuration: Navigation (Table of Contents) (4/n) (#85) * Add table of contents navigation when inside of metric details, move shared state to settings page and pass state to menu and metric config, fix disaggregation issues, add styling for table of contents, fix bug in mocks, add types, various adjustments to accommodate new change * Clean up * Add comments Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Refactor & Clean Up (5/n) (#91) * Major clean up - separate components into their own files * Fix dimension bug * Fix switch agency bug * Minor clean up * Merge types with existing types and update all connected components * Clean up * Handle cases when settings array is empty or non-existent * Handle cases when settings array is empty or non-existent * Styling adjustments per prev feedback * Recreate MetricsView Component for Data Visualization (#101) * Recreate old MetricsView component Update route and add to menu Update styling Remove unnecessary code - minor refactor Clean up * Fix styling issue * Add spacing between header and data viz * Add border top to data viz dropdown * Update tooltip and link to direct users to Settings to change metric config Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Save Definitions (and Replace Mocks) (6/n) (#108) * [Summary] Remove mocks and implement definition saving functionality and UI update functionality * Revert to default values functionality * Fix revert to default for metric setting * Clean up comment * PR feedback: reverse the conditionals * Settings: Metric Configuration: Playtesting Followups - Misc. Styling Adjustments (1/n) (#110) * Remove tabs in metric list when agency has only one system * Change casing to capitalized case on Monthly Annual badges * Reduce spacing of Settings menu * Scroll gap adjustment * Settings: Metric Configuration: Playtesting Followups - Selection States (2/n) (#112) * Add arrow vector, add logic for persisting on click, update hover and active states, clean up * Settings: Metric Configuration: Playtesting Followups - Default Definition Hover State (3/n) (#113) * Add hover feature to display the default settings when user hovers over the revert button * Update to Choose instead of Revert per design * Clean up * Settings: Metric Configuration: Playtesting Followups - Enable Dimension Selection When Disaggregation is Off (4/n) (#115) * When disaggregation and dimensions are all off, checking on a dimension will turn on the disaggregation * Styling bug fixes * Implement responsiveness per design (#117) Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com>
* Settings: Scaffolding (#59) * Restructure settings files, rename, extract styles * Refactor settings page and set up existing components in new structure * Styling adjustment * Change text to Your Account * Settings: Metric Configuration (1/n) (#64) * Initial work on metric config refactor in settings * Continue iterating on refactor up to the breakdown page * Remove routing to old metrics page - remove from menu * Styling adjustment * Fix key warning Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Metric Details & Breakdowns (2/n) (#66) * Initial work on metric config refactor in settings * Continue iterating on refactor up to the breakdown page * Styling adjustment * Change MetricView to MetricConfiguration and update all imports - remove MetricViewMocks Restyle metric details up to breakdown dimensions New breakdown copy Refactor breakdowns with toggles * Refactor disaggregations to use checkboxes and remove toggle switch * Add definitions panel, add icon * Style clean up - comments * Clean up * Feedback: reduce height in metric boxes, only use filteredMetricSettings optimization Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Definitions (3/n) (#83) * Initial work on MetricDefinitions component * Continue fleshing out definitions component, move metric context config to overall metric definition panel, set up mocks for definitions, add and update types, fix adjustments dependent on changes * Adjust styles for scrolling * Clean up * Style and comment clean up * Fix type * Use undefined vs empty string * Fix key warning * Settings: Metric Configuration: Navigation (Table of Contents) (4/n) (#85) * Add table of contents navigation when inside of metric details, move shared state to settings page and pass state to menu and metric config, fix disaggregation issues, add styling for table of contents, fix bug in mocks, add types, various adjustments to accommodate new change * Clean up * Add comments Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Refactor & Clean Up (5/n) (#91) * Major clean up - separate components into their own files * Fix dimension bug * Fix switch agency bug * Minor clean up * Merge types with existing types and update all connected components * Clean up * Handle cases when settings array is empty or non-existent * Handle cases when settings array is empty or non-existent * Styling adjustments per prev feedback * Recreate MetricsView Component for Data Visualization (#101) * Recreate old MetricsView component Update route and add to menu Update styling Remove unnecessary code - minor refactor Clean up * Fix styling issue * Add spacing between header and data viz * Add border top to data viz dropdown * Update tooltip and link to direct users to Settings to change metric config Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Save Definitions (and Replace Mocks) (6/n) (#108) * [Summary] Remove mocks and implement definition saving functionality and UI update functionality * Revert to default values functionality * Fix revert to default for metric setting * Clean up comment * PR feedback: reverse the conditionals * Settings: Metric Configuration: Playtesting Followups - Misc. Styling Adjustments (1/n) (#110) * Remove tabs in metric list when agency has only one system * Change casing to capitalized case on Monthly Annual badges * Reduce spacing of Settings menu * Scroll gap adjustment * Settings: Metric Configuration: Playtesting Followups - Selection States (2/n) (#112) * Add arrow vector, add logic for persisting on click, update hover and active states, clean up * Settings: Metric Configuration: Playtesting Followups - Default Definition Hover State (3/n) (#113) * Add hover feature to display the default settings when user hovers over the revert button * Update to Choose instead of Revert per design * Clean up * Settings: Metric Configuration: Playtesting Followups - Enable Dimension Selection When Disaggregation is Off (4/n) (#115) * When disaggregation and dimensions are all off, checking on a dimension will turn on the disaggregation * Styling bug fixes * Implement responsiveness per design (#117) Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> * Rebase adjustments - updating imports, types and other react upgrade related adjustments * Settings: Metric Configuration: Playtesting Followups - Misc. Styling Adjustments (6/n) (#121) * Fix overflow scroll bars * Adjust overall spacing and font size, fix squished arrow in metric box * Adjust Context and update copy for items without tech definition Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com>
* Restructure settings files, rename, extract styles * Refactor settings page and set up existing components in new structure * Styling adjustment * Change text to Your Account * Settings: Metric Configuration (1/n) (#64) * Initial work on metric config refactor in settings * Continue iterating on refactor up to the breakdown page * Remove routing to old metrics page - remove from menu * Styling adjustment * Fix key warning Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Metric Details & Breakdowns (2/n) (#66) * Initial work on metric config refactor in settings * Continue iterating on refactor up to the breakdown page * Styling adjustment * Change MetricView to MetricConfiguration and update all imports - remove MetricViewMocks Restyle metric details up to breakdown dimensions New breakdown copy Refactor breakdowns with toggles * Refactor disaggregations to use checkboxes and remove toggle switch * Add definitions panel, add icon * Style clean up - comments * Clean up * Feedback: reduce height in metric boxes, only use filteredMetricSettings optimization Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Definitions (3/n) (#83) * Initial work on MetricDefinitions component * Continue fleshing out definitions component, move metric context config to overall metric definition panel, set up mocks for definitions, add and update types, fix adjustments dependent on changes * Adjust styles for scrolling * Clean up * Style and comment clean up * Fix type * Use undefined vs empty string * Fix key warning * Settings: Metric Configuration: Navigation (Table of Contents) (4/n) (#85) * Add table of contents navigation when inside of metric details, move shared state to settings page and pass state to menu and metric config, fix disaggregation issues, add styling for table of contents, fix bug in mocks, add types, various adjustments to accommodate new change * Clean up * Add comments Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Refactor & Clean Up (5/n) (#91) * Major clean up - separate components into their own files * Fix dimension bug * Fix switch agency bug * Minor clean up * Merge types with existing types and update all connected components * Clean up * Handle cases when settings array is empty or non-existent * Handle cases when settings array is empty or non-existent * Styling adjustments per prev feedback * Recreate MetricsView Component for Data Visualization (#101) * Recreate old MetricsView component Update route and add to menu Update styling Remove unnecessary code - minor refactor Clean up * Fix styling issue * Add spacing between header and data viz * Add border top to data viz dropdown * Update tooltip and link to direct users to Settings to change metric config Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Save Definitions (and Replace Mocks) (6/n) (#108) * [Summary] Remove mocks and implement definition saving functionality and UI update functionality * Revert to default values functionality * Fix revert to default for metric setting * Clean up comment * PR feedback: reverse the conditionals * Settings: Metric Configuration: Playtesting Followups - Misc. Styling Adjustments (1/n) (#110) * Remove tabs in metric list when agency has only one system * Change casing to capitalized case on Monthly Annual badges * Reduce spacing of Settings menu * Scroll gap adjustment * Settings: Metric Configuration: Playtesting Followups - Selection States (2/n) (#112) * Add arrow vector, add logic for persisting on click, update hover and active states, clean up * Settings: Metric Configuration: Playtesting Followups - Default Definition Hover State (3/n) (#113) * Add hover feature to display the default settings when user hovers over the revert button * Update to Choose instead of Revert per design * Clean up * Settings: Metric Configuration: Playtesting Followups - Enable Dimension Selection When Disaggregation is Off (4/n) (#115) * When disaggregation and dimensions are all off, checking on a dimension will turn on the disaggregation * Styling bug fixes * Implement responsiveness per design (#117) Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Rebase adjustments - updating imports, types and other react upgrade related adjustments Refactor settings to use routes
* Restructure settings files, rename, extract styles * Refactor settings page and set up existing components in new structure * Styling adjustment * Change text to Your Account * Settings: Metric Configuration (1/n) (#64) * Initial work on metric config refactor in settings * Continue iterating on refactor up to the breakdown page * Remove routing to old metrics page - remove from menu * Styling adjustment * Fix key warning Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Metric Details & Breakdowns (2/n) (#66) * Initial work on metric config refactor in settings * Continue iterating on refactor up to the breakdown page * Styling adjustment * Change MetricView to MetricConfiguration and update all imports - remove MetricViewMocks Restyle metric details up to breakdown dimensions New breakdown copy Refactor breakdowns with toggles * Refactor disaggregations to use checkboxes and remove toggle switch * Add definitions panel, add icon * Style clean up - comments * Clean up * Feedback: reduce height in metric boxes, only use filteredMetricSettings optimization Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Definitions (3/n) (#83) * Initial work on MetricDefinitions component * Continue fleshing out definitions component, move metric context config to overall metric definition panel, set up mocks for definitions, add and update types, fix adjustments dependent on changes * Adjust styles for scrolling * Clean up * Style and comment clean up * Fix type * Use undefined vs empty string * Fix key warning * Settings: Metric Configuration: Navigation (Table of Contents) (4/n) (#85) * Add table of contents navigation when inside of metric details, move shared state to settings page and pass state to menu and metric config, fix disaggregation issues, add styling for table of contents, fix bug in mocks, add types, various adjustments to accommodate new change * Clean up * Add comments Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Refactor & Clean Up (5/n) (#91) * Major clean up - separate components into their own files * Fix dimension bug * Fix switch agency bug * Minor clean up * Merge types with existing types and update all connected components * Clean up * Handle cases when settings array is empty or non-existent * Handle cases when settings array is empty or non-existent * Styling adjustments per prev feedback * Recreate MetricsView Component for Data Visualization (#101) * Recreate old MetricsView component Update route and add to menu Update styling Remove unnecessary code - minor refactor Clean up * Fix styling issue * Add spacing between header and data viz * Add border top to data viz dropdown * Update tooltip and link to direct users to Settings to change metric config Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Settings: Metric Configuration: Save Definitions (and Replace Mocks) (6/n) (#108) * [Summary] Remove mocks and implement definition saving functionality and UI update functionality * Revert to default values functionality * Fix revert to default for metric setting * Clean up comment * PR feedback: reverse the conditionals * Settings: Metric Configuration: Playtesting Followups - Misc. Styling Adjustments (1/n) (#110) * Remove tabs in metric list when agency has only one system * Change casing to capitalized case on Monthly Annual badges * Reduce spacing of Settings menu * Scroll gap adjustment * Settings: Metric Configuration: Playtesting Followups - Selection States (2/n) (#112) * Add arrow vector, add logic for persisting on click, update hover and active states, clean up * Settings: Metric Configuration: Playtesting Followups - Default Definition Hover State (3/n) (#113) * Add hover feature to display the default settings when user hovers over the revert button * Update to Choose instead of Revert per design * Clean up * Settings: Metric Configuration: Playtesting Followups - Enable Dimension Selection When Disaggregation is Off (4/n) (#115) * When disaggregation and dimensions are all off, checking on a dimension will turn on the disaggregation * Styling bug fixes * Implement responsiveness per design (#117) Co-authored-by: Mahmoud <mahmoud@Mahmouds-MBP.cable.rcn.com> Rebase adjustments - updating imports, types and other react upgrade related adjustments Refactor settings to use routes
Description of the change
Implements functionality to save includes/excludes definition responses and update UI with the changes.
MetricConfig-SaveDefinitions.mov
Related issues
Closes #82
Checklists
Development
This box MUST be checked by the submitter prior to merging:
These boxes should be checked by the submitter prior to merging:
Code review
These boxes should be checked by reviewers prior to merging: