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

grafana/ui: Enable React based options editors for Datasource plugins #16748

Merged
merged 3 commits into from Apr 24, 2019

Conversation

dprokop
Copy link
Member

@dprokop dprokop commented Apr 24, 2019

Side effect of #16731 discovery phase. Follows the same convention (setEditor) as React panels do.

@dprokop dprokop requested a review from torkelo April 24, 2019 13:32
@@ -36,10 +37,12 @@ export interface Props {
setDataSourceName: typeof setDataSourceName;
updateDataSource: typeof updateDataSource;
setIsDefault: typeof setIsDefault;
plugin?: DataSourcePlugin<any, any>;
Copy link
Member

Choose a reason for hiding this comment

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

you do not need the any, any the types are optional?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, but Options are not optional. Gonna make options default to be {}


constructor(DataSourceClass: DataSourceConstructor<TQuery>) {
this.DataSourceClass = DataSourceClass;
this.components = {};
}

setEditor(editor: React.ComponentType<DataSourcePluginOptionsEditorProps<TOptions>>) {
Copy link
Member

Choose a reason for hiding this comment

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

Editor is a bit too non-descriptive for a data source, as it already as a QueryEditor.

Think setConfigEditor is more descriptive (as the current angular version is called ConfigCtrl). Also think this should be on the components sub object along with all the other components.

@ryantxu
Copy link
Member

ryantxu commented Apr 24, 2019

Check #16586 also... It includes something like this.

Nevermind -- this does not replace the whole page with react :)

@dprokop
Copy link
Member Author

dprokop commented Apr 24, 2019

@ryantxu yeah, this one is waaaaay simpler. But i see a future in your PluginWithConfig interface ;)

@dprokop dprokop merged commit 7aeae84 into master Apr 24, 2019
ryantxu added a commit to ryantxu/grafana that referenced this pull request Apr 25, 2019
…a-alt

* grafana/master:
  Feature: Enable React based options editors for Datasource plugins (grafana#16748)
@dprokop dprokop deleted the ds-plugins/react-editors branch April 25, 2019 06:08
ryantxu added a commit to ryantxu/grafana that referenced this pull request Apr 25, 2019
* grafana/master:
  GraphLegendEditor: use stats picker rather than switches (grafana#16759)
  Feature: add cron setting for the ldap settings (grafana#16673)
  Build: Disables gosec until identified performance problems (grafana#16764)
  Chore: bump jQuery to 3.4.0 including prototype pollution vulnerability fix (grafana#16761)
  elasticsearch: add 7.x version support (grafana#16646)
  Provisioning: Add API endpoint to reload provisioning configs (grafana#16579)
  Config: Show user-friendly error message instead of stack trace (grafana#16564)
  Chore: Lowered implicit anys limit to 5954
  Feature: Enable React based options editors for Datasource plugins (grafana#16748)
  sqlstore: use column name in order by (grafana#16583)
  user friendly guide (grafana#16743)
  Provisioning: Interpolate env vars in provisioning files (grafana#16499)
  admin: add more stats about roles (grafana#16667)
  Feature: Migrate Legend components to grafana/ui (grafana#16468)
  playlist: fix loading dashboards by tag (grafana#16727)
  CloudWatch: Use default alias if there is no alias for metrics (grafana#16732)
  Provisioning: Support FolderUid in Dashboard Provisioning Config (grafana#16559)
ryantxu added a commit to ryantxu/grafana that referenced this pull request Apr 25, 2019
…MetricPanelCtrl

* grafana/master: (34 commits)
  Streaming: support streaming and a javascript test datasource (grafana#16729)
  GraphLegendEditor: use stats picker rather than switches (grafana#16759)
  Feature: add cron setting for the ldap settings (grafana#16673)
  Build: Disables gosec until identified performance problems (grafana#16764)
  Chore: bump jQuery to 3.4.0 including prototype pollution vulnerability fix (grafana#16761)
  elasticsearch: add 7.x version support (grafana#16646)
  Provisioning: Add API endpoint to reload provisioning configs (grafana#16579)
  Config: Show user-friendly error message instead of stack trace (grafana#16564)
  Chore: Lowered implicit anys limit to 5954
  Feature: Enable React based options editors for Datasource plugins (grafana#16748)
  sqlstore: use column name in order by (grafana#16583)
  user friendly guide (grafana#16743)
  Provisioning: Interpolate env vars in provisioning files (grafana#16499)
  admin: add more stats about roles (grafana#16667)
  Feature: Migrate Legend components to grafana/ui (grafana#16468)
  playlist: fix loading dashboards by tag (grafana#16727)
  CloudWatch: Use default alias if there is no alias for metrics (grafana#16732)
  Provisioning: Support FolderUid in Dashboard Provisioning Config (grafana#16559)
  Refactor: Make SelectOptionItem a generic type to enable select value typing (grafana#16718)
  docs: fix upgrade instructions
  ...
ryantxu added a commit to ryantxu/grafana that referenced this pull request Apr 25, 2019
* grafana/master:
  Streaming: support streaming and a javascript test datasource (grafana#16729)
  GraphLegendEditor: use stats picker rather than switches (grafana#16759)
  Feature: add cron setting for the ldap settings (grafana#16673)
  Build: Disables gosec until identified performance problems (grafana#16764)
  Chore: bump jQuery to 3.4.0 including prototype pollution vulnerability fix (grafana#16761)
  elasticsearch: add 7.x version support (grafana#16646)
  Provisioning: Add API endpoint to reload provisioning configs (grafana#16579)
  Config: Show user-friendly error message instead of stack trace (grafana#16564)
  Chore: Lowered implicit anys limit to 5954
  Feature: Enable React based options editors for Datasource plugins (grafana#16748)
  sqlstore: use column name in order by (grafana#16583)
  user friendly guide (grafana#16743)
  Provisioning: Interpolate env vars in provisioning files (grafana#16499)
  admin: add more stats about roles (grafana#16667)
  Feature: Migrate Legend components to grafana/ui (grafana#16468)
  playlist: fix loading dashboards by tag (grafana#16727)
  CloudWatch: Use default alias if there is no alias for metrics (grafana#16732)
  Provisioning: Support FolderUid in Dashboard Provisioning Config (grafana#16559)
ryantxu added a commit to ryantxu/grafana that referenced this pull request Apr 25, 2019
* grafana/master: (31 commits)
  Streaming: support streaming and a javascript test datasource (grafana#16729)
  GraphLegendEditor: use stats picker rather than switches (grafana#16759)
  Feature: add cron setting for the ldap settings (grafana#16673)
  Build: Disables gosec until identified performance problems (grafana#16764)
  Chore: bump jQuery to 3.4.0 including prototype pollution vulnerability fix (grafana#16761)
  elasticsearch: add 7.x version support (grafana#16646)
  Provisioning: Add API endpoint to reload provisioning configs (grafana#16579)
  Config: Show user-friendly error message instead of stack trace (grafana#16564)
  Chore: Lowered implicit anys limit to 5954
  Feature: Enable React based options editors for Datasource plugins (grafana#16748)
  sqlstore: use column name in order by (grafana#16583)
  user friendly guide (grafana#16743)
  Provisioning: Interpolate env vars in provisioning files (grafana#16499)
  admin: add more stats about roles (grafana#16667)
  Feature: Migrate Legend components to grafana/ui (grafana#16468)
  playlist: fix loading dashboards by tag (grafana#16727)
  CloudWatch: Use default alias if there is no alias for metrics (grafana#16732)
  Provisioning: Support FolderUid in Dashboard Provisioning Config (grafana#16559)
  Refactor: Make SelectOptionItem a generic type to enable select value typing (grafana#16718)
  docs: fix upgrade instructions
  ...
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.

None yet

3 participants