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