Merge pull request #8458 from ChantsovaEkaterina/bug/custom-action-sample-code-issues
Add/edit entity custom action code samples corrected
This commit is contained in:
commit
88c9d19f24
@ -9,7 +9,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.edit-entity-form .boolean-value-input .checkbox-label {
|
.edit-entity-form .boolean-value-input .checkbox-label {
|
||||||
margin-bottom: 8px;
|
|
||||||
color: rgba(0,0,0,0.54);
|
color: rgba(0,0,0,0.54);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
@ -61,7 +60,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.add-entity-form .boolean-value-input .checkbox-label {
|
.add-entity-form .boolean-value-input .checkbox-label {
|
||||||
margin-bottom: 8px;
|
|
||||||
color: rgba(0,0,0,0.54);
|
color: rgba(0,0,0,0.54);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,7 +111,7 @@
|
|||||||
<!-- <button mat-icon-button color="primary"-->
|
<!-- <button mat-icon-button color="primary"-->
|
||||||
<!-- aria-label="Remove"-->
|
<!-- aria-label="Remove"-->
|
||||||
<!-- type="button"-->
|
<!-- type="button"-->
|
||||||
<!-- (click)="removeOldRelation(i)"-->
|
<!-- (click)="removeOldRelation(i, relation.value)"-->
|
||||||
<!-- matTooltip="Remove relation"-->
|
<!-- matTooltip="Remove relation"-->
|
||||||
<!-- matTooltipPosition="above">-->
|
<!-- matTooltipPosition="above">-->
|
||||||
<!-- <mat-icon>close</mat-icon>-->
|
<!-- <mat-icon>close</mat-icon>-->
|
||||||
|
|||||||
@ -136,9 +136,9 @@
|
|||||||
// vm.relations().markAsDirty();
|
// vm.relations().markAsDirty();
|
||||||
// };
|
// };
|
||||||
//
|
//
|
||||||
// vm.removeOldRelation = function(index) {
|
// vm.removeOldRelation = function(index, relation) {
|
||||||
// vm.oldRelations().removeAt(index);
|
// vm.oldRelations().removeAt(index);
|
||||||
// vm.relationsToDelete.push(vm.oldRelationsData[index]);
|
// vm.relationsToDelete.push(relation);
|
||||||
// vm.oldRelations().markAsDirty();
|
// vm.oldRelations().markAsDirty();
|
||||||
// };
|
// };
|
||||||
//
|
//
|
||||||
|
|||||||
@ -82,7 +82,7 @@
|
|||||||
<div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>
|
<div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>
|
||||||
<label class="checkbox-label">Boolean Value</label>
|
<label class="checkbox-label">Boolean Value</label>
|
||||||
<mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">
|
<mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">
|
||||||
|
{{ (addEntityFormGroup.get('attributes.booleanValue').value ? "value.true" : "value.false") | translate }}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -98,7 +98,7 @@
|
|||||||
<mat-label>Direction</mat-label>
|
<mat-label>Direction</mat-label>
|
||||||
<mat-select formControlName="direction" name="direction">
|
<mat-select formControlName="direction" name="direction">
|
||||||
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
||||||
|
{{ ("relation.search-direction." + direction.value) | translate}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<form #editEntityForm="ngForm" [formGroup]="editEntityFormGroup"
|
<form #editEntityForm="ngForm" [formGroup]="editEntityFormGroup"
|
||||||
(ngSubmit)="save()" class="edit-entity-form">
|
(ngSubmit)="save()" class="edit-entity-form">
|
||||||
<mat-toolbar fxLayout="row" color="primary">
|
<mat-toolbar fxLayout="row" color="primary">
|
||||||
<h2>Edit </h2>
|
<h2>Edit {{entityType.toLowerCase()}} {{entityName}}</h2>
|
||||||
<span fxFlex></span>
|
<span fxFlex></span>
|
||||||
<button mat-icon-button (click)="cancel()" type="button">
|
<button mat-icon-button (click)="cancel()" type="button">
|
||||||
<mat-icon class="material-icons">close</mat-icon>
|
<mat-icon class="material-icons">close</mat-icon>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
<div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>
|
<div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>
|
||||||
<label class="checkbox-label">Boolean Value</label>
|
<label class="checkbox-label">Boolean Value</label>
|
||||||
<mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">
|
<mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">
|
||||||
|
{{ (editEntityFormGroup.get('attributes.booleanValue').value ? "value.true" : "value.false") | translate }}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -84,7 +84,7 @@
|
|||||||
<mat-label>Direction</mat-label>
|
<mat-label>Direction</mat-label>
|
||||||
<mat-select formControlName="direction" name="direction">
|
<mat-select formControlName="direction" name="direction">
|
||||||
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
||||||
|
{{ ("relation.search-direction." + direction.value) | translate}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
||||||
@ -109,7 +109,7 @@
|
|||||||
<button mat-icon-button color="primary"
|
<button mat-icon-button color="primary"
|
||||||
aria-label="Remove"
|
aria-label="Remove"
|
||||||
type="button"
|
type="button"
|
||||||
(click)="removeOldRelation(i)"
|
(click)="removeOldRelation(i, relation.value)"
|
||||||
matTooltip="Remove relation"
|
matTooltip="Remove relation"
|
||||||
matTooltipPosition="above">
|
matTooltipPosition="above">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>close</mat-icon>
|
||||||
@ -130,7 +130,7 @@
|
|||||||
<mat-label>Direction</mat-label>
|
<mat-label>Direction</mat-label>
|
||||||
<mat-select formControlName="direction" name="direction">
|
<mat-select formControlName="direction" name="direction">
|
||||||
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
||||||
|
{{ ("relation.search-direction." + direction.value) | translate}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
||||||
|
|||||||
@ -82,9 +82,9 @@ function EditEntityDialogController(instance) {
|
|||||||
vm.relations().markAsDirty();
|
vm.relations().markAsDirty();
|
||||||
};
|
};
|
||||||
|
|
||||||
vm.removeOldRelation = function(index) {
|
vm.removeOldRelation = function(index, relation) {
|
||||||
vm.oldRelations().removeAt(index);
|
vm.oldRelations().removeAt(index);
|
||||||
vm.relationsToDelete.push(vm.oldRelationsData[index]);
|
vm.relationsToDelete.push(relation);
|
||||||
vm.oldRelations().markAsDirty();
|
vm.oldRelations().markAsDirty();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -82,7 +82,7 @@
|
|||||||
<div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>
|
<div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>
|
||||||
<label class="checkbox-label">Boolean Value</label>
|
<label class="checkbox-label">Boolean Value</label>
|
||||||
<mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">
|
<mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">
|
||||||
|
{{ (addEntityFormGroup.get('attributes.booleanValue').value ? "value.true" : "value.false") | translate }}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -98,7 +98,7 @@
|
|||||||
<mat-label>Direction</mat-label>
|
<mat-label>Direction</mat-label>
|
||||||
<mat-select formControlName="direction" name="direction">
|
<mat-select formControlName="direction" name="direction">
|
||||||
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
||||||
|
{{ ("relation.search-direction." + direction.value) | translate}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<form #editEntityForm="ngForm" [formGroup]="editEntityFormGroup"
|
<form #editEntityForm="ngForm" [formGroup]="editEntityFormGroup"
|
||||||
(ngSubmit)="save()" class="edit-entity-form">
|
(ngSubmit)="save()" class="edit-entity-form">
|
||||||
<mat-toolbar fxLayout="row" color="primary">
|
<mat-toolbar fxLayout="row" color="primary">
|
||||||
<h2>Edit </h2>
|
<h2>Edit {{entityType.toLowerCase()}} {{entityName}}</h2>
|
||||||
<span fxFlex></span>
|
<span fxFlex></span>
|
||||||
<button mat-icon-button (click)="cancel()" type="button">
|
<button mat-icon-button (click)="cancel()" type="button">
|
||||||
<mat-icon class="material-icons">close</mat-icon>
|
<mat-icon class="material-icons">close</mat-icon>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
<div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>
|
<div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>
|
||||||
<label class="checkbox-label">Boolean Value</label>
|
<label class="checkbox-label">Boolean Value</label>
|
||||||
<mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">
|
<mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">
|
||||||
|
{{ (editEntityFormGroup.get('attributes.booleanValue').value ? "value.true" : "value.false") | translate }}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -84,7 +84,7 @@
|
|||||||
<mat-label>Direction</mat-label>
|
<mat-label>Direction</mat-label>
|
||||||
<mat-select formControlName="direction" name="direction">
|
<mat-select formControlName="direction" name="direction">
|
||||||
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
||||||
|
{{ ("relation.search-direction." + direction.value) | translate}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
||||||
@ -109,7 +109,7 @@
|
|||||||
<button mat-icon-button color="primary"
|
<button mat-icon-button color="primary"
|
||||||
aria-label="Remove"
|
aria-label="Remove"
|
||||||
type="button"
|
type="button"
|
||||||
(click)="removeOldRelation(i)"
|
(click)="removeOldRelation(i, relation.value)"
|
||||||
matTooltip="Remove relation"
|
matTooltip="Remove relation"
|
||||||
matTooltipPosition="above">
|
matTooltipPosition="above">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>close</mat-icon>
|
||||||
@ -130,7 +130,7 @@
|
|||||||
<mat-label>Direction</mat-label>
|
<mat-label>Direction</mat-label>
|
||||||
<mat-select formControlName="direction" name="direction">
|
<mat-select formControlName="direction" name="direction">
|
||||||
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">
|
||||||
|
{{ ("relation.search-direction." + direction.value) | translate}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
<mat-error *ngIf="relation.get('direction').hasError('required')">
|
||||||
|
|||||||
@ -82,9 +82,9 @@ function EditEntityDialogController(instance) {
|
|||||||
vm.relations().markAsDirty();
|
vm.relations().markAsDirty();
|
||||||
};
|
};
|
||||||
|
|
||||||
vm.removeOldRelation = function(index) {
|
vm.removeOldRelation = function(index, relation) {
|
||||||
vm.oldRelations().removeAt(index);
|
vm.oldRelations().removeAt(index);
|
||||||
vm.relationsToDelete.push(vm.oldRelationsData[index]);
|
vm.relationsToDelete.push(relation);
|
||||||
vm.oldRelations().markAsDirty();
|
vm.oldRelations().markAsDirty();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user