From 1540f08695cfbd0733a19a922c0b3afd0a490535 Mon Sep 17 00:00:00 2001 From: Chantsova Ekaterina Date: Wed, 19 Feb 2020 16:10:54 +0200 Subject: [PATCH 1/2] Add ability to use custom translations and labels containing apostrophe in table default sort order (#2397) --- ui/src/app/widget/lib/entities-table-widget.js | 4 ++-- ui/src/app/widget/lib/entities-table-widget.tpl.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/app/widget/lib/entities-table-widget.js b/ui/src/app/widget/lib/entities-table-widget.js index 19b25ae724..e8cedd640e 100644 --- a/ui/src/app/widget/lib/entities-table-widget.js +++ b/ui/src/app/widget/lib/entities-table-widget.js @@ -196,9 +196,9 @@ function EntitiesTableWidgetController($element, $scope, $filter, $mdMedia, $mdP if (vm.settings.defaultSortOrder && vm.settings.defaultSortOrder.length) { vm.defaultSortOrder = vm.settings.defaultSortOrder; if (vm.settings.defaultSortOrder.charAt(0) === "-") { - vm.defaultSortOrder = "-'" + vm.settings.defaultSortOrder.substring(1) + "'"; + vm.defaultSortOrder = '-"' + utils.customTranslation(vm.settings.defaultSortOrder.substring(1), vm.settings.defaultSortOrder.substring(1)) + '"'; } else { - vm.defaultSortOrder = "'" + vm.settings.defaultSortOrder + "'"; + vm.defaultSortOrder = '"' + utils.customTranslation(vm.settings.defaultSortOrder, vm.settings.defaultSortOrder) + '"'; } } diff --git a/ui/src/app/widget/lib/entities-table-widget.tpl.html b/ui/src/app/widget/lib/entities-table-widget.tpl.html index ec91de1531..b6ba05531d 100644 --- a/ui/src/app/widget/lib/entities-table-widget.tpl.html +++ b/ui/src/app/widget/lib/entities-table-widget.tpl.html @@ -41,7 +41,7 @@ - + From d5c3a9cc5dab65b88c46a4db6af00a054ddc223f Mon Sep 17 00:00:00 2001 From: Dmitriy Mushat <54553744+Dmitriymush@users.noreply.github.com> Date: Wed, 19 Feb 2020 16:14:18 +0200 Subject: [PATCH 2/2] fixed: focus on fullscreen for react schema grouped forms (#2400) --- .../components/react/json-form-ace-editor.jsx | 6 ++--- .../react/json-form-schema-form.jsx | 25 +++++++++++-------- ui/src/app/components/react/json-form.scss | 3 +++ 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ui/src/app/components/react/json-form-ace-editor.jsx b/ui/src/app/components/react/json-form-ace-editor.jsx index 2329bbddf7..966419b3fe 100644 --- a/ui/src/app/components/react/json-form-ace-editor.jsx +++ b/ui/src/app/components/react/json-form-ace-editor.jsx @@ -83,9 +83,9 @@ class ThingsboardAceEditor extends React.Component { fixAceEditor(editor); } - onToggleFull() { + onToggleFull(groupId) { this.setState({ isFull: !this.state.isFull }); - this.props.onToggleFullscreen(); + this.props.onToggleFullscreen(groupId); this.updateAceEditorSize = true; } @@ -140,7 +140,7 @@ class ThingsboardAceEditor extends React.Component {
- + this.onToggleFull(this.props.groupId)}/>
+ return } - createSchema(theForm) { + createSchema(theForm, groupId) { let merged = utils.merge(this.props.schema, theForm, this.props.ignore, this.props.option); let mapper = this.mapper; if(this.props.mapper) { mapper = _.merge(this.mapper, this.props.mapper); } let forms = merged.map(function(form, index) { - return this.builder(form, this.props.model, index, this.onChange, this.onColorClick, this.onIconClick, this.onToggleFullscreen, mapper); + return this.builder(form, groupId, this.props.model, index, this.onChange, this.onColorClick, this.onIconClick, this.onToggleFullscreen, mapper); }.bind(this)); let formClass = 'SchemaForm'; - if (this.props.isFullscreen) { + if (this.props.isFullscreen && groupId === this.state.groupId) { formClass += ' SchemaFormFullscreen'; } @@ -131,7 +136,7 @@ class ThingsboardSchemaForm extends React.Component { if(this.props.groupInfoes&&this.props.groupInfoes.length>0){ let content=[]; for(let info of this.props.groupInfoes){ - let forms = this.createSchema(this.props.form[info.formIndex]); + let forms = this.createSchema(this.props.form[info.formIndex], info.formIndex); let item = ; content.push(item); } @@ -165,4 +170,4 @@ class ThingsboardSchemaGroup extends React.Component{
{this.props.forms}
); } -} +} diff --git a/ui/src/app/components/react/json-form.scss b/ui/src/app/components/react/json-form.scss index 85825abf42..91c14d51ff 100644 --- a/ui/src/app/components/react/json-form.scss +++ b/ui/src/app/components/react/json-form.scss @@ -24,12 +24,15 @@ $input-label-float-scale: .75 !default; .tb-fullscreen { [name="ReactSchemaForm"] { .SchemaForm { + display: none; + &.SchemaFormFullscreen { position: absolute; top: 0; right: 0; bottom: 0; left: 0; + display: block; > div:not(.fullscreen-form-field) { display: none !important;
{{ column.title }}{{ column.title }}