From ccdfdd40c8447fe69bd25963c13b415fb7aa892f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=83=D1=84=20=D0=9B=D0=B0=D1=82=D1=8B=D0=BF?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Sat, 28 Dec 2024 01:41:35 +0300 Subject: [PATCH 1/4] SUPPORT-8717: setting default label color --- .../AbstractRoundLabelConfiguration.java | 4 +- .../plugin/DoughnutCenterLabelsPlugin.ts | 54 ++++++++++--------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/backend/src/main/java/ervu_business_metrics/component/chart/label/AbstractRoundLabelConfiguration.java b/backend/src/main/java/ervu_business_metrics/component/chart/label/AbstractRoundLabelConfiguration.java index bcbd41f..9b58d3d 100644 --- a/backend/src/main/java/ervu_business_metrics/component/chart/label/AbstractRoundLabelConfiguration.java +++ b/backend/src/main/java/ervu_business_metrics/component/chart/label/AbstractRoundLabelConfiguration.java @@ -11,10 +11,10 @@ import ru.cg.webbpm.modules.standard_annotations.editor.ColorEditor; */ public abstract class AbstractRoundLabelConfiguration implements RoundLabelConfiguration { - public Font font = Font.of("sans-serif", "500", 14); + public Font font; @ColorEditor - public String color = "#FFFFFF"; + public String color; @Override public ChartLabelModel getLabelModel(LoadOptions loadOptions) { diff --git a/frontend/src/ts/ervu_business_metrics/component/chart/plugin/DoughnutCenterLabelsPlugin.ts b/frontend/src/ts/ervu_business_metrics/component/chart/plugin/DoughnutCenterLabelsPlugin.ts index e0a8247..478af5f 100644 --- a/frontend/src/ts/ervu_business_metrics/component/chart/plugin/DoughnutCenterLabelsPlugin.ts +++ b/frontend/src/ts/ervu_business_metrics/component/chart/plugin/DoughnutCenterLabelsPlugin.ts @@ -1,32 +1,39 @@ -import {ChartPlugin} from "./ChartPlugin"; +import { + AdvancedProperty, + AnalyticalScope, + Behavior, + ChartFontFamily, + ColorEditor, + Visible +} from "@webbpm/base-package"; import {Chart} from "chart.js"; import { ChartLabelModel } from "../../../../generated/ervu_business_metrics/model/chart/round/label/ChartLabelModel"; -import {ChartUtils} from "../ChartUtils"; -import {AnalyticalScope, Behavior, ChartFontFamily, Visible} from "@webbpm/base-package"; -import {ErvuChartV2} from "../ErvuChartV2"; +import {Font} from "../../../../generated/ervu_business_metrics/model/Font"; import {ChartLabelFormatter} from "./formatters/ChartLabelFormatter"; +import {ChartPlugin} from "./ChartPlugin"; +import {ChartUtils} from "../ChartUtils"; +import {ErvuChartV2} from "../ErvuChartV2"; @AnalyticalScope(ErvuChartV2) export class DoughnutCenterLabelsPlugin extends Behavior implements ChartPlugin { - public static readonly ID = 'doughnut-center-labels'; - private static readonly DEFAULTS = { - color: 'rgb(255, 255, 255)', - font: { - family: ChartFontFamily.SANS_SERIF, - weight: '500', - size: 14 - } - } - @Visible('false') - public id: string = DoughnutCenterLabelsPlugin.ID; - + public id: string = 'doughnut-center-labels'; + @ColorEditor() + public defaultColor: string = 'rgb(0, 0, 0)'; + @AdvancedProperty() + public defaultFont: Font = { + family: ChartFontFamily.SANS_SERIF, + weight: '500', + size: 14 + } + @AdvancedProperty() public formatters: ChartLabelFormatter[] = []; beforeDatasetsDraw(chart: Chart, args?: { cancellable: true }, options?: any): void { - if (!chart.data || !chart.data.datasets || !(chart.data).centerLabels || ChartUtils.isEmpty(chart)) { + if (!chart.data || !chart.data.datasets || !(chart.data).centerLabels + || ChartUtils.isEmpty(chart)) { return; } @@ -101,18 +108,15 @@ export class DoughnutCenterLabelsPlugin extends Behavior implements ChartPlugin formatter.format(label, labels, index); } - label.color = label.color ? label.color : DoughnutCenterLabelsPlugin.DEFAULTS.color; + label.color = label.color ? label.color : this.defaultColor; if (label.font) { - label.font.family = - label.font.family ? label.font.family : DoughnutCenterLabelsPlugin.DEFAULTS.font.family; - label.font.weight = - label.font.weight ? label.font.weight : DoughnutCenterLabelsPlugin.DEFAULTS.font.weight; - label.font.size = - label.font.size ? label.font.size : DoughnutCenterLabelsPlugin.DEFAULTS.font.size; + label.font.family = label.font.family ? label.font.family : this.defaultFont.family; + label.font.weight = label.font.weight ? label.font.weight : this.defaultFont.weight; + label.font.size = label.font.size ? label.font.size : this.defaultFont.size; } else { - label.font = DoughnutCenterLabelsPlugin.DEFAULTS.font + label.font = this.defaultFont; } }); } From ad20c115a20a5682cfbf9acf4580daeb1649319f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=83=D1=84=20=D0=9B=D0=B0=D1=82=D1=8B=D0=BF?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Sat, 28 Dec 2024 01:46:18 +0300 Subject: [PATCH 2/4] SUPPORT-8717: test on conversion page --- .../ervu-business-metrics/conversion.page | 91 ++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/resources/src/main/resources/business-model/ervu-business-metrics/conversion.page b/resources/src/main/resources/business-model/ervu-business-metrics/conversion.page index 3837842..3633bb0 100644 --- a/resources/src/main/resources/business-model/ervu-business-metrics/conversion.page +++ b/resources/src/main/resources/business-model/ervu-business-metrics/conversion.page @@ -1500,7 +1500,6 @@ 0b71ab2a-0c7f-4268-9b59-e8ef23bcea4e ГК Первый ряд показателей true - false false @@ -3237,6 +3236,86 @@ dataSetService + + centerLabelConfigurations + + + + + + label + + "test" + + + + false + + StaticRoundLabelDataSet + ervu_business_metrics.component.chart.label + + + + + + + + color + + "#001A80FF" + + + + font + + + + size + + 30 + + + + + + + label + + "big" + + + + false + + StaticRoundLabelDataSet + ervu_business_metrics.component.chart.label + + + + + + + + color + + "#FF0000FF" + + + + label + + "red" + + + + + StaticRoundLabelDataSet + ervu_business_metrics.component.chart.label + + + + + dataSetConfigurations @@ -3389,6 +3468,7 @@ + false @@ -3432,6 +3512,7 @@ + false @@ -3533,6 +3614,14 @@ + + + + DoughnutCenterLabelsPlugin + ervu_business_metrics.component.chart.plugin + + true + true From 24790fd5e305bd8a0bae87bba08ce741252018cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=83=D1=84=20=D0=9B=D0=B0=D1=82=D1=8B=D0=BF?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Sat, 28 Dec 2024 13:51:07 +0300 Subject: [PATCH 3/4] SUPPORT-8717: fix default font setting --- .../plugin/DoughnutCenterLabelsPlugin.ts | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/frontend/src/ts/ervu_business_metrics/component/chart/plugin/DoughnutCenterLabelsPlugin.ts b/frontend/src/ts/ervu_business_metrics/component/chart/plugin/DoughnutCenterLabelsPlugin.ts index 478af5f..8eecc6b 100644 --- a/frontend/src/ts/ervu_business_metrics/component/chart/plugin/DoughnutCenterLabelsPlugin.ts +++ b/frontend/src/ts/ervu_business_metrics/component/chart/plugin/DoughnutCenterLabelsPlugin.ts @@ -10,7 +10,6 @@ import {Chart} from "chart.js"; import { ChartLabelModel } from "../../../../generated/ervu_business_metrics/model/chart/round/label/ChartLabelModel"; -import {Font} from "../../../../generated/ervu_business_metrics/model/Font"; import {ChartLabelFormatter} from "./formatters/ChartLabelFormatter"; import {ChartPlugin} from "./ChartPlugin"; import {ChartUtils} from "../ChartUtils"; @@ -20,16 +19,17 @@ import {ErvuChartV2} from "../ErvuChartV2"; export class DoughnutCenterLabelsPlugin extends Behavior implements ChartPlugin { @Visible('false') public id: string = 'doughnut-center-labels'; + + public formatters: ChartLabelFormatter[] = []; + @ColorEditor() public defaultColor: string = 'rgb(0, 0, 0)'; @AdvancedProperty() - public defaultFont: Font = { - family: ChartFontFamily.SANS_SERIF, - weight: '500', - size: 14 - } + public defaultFontFamily: string = ChartFontFamily.SANS_SERIF; @AdvancedProperty() - public formatters: ChartLabelFormatter[] = []; + public defaultFontWeight: string = '500'; + @AdvancedProperty() + public defaultFontSize: number = 14; beforeDatasetsDraw(chart: Chart, args?: { cancellable: true }, options?: any): void { if (!chart.data || !chart.data.datasets || !(chart.data).centerLabels @@ -111,12 +111,16 @@ export class DoughnutCenterLabelsPlugin extends Behavior implements ChartPlugin label.color = label.color ? label.color : this.defaultColor; if (label.font) { - label.font.family = label.font.family ? label.font.family : this.defaultFont.family; - label.font.weight = label.font.weight ? label.font.weight : this.defaultFont.weight; - label.font.size = label.font.size ? label.font.size : this.defaultFont.size; + label.font.family = label.font.family ? label.font.family : this.defaultFontFamily; + label.font.weight = label.font.weight ? label.font.weight : this.defaultFontWeight; + label.font.size = label.font.size ? label.font.size : this.defaultFontSize; } else { - label.font = this.defaultFont; + label.font = { + family: this.defaultFontFamily, + weight: this.defaultFontWeight, + size: this.defaultFontSize + }; } }); } From 5ef8758cc6bbdea06cf189fe7fc2916dda9f441c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D0=BE=D0=B0=D1=82=20=D0=A1=D0=B0=D0=BB=D1=8F=D1=85?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Thu, 9 Jan 2025 13:01:29 +0300 Subject: [PATCH 4/4] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20?= =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2=D1=8B=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ervu-business-metrics/conversion.page | 104 +++++++++--------- 1 file changed, 55 insertions(+), 49 deletions(-) diff --git a/resources/src/main/resources/business-model/ervu-business-metrics/conversion.page b/resources/src/main/resources/business-model/ervu-business-metrics/conversion.page index 3633bb0..83eb8f3 100644 --- a/resources/src/main/resources/business-model/ervu-business-metrics/conversion.page +++ b/resources/src/main/resources/business-model/ervu-business-metrics/conversion.page @@ -3239,81 +3239,76 @@ centerLabelConfigurations - + + + + - label + aggregationFunction - "test" - - - - false - - StaticRoundLabelDataSet - ervu_business_metrics.component.chart.label - - - - - - - - color - - "#001A80FF" + "SUM" font + + family + + "GolosUI" + + size - 30 + 22 + + + + weight + + "550" - label + loadDao - "big" - - - - false - - StaticRoundLabelDataSet - ervu_business_metrics.component.chart.label - - - - - - - - color - - "#FF0000FF" + + + graph + + {"conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"nodeByIndex":{"0":{"tableName":"convert_info_loaded_records","schemaName":"metrics","x":347.0,"y":168.0,"alias":"convert_info_loaded_records","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"},"1":{"tableName":"recruitment","schemaName":"metrics","x":88.0,"y":305.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"},"2":{"tableName":"view_convert_info_loaded_records","schemaName":"metrics","x":603.0,"y":245.0,"alias":"view_convert_info_loaded_records","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"nodes":[{"tableName":"convert_info_loaded_records","schemaName":"metrics","x":347.0,"y":168.0,"alias":"convert_info_loaded_records","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"},{"tableName":"recruitment","schemaName":"metrics","x":88.0,"y":305.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"},{"tableName":"view_convert_info_loaded_records","schemaName":"metrics","x":603.0,"y":245.0,"alias":"view_convert_info_loaded_records","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}],"nodeByEntityName":{"view_convert_info_loaded_records":{"tableName":"view_convert_info_loaded_records","schemaName":"metrics","x":603.0,"y":245.0,"alias":"view_convert_info_loaded_records","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"},"recruitment":{"tableName":"recruitment","schemaName":"metrics","x":88.0,"y":305.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"},"convert_info_loaded_records":{"tableName":"convert_info_loaded_records","schemaName":"metrics","x":347.0,"y":168.0,"alias":"convert_info_loaded_records","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"matrix":[[null,{"refOnEntityName":"convert_info_loaded_records","refToEntityName":"recruitment","refToColumns":[{"schema":"metrics","table":"recruitment","entity":"recruitment","name":"id"}],"refOnColumns":[{"schema":"metrics","table":"convert_info_loaded_records","entity":"convert_info_loaded_records","name":"recruitment_id"}],"required":false,"cyclic":false,"conditionGroup":{"operator":"AND","conditions":[],"groups":[]}},null],[null,null,null],[{"refOnEntityName":"view_convert_info_loaded_records","refToEntityName":"convert_info_loaded_records","refToColumns":[{"schema":"metrics","table":"convert_info_loaded_records","entity":"convert_info_loaded_records","name":"convert_info_loaded_records_id"}],"refOnColumns":[{"schema":"metrics","table":"view_convert_info_loaded_records","entity":"view_convert_info_loaded_records","name":"convert_info_loaded_records_id"}],"required":false,"cyclic":false,"conditionGroup":{"operator":"AND","conditions":[],"groups":[]}},null,null]],"mainNodeIndex":0} + + + + +DefaultLoadDao +database.dao + - label + valueColumn - "red" + {"schema":"metrics","table":"view_convert_info_loaded_records","entity":"view_convert_info_loaded_records","name":"count_all"} - StaticRoundLabelDataSet + DefaultRoundLabelConfiguration ervu_business_metrics.component.chart.label + + + @@ -3428,6 +3423,7 @@ + false @@ -3466,9 +3462,9 @@ + false - false @@ -3489,7 +3485,6 @@ ervu_business_metrics.component.chart true - true cssClasses @@ -3529,7 +3524,6 @@ ervu_business_metrics.component.chart.plugin true - true @@ -3537,7 +3531,6 @@ ervu_business_metrics.component.filter true - true references @@ -3589,7 +3582,6 @@ ervu_business_metrics.component.filter true - true filterComponents @@ -3621,7 +3613,18 @@ ervu_business_metrics.component.chart.plugin true - true + + + formatters + + + + + + + + + @@ -4538,6 +4541,7 @@ a7b44f97-c49f-4356-b45d-64c4d6e71f8b ВК Результат сопоставления csv и xml файлов true + false false @@ -7127,6 +7131,7 @@ ea4d0df5-9e4f-48b2-bf91-3a72d3a90640 ГК третий ряд показателей true + false false @@ -7164,6 +7169,7 @@ 8b2e7937-7d15-4bba-9f68-d60fb396e615 ВК Отправка уведомлений в ЛК гражданина на ЕПГУ true + false false