Browse Source

Change widget json config

pull/3561/head
Chantsova Ekaterina 6 years ago
parent
commit
aa87ab024e
  1. 4
      application/src/main/data/json/system/widget_bundles/input_widgets.json
  2. 4
      ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.html
  3. 23
      ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.ts

4
application/src/main/data/json/system/widget_bundles/input_widgets.json

File diff suppressed because one or more lines are too long

4
ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.html

@ -116,12 +116,12 @@
<button mat-button color="primary" type="button" <button mat-button color="primary" type="button"
(click)="discardAll()" style="max-height: 50px; margin-right:20px;" (click)="discardAll()" style="max-height: 50px; margin-right:20px;"
[disabled]="!multipleInputFormGroup.dirty"> [disabled]="!multipleInputFormGroup.dirty">
{{ settings.resetButtonLabel }} {{ resetButtonLabel }}
</button> </button>
<button mat-button mat-raised-button color="primary" type="submit" <button mat-button mat-raised-button color="primary" type="submit"
style="max-height: 50px; margin-right:20px;" style="max-height: 50px; margin-right:20px;"
[disabled]="!multipleInputFormGroup.dirty || multipleInputFormGroup.invalid"> [disabled]="!multipleInputFormGroup.dirty || multipleInputFormGroup.invalid">
{{ settings.saveButtonLabel }} {{ saveButtonLabel }}
</button> </button>
</div> </div>
</div> </div>

23
ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.ts

@ -111,7 +111,8 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni
isVerticalAlignment: boolean; isVerticalAlignment: boolean;
inputWidthSettings: string; inputWidthSettings: string;
changeAlignment: boolean; changeAlignment: boolean;
smallWidthContainer: boolean; saveButtonLabel: string;
resetButtonLabel: string;
entityDetected = false; entityDetected = false;
isAllParametersValid = true; isAllParametersValid = true;
@ -165,14 +166,14 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni
this.settings.groupTitle = this.settings.groupTitle || '${entityName}'; this.settings.groupTitle = this.settings.groupTitle || '${entityName}';
if (this.settings.saveButtonLabel && this.settings.saveButtonLabel.length) { if (this.settings.saveButtonLabel && this.settings.saveButtonLabel.length) {
this.settings.saveButtonLabel = this.utils.customTranslation(this.settings.saveButtonLabel, this.settings.saveButtonLabel); this.saveButtonLabel = this.utils.customTranslation(this.settings.saveButtonLabel, this.settings.saveButtonLabel);
} else { } else {
this.settings.saveButtonLabel = this.translate.instant('action.save'); this.saveButtonLabel = this.translate.instant('action.save');
} }
if (this.settings.resetButtonLabel && this.settings.resetButtonLabel.length) { if (this.settings.resetButtonLabel && this.settings.resetButtonLabel.length) {
this.settings.resetButtonLabel = this.utils.customTranslation(this.settings.resetButtonLabel, this.settings.resetButtonLabel); this.resetButtonLabel = this.utils.customTranslation(this.settings.resetButtonLabel, this.settings.resetButtonLabel);
} else { } else {
this.settings.resetButtonLabel = this.translate.instant('action.undo'); this.resetButtonLabel = this.translate.instant('action.undo');
} }
// For backward compatibility // For backward compatibility
@ -346,17 +347,13 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni
} }
public onDataUpdated() { public onDataUpdated() {
// this.ngZone.run(() => { this.updateWidgetData(this.subscription.data);
this.updateWidgetData(this.subscription.data); this.ctx.detectChanges();
this.ctx.detectChanges();
// });
} }
private resize() { private resize() {
// this.ngZone.run(() => { this.updateWidgetDisplaying();
this.updateWidgetDisplaying(); this.ctx.detectChanges();
this.ctx.detectChanges();
// });
} }
public getGroupTitle(datasource: Datasource): string { public getGroupTitle(datasource: Datasource): string {

Loading…
Cancel
Save