Explore: Sort trace process attributes alphabetically (#51261)

* Explore: Sort trace process attributes alphabetically

* Update betterer?
This commit is contained in:
Connor Lindsey
2022-06-24 08:20:23 -06:00
committed by GitHub
parent dc68213114
commit 620309ced5
4 changed files with 24 additions and 19 deletions

View File

@@ -1,17 +1,14 @@
import { css } from '@emotion/css';
import React from 'react';
import { Field, FieldNamePickerConfigSettings, StandardEditorProps, StandardEditorsRegistryItem } from '@grafana/data';
import { Field, StandardEditorProps } from '@grafana/data';
import { Button, ColorPicker, useStyles2 } from '@grafana/ui';
import { FieldNamePicker } from '@grafana/ui/src/components/MatchersUI/FieldNamePicker';
import { ArcOption, NodeGraphOptions } from '../types';
type ArcOptionsEditorProps = StandardEditorProps<ArcOption[], any, NodeGraphOptions, any>;
const fieldNamePickerSettings: StandardEditorsRegistryItem<string, FieldNamePickerConfigSettings> = {
settings: { filter: (field: Field) => field.name.includes('arc__') },
} as any;
type Settings = { filter: (field: Field) => boolean };
type ArcOptionsEditorProps = StandardEditorProps<ArcOption[], Settings, NodeGraphOptions, undefined>;
export const ArcOptionsEditor = ({ value, onChange, context }: ArcOptionsEditorProps) => {
const styles = useStyles2(getStyles);
@@ -44,7 +41,14 @@ export const ArcOptionsEditor = ({ value, onChange, context }: ArcOptionsEditorP
onChange={(val) => {
updateField(i, 'field', val);
}}
item={fieldNamePickerSettings}
item={{
settings: {
filter: (field: Field) => field.name.includes('arc__'),
},
id: `arc-field-${i}`,
name: `arc-field-${i}`,
editor: () => null,
}}
/>
<ColorPicker
color={arc.color || '#808080'}

View File

@@ -15,7 +15,7 @@ interface NodeOptions {
export interface ArcOption {
field?: string;
color?: any;
color?: string;
}
interface EdgeOptions {