mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DashboardSettings: Migrates annotations list & edit view from angular to react and new forms styles (#31950)
* Initial commit, list and edit page working * Progress * angular and standard editors work * Unifying more between annotations list and links list * Remove submenu visibilty stuff * Update packages/grafana-data/src/types/annotations.ts Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> * Review feedback * fixed checkbox * Fixes * test(annotationsettings): initial commit of tests * delete files brought back by master merge * update datasourcepicker import path * update emotion import * test(linksettings): clean up tests * Fixed test * test(annotationssettings): add remaining tests * docs(grafana-data): export namespace for docs build * docs(grafana-ui): export ColorValueEditorProps for docs build * docs(grafana-ui): add docs annotation for ColorValueEditorProps Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@ import coreModule from 'app/core/core_module';
|
||||
interface Props {
|
||||
datasource: DataSourceApi;
|
||||
annotation: AnnotationQuery<DataQuery>;
|
||||
change: (annotation: AnnotationQuery<DataQuery>) => void;
|
||||
onChange: (annotation: AnnotationQuery<DataQuery>) => void;
|
||||
}
|
||||
|
||||
interface State {
|
||||
@@ -48,7 +48,7 @@ export default class StandardAnnotationQueryEditor extends PureComponent<Props,
|
||||
|
||||
const fixed = processor.prepareAnnotation!(annotation);
|
||||
if (fixed !== annotation) {
|
||||
this.props.change(fixed);
|
||||
this.props.onChange(fixed);
|
||||
} else {
|
||||
this.onRunQuery();
|
||||
}
|
||||
@@ -75,14 +75,14 @@ export default class StandardAnnotationQueryEditor extends PureComponent<Props,
|
||||
};
|
||||
|
||||
onQueryChange = (target: DataQuery) => {
|
||||
this.props.change({
|
||||
this.props.onChange({
|
||||
...this.props.annotation,
|
||||
target,
|
||||
});
|
||||
};
|
||||
|
||||
onMappingChange = (mappings: AnnotationEventMappings) => {
|
||||
this.props.change({
|
||||
this.props.onChange({
|
||||
...this.props.annotation,
|
||||
mappings,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user