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

Add strings to accepted fields for Insights Panel "Metrics" #10828

Merged
merged 49 commits into from
Feb 3, 2022

Conversation

jamescammarano
Copy link
Contributor

@jamescammarano jamescammarano commented Jan 3, 2022

Add strings to accepted fields for Insights Panel "Metrics"
Before this PR:

  • The insights dashboard had a metrics panel that allowed aggregation of a field. It only accepted numbers though.
  • The panel-configuration used v-form to display options.
  • the index.ts for the PanelConfig only took objects.
  • metrics.vue only displayed numbers.
  • The field-configuration passed a function to an extensions-options component.

Now:

  • field-configuration passes an object to extensions-options
  • extension-options takes an object not a function
  • The PanelConfig interface has a property for alterOptions which is a function that returns an altered Panel object. In the case of metrics the fields are altered to display different choices.
  • panel-configuration uses extension-options to display the fields available and allows props.panel.alterOptions() to change any display property.
  • metrics/index.ts contains a function that removes the choices from the function field.
  • metrics.vue takes NaN for display values.

TODO:

  • Load the current options when editing a panel
  • Reset values when collection changes
  • clear values when selected panel configuration changes (EX: metric to list)
  • Configure all of the panels that use extension-options to work with the new changes

Future-Proofing:
I added an optional property to the PanelConfig interface to allow a function that manipulates what the edits object contains. I pass the whole panel edits object to the panel from panel-configuration. This will allow future panels to use the alterOptions function to change more than just what fields are available.

Preview:
divider

Screen Shot 2022-01-07 at 10 53 55 AM

@jamescammarano jamescammarano self-assigned this Jan 7, 2022
@jamescammarano jamescammarano marked this pull request as ready for review January 7, 2022 23:00
@jamescammarano jamescammarano marked this pull request as ready for review January 10, 2022 18:58
@rijkvanzanten
Copy link
Member

@jaycammarano Is this still a (WIP) as the title suggests?

@jamescammarano jamescammarano changed the title Add strings to accepted fields for Insights Panel "Metrics" (WIP) Add strings to accepted fields for Insights Panel "Metrics" Jan 12, 2022
@jamescammarano
Copy link
Contributor Author

@jaycammarano Is this still a (WIP) as the title suggests?

no

@rijkvanzanten rijkvanzanten removed this from the v9.5.0 milestone Jan 21, 2022
Copy link
Member

@rijkvanzanten rijkvanzanten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll handle the review points 👍🏻

@rijkvanzanten rijkvanzanten added this to the v9-next milestone Feb 3, 2022
@rijkvanzanten rijkvanzanten merged commit f40a3e9 into main Feb 3, 2022
@rijkvanzanten rijkvanzanten deleted the insights-panel-extension branch February 3, 2022 21:55
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants