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

fix(612): modify split and values fields of x and y axis to accept bl… #638

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions src/app/ui/forms/plugins/plugins.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ function Controller($scope, $translate, events, modelManager, stateManager, form
{ value: '1', name: '1' },
{ value: '2', name: '2' },
{ value: 'date', name: $translate.instant('format.date') },
{ value: 'dynamic', name: $translate.instant('format.hour') }
{ value: 'hour', name: $translate.instant('format.hour') }
] },
{ 'key': 'rangeSlider.params.delay', 'titleMap': [
{ value: '3000', name: '3 sec' },
Expand Down Expand Up @@ -438,20 +438,26 @@ function Controller($scope, $translate, events, modelManager, stateManager, form
{ value: 'linear', name: $translate.instant('form.plugins.chartlinear') }
] },
{ 'key': 'chart.axis.xAxis.title' },
{ 'key': 'chart.axis.xAxis.values', 'condition': 'model.chart.type !== "line"' },
{ 'key': 'chart.axis.xAxis.split', 'condition': 'model.chart.type !== "line" && model.chart.axis.xAxis.type === "config"' }
{ 'key': 'chart.axis.xAxis.values' },
{ 'key': 'chart.axis.xAxis.split' }
] },
{ 'key': 'chart.axis.yAxis', 'items': [
{ 'key': 'chart.axis.yAxis.type', 'condition': 'model.chart.enable === true && model.chart.type == "bar"', 'titleMap': [
{ value: 'config', name: $translate.instant('form.plugins.chartconfig') },
{ value: 'field', name: $translate.instant('form.plugins.chartfield') }
] },
{ 'key': 'chart.axis.yAxis.type', 'condition': 'model.chart.enable === true && model.chart.type == "line"', 'titleMap': [
{ value: 'linear', name: $translate.instant('form.plugins.chartlinear') }
] },
{ 'key': 'chart.axis.yAxis.title' },
{ 'key': 'chart.axis.yAxis.values', 'condition': 'model.chart.type !== "line"' },
{ 'key': 'chart.axis.yAxis.split', 'condition': 'model.chart.type !== "line" && model.chart.axis.yAxis.type === "config"' }
{
'key': 'chart.axis.yAxis', 'items': [
{
'key': 'chart.axis.yAxis.type', 'condition': 'model.chart.enable === true && model.chart.type == "bar"', 'titleMap': [
{ value: 'config', name: $translate.instant('form.plugins.chartconfig') },
{ value: 'field', name: $translate.instant('form.plugins.chartfield') },
{ value: 'linear', name: $translate.instant('form.plugins.chartlinear') }
]
},
{
'key': 'chart.axis.yAxis.type', 'condition': 'model.chart.enable === true && model.chart.type == "line"', 'titleMap': [
{ value: 'linear', name: $translate.instant('form.plugins.chartlinear') }
]
},
{ 'key': 'chart.axis.yAxis.title' },
{ 'key': 'chart.axis.yAxis.values' },
{ 'key': 'chart.axis.yAxis.split', 'condition': '(model.chart.axis.yAxis.type === "config"||model.chart.axis.yAxis.type === "linear")'}
] }
] },
{ 'key': 'chart.layers', 'condition': 'model.chart.enable === true', 'add': null, 'items': [
Expand All @@ -477,12 +483,13 @@ function Controller($scope, $translate, events, modelManager, stateManager, form
{ 'type': 'fieldset', 'htmlClass': 'av-accordion-toggle', 'title': $translate.instant('form.plugins.chartdata'), 'items': [
{ 'type': 'help', 'htmlClass': 'av-form-advance hidden', 'helpvalue': '<div class="help-block">' + $translate.instant('form.map.expcoldesc') + '<div>' },
{ 'key': 'chart.layers[].data[]', 'htmlClass': `av-accordion-content`, 'notitle': true, 'items': [
{ 'key': 'chart.layers[].data[].type', 'condition': 'model.chart.layers[arrayIndex].type !== "link"', 'titleMap': [
{ 'key': 'chart.layers[].data[].type', 'titleMap': [
{ value: 'single', name: $translate.instant('form.plugins.chartdatatype1') },
{ value: 'combine', name: $translate.instant('form.plugins.chartdatatype2') }
] },
{ 'key': 'chart.layers[].data[].linkType', 'condition': 'model.chart.layers[arrayIndex].type === "link"', 'titleMap': [
{ value: 'single', name: $translate.instant('form.plugins.chartdatatype1') },
{ value: 'combine', name: $translate.instant('form.plugins.chartdatatype2') },
{ value: 'multi', name: $translate.instant('form.plugins.chartdatatype3') }
] },
{ 'key': 'chart.layers[].data[].link', 'condition': 'model.chart.layers[arrayIndex].type === "link"' },
Expand All @@ -491,12 +498,13 @@ function Controller($scope, $translate, events, modelManager, stateManager, form
{ 'key': 'chart.layers[].data[].measure', 'targetLink': 'legend.0', 'targetParent': 'av-accordion-toggle', 'default': $translate.instant('form.plugins.chartdata'), 'onChange': debounceService.registerDebounce((model, item) => {
self.formService.copyValueToFormIndex(model, item);}, constants.debInput, false)
},
{ 'key': 'chart.layers[].data[].regex', 'condition': 'model.chart.layers[arrayIndex].type !== "link"' },
{ 'key': 'chart.layers[].data[].split', 'condition': 'model.chart.layers[arrayIndex].type !== "link"' },
{ 'key': 'chart.layers[].data[].regex' },
{ 'key': 'chart.layers[].data[].split' },
{ 'key': 'chart.layers[].data[].label', 'condition': 'model.chart.enable === true', 'items': [
{ 'key': 'chart.layers[].data[].label.type', 'titleMap': [
{ value: 'config', name: $translate.instant('form.plugins.chartconfig') },
{ value: 'field', name: $translate.instant('form.plugins.chartfield') }
{ value: 'field', name: $translate.instant('form.plugins.chartfield') },
{ value: 'value', name: $translate.instant('form.plugins.chartvalue') }
] },
{ 'key': 'chart.layers[].data[].label.values' },
{ 'key': 'chart.layers[].data[].label.split' }
Expand Down
1 change: 1 addition & 0 deletions src/locales/translations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ form plugins chart,form.plugins.chartpie,Pie,0,Tarte,0
form plugins chart,form.plugins.chartbar,Bar,0,Barre,0
form plugins chart,form.plugins.chartline,Line,0,Ligne,0
form plugins chart,form.plugins.chartfield,Field,0,Champs,0
form plugins chart,form.plugins.chartvalue,Value,0,Valeur,0
form plugins chart,form.plugins.chartlink,Link,0,Lié,0
form plugins chart,form.plugins.chartinline,Inline,0,Interne,0
form plugins chart,form.plugins.chartconfig,Configuration,0,Configuration,0
Expand Down
18 changes: 10 additions & 8 deletions src/schemas/schemaForm/plugins.en-CA.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@
"title": "Split Character",
"type": "string",
"description": "Character to use to split list of values.",
"default": ";"
"default": ""
}
},
"required": ["type", "values", "split"]
"required": ["type"]
},
"yAxis": {
"title": "Y Axis",
Expand All @@ -419,7 +419,7 @@
"field",
"config",
"linear",
"time"
"date"
],
"description": "Retreive the labels from a field or configuration for bar chart or from values (linear or time) for line chart.",
"default": "config"
Expand All @@ -434,10 +434,10 @@
"title": "Split Character",
"type": "string",
"description": "Character to use to split list of values.",
"default": ";"
"default": ""
}
},
"required": ["type", "values", "split"]
"required": ["type"]
},
"required": ["xAxis", "yAxis"]
}
Expand Down Expand Up @@ -498,7 +498,8 @@
"type": "string",
"enum": [
"single",
"multi"
"multi",
"combine"
],
"description": "How data is structure inside the link table (single for one field for value and one for date OR multiple if there is multiple datasets inside one field and the chart needs to parse).",
"default": "single"
Expand Down Expand Up @@ -531,7 +532,8 @@
"type": "string",
"enum": [
"field",
"config"
"config",
"value"
],
"description": "Retreive the labels from a field or from the configuration.",
"default": "config"
Expand All @@ -549,7 +551,7 @@
"default": ";"
}
},
"required": ["type", "values", "split"]
"required": ["type", "values"]
},
"regex": {
"title": "Dataset splitter",
Expand Down
7 changes: 4 additions & 3 deletions src/schemas/schemaForm/plugins.fr-CA.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"default": ";"
}
},
"required": ["type", "values", "split"]
"required": ["type"]
},
"yAxis": {
"title": "Axes des Y",
Expand Down Expand Up @@ -436,7 +436,7 @@
"default": ";"
}
},
"required": ["type", "values", "split"]
"required": ["type"]
},
"required": ["xAxis", "yAxis"]
}
Expand Down Expand Up @@ -530,7 +530,8 @@
"type": "string",
"enum": [
"field",
"config"
"config",
"value"
],
"description": "Récupérer les étiquettes d'un champ ou de la configuration.",
"default": "config"
Expand Down