diff --git a/ui/src/views/admin/listForm/edit/options.ts b/ui/src/views/admin/listForm/edit/options.ts index 36ee2f68..333b8b7f 100644 --- a/ui/src/views/admin/listForm/edit/options.ts +++ b/ui/src/views/admin/listForm/edit/options.ts @@ -247,29 +247,29 @@ export const chartPaletteExtensionModeOptions = [ ] export const chartSeriesTypeOptions = [ - { value: 'line', label: 'Line' }, - { value: 'stepline', label: 'Stepline' }, - { value: 'bar', label: 'Bar' }, - { value: 'fullstackedbar', label: 'Fullstackedbar' }, - { value: 'rangebar', label: 'Rangebar' }, - { value: 'rangearea', label: 'Rangearea' }, - { value: 'fullstackedarea', label: 'Fullstackedarea' }, - { value: 'area', label: 'Area' }, - { value: 'bubble', label: 'Bubble' }, - { value: 'candlestick', label: 'Candlestick' }, - { value: 'fullstackedline', label: 'Fullstackedline' }, - { value: 'fullstackedspline', label: 'Fullstackedspline' }, - { value: 'fullstackedsplinearea', label: 'Fullstackedsplinearea' }, - { value: 'scatter', label: 'Scatter' }, - { value: 'spline', label: 'Spline' }, - { value: 'splinearea', label: 'Splinearea' }, - { value: 'stackedarea', label: 'Stackedarea' }, - { value: 'stackedbar', label: 'Stackedbar' }, - { value: 'stackedline', label: 'Stackedline' }, - { value: 'stackedspline', label: 'Stackedspline' }, - { value: 'stackedsplinearea', label: 'Stackedsplinearea' }, - { value: 'steparea', label: 'Steparea' }, - { value: 'stock', label: 'Stock' }, + { value: 'line', label: 'Line', icon: 'πŸ“ˆ' }, + { value: 'stepline', label: 'Stepline', icon: 'πŸ“‰' }, + { value: 'bar', label: 'Bar', icon: 'πŸ“Š' }, + { value: 'fullstackedbar', label: 'Fullstacked Bar', icon: 'πŸ“š' }, + { value: 'rangebar', label: 'Range Bar', icon: 'πŸ“' }, + { value: 'rangearea', label: 'Range Area', icon: 'πŸ—ΊοΈ' }, + { value: 'fullstackedarea', label: 'Fullstacked Area', icon: '⛰️' }, + { value: 'area', label: 'Area', icon: 'πŸ”οΈ' }, + { value: 'bubble', label: 'Bubble', icon: '🫧' }, + { value: 'candlestick', label: 'Candlestick', icon: 'πŸ•―οΈ' }, + { value: 'fullstackedline', label: 'Fullstacked Line', icon: 'πŸ“Ά' }, + { value: 'fullstackedspline', label: 'Fullstacked Spline', icon: 'γ€°οΈπŸ“Ά' }, + { value: 'fullstackedsplinearea', label: 'Fullstacked Spline Area', icon: '⛰️〰' }, + { value: 'scatter', label: 'Scatter', icon: 'πŸ”΅' }, + { value: 'spline', label: 'Spline', icon: '〰️' }, + { value: 'splinearea', label: 'Spline Area', icon: 'πŸŒ„' }, + { value: 'stackedarea', label: 'Stacked Area', icon: 'πŸ§±β›°οΈ' }, + { value: 'stackedbar', label: 'Stacked Bar', icon: 'πŸ§±πŸ“Š' }, + { value: 'stackedline', label: 'Stacked Line', icon: 'πŸ§±πŸ“ˆ' }, + { value: 'stackedspline', label: 'Stacked Spline', icon: 'πŸ§±γ€°οΈ' }, + { value: 'stackedsplinearea', label: 'Stacked Spline Area', icon: 'πŸ§±πŸŒ„' }, + { value: 'steparea', label: 'Step Area', icon: 'πŸͺœ' }, + { value: 'stock', label: 'Stock', icon: 'πŸ’Ή' }, ] export const chartSeriesSelectionModeOptions = [ diff --git a/ui/src/views/list/ChartDrawer.tsx b/ui/src/views/list/ChartDrawer.tsx index 251ed253..36d94302 100644 --- a/ui/src/views/list/ChartDrawer.tsx +++ b/ui/src/views/list/ChartDrawer.tsx @@ -2,7 +2,7 @@ import { Button, FormContainer, Input, Notification, Select, toast } from '@/com import { Field, FieldArray, Form, Formik, FieldProps } from 'formik' import { FaMinus, FaPlus, FaTimes, FaSave } from 'react-icons/fa' import { SelectBoxOption } from '@/types/shared' -import { columnSummaryTypeListOptions } from '../admin/listForm/edit/options' +import { chartSeriesTypeOptions, columnSummaryTypeListOptions } from '../admin/listForm/edit/options' import { ChartSeriesDto } from '@/proxy/admin/charts/models' import { useLocalization } from '@/utils/hooks/useLocalization' import { useStoreState } from '@/store/store' @@ -35,24 +35,15 @@ const ChartDrawer = ({ series: array().of( object().shape({ name: string().required(translate('::App.Platform.ChartDrawer.NameRequired')), - argumentField: string().required(translate('::App.Platform.ChartDrawer.ArgumentFieldRequired')), + argumentField: string().required( + translate('::App.Platform.ChartDrawer.ArgumentFieldRequired'), + ), valueField: string().required(translate('::App.Platform.ChartDrawer.ValueFieldRequired')), summaryType: string().required(translate('::App.Platform.ChartDrawer.SummaryTypeRequired')), }), ), }) - // Chart type icons - const chartTypeIcons = [ - { type: 'line', label: 'Line', icon: 'πŸ“ˆ' }, - { type: 'bar', label: 'Bar', icon: 'πŸ“Š' }, - { type: 'area', label: 'Area', icon: 'πŸ”οΈ' }, - { type: 'scatter', label: 'Scatter', icon: 'πŸ”΅' }, - { type: 'spline', label: 'Spline', icon: '〰️' }, - { type: 'stackedbar', label: 'Stacked Bar', icon: 'πŸ“š' }, - { type: 'stackedarea', label: 'Stacked Area', icon: '⛰️' }, - ] - const newSeriesValue = () => { return { index: -1, @@ -111,9 +102,14 @@ const ChartDrawer = ({ onSubmit={async (values, { setSubmitting }) => { try { await onSave(values.series) - toast.push({translate('::App.Platform.ChartDrawer.ChartSaved')}, { - placement: 'top-end', - }) + toast.push( + + {translate('::App.Platform.ChartDrawer.ChartSaved')} + , + { + placement: 'top-end', + }, + ) onClose() } catch (error: any) { toast.push( @@ -186,7 +182,9 @@ const ChartDrawer = ({ > {/* Header */}
- {translate('::App.Platform.ChartDrawer.Series')} #{index + 1} + + {translate('::App.Platform.ChartDrawer.Series')} #{index + 1} + {selectedSeriesIndex === index && (
- {chartTypeIcons.map((chartType) => ( + {chartSeriesTypeOptions.map((chartType) => ( @@ -256,7 +256,9 @@ const ChartDrawer = ({ {/* Name */}
- + { form.setFieldValue(field.name, option?.value) }} - placeholder={translate('::App.Platform.ChartDrawer.SelectField')} + placeholder={translate( + '::App.Platform.ChartDrawer.SelectField', + )} /> )} @@ -308,7 +312,9 @@ const ChartDrawer = ({ onChange={(option) => { form.setFieldValue(field.name, option?.value) }} - placeholder={translate('::App.Platform.ChartDrawer.SelectField')} + placeholder={translate( + '::App.Platform.ChartDrawer.SelectField', + )} /> )} @@ -351,7 +357,9 @@ const ChartDrawer = ({