Commit 30b6d65e by Ali Arshad

CR fix for STEPS duplicate code.

parent 536f2265
...@@ -158,49 +158,7 @@ ...@@ -158,49 +158,7 @@
</div> </div>
<div class="ui-g form-group"> <div class="ui-g form-group">
<!-- Start steps section --> <!-- Start steps section -->
<div class="ui-g-12 ui-md-12"> <ng-container *ngTemplateOutlet="stepsTemplate; context:{stage: stage}"></ng-container>
<div class="form-group row">
<div class="col-md-6">
<h3>Steps</h3>
</div>
<div *ngIf="stepTypes && stepTypes.length" class="col-md-offset-2 col-md-4">
<app-select-2 (valChange)="addStep($event, stage)" [data]="stepTypes"
[value]="stepTypes[0]"
fieldLabel="Description">
</app-select-2>
</div>
</div>
<div *ngIf="stage.Steps.length===0">
No steps added...
</div>
<div (dndDrop)="onDrop($event, stage.Steps, stage.ObjectID)"
[class.disable-drop]="draggingId!=null && draggingId !== stage.ObjectID"
dndDropzone>
<div [hidden]="draggingId !== stage.ObjectID" dndPlaceholderRef
style="background: #CCCCCC; border: 1px dashed #000; width: 50%; height: 53px"></div>
<div *ngFor="let step of stage.Steps" class="ui-g">
<div (dndEnd)="onDragEnd($event)"
(dndStart)="onDragStart(step, stage.Steps, stage.ObjectID)"
[dndDraggable]="step"
class="ui-g-6"
dndEffectAllowed="copy">
<div class="ui-g">
<div class="col-md-8 interactive">
<h4>{{step.StepType.Description}}</h4>
</div>
<div class="col-md-4">
<button (click)="removeStep(step, stage)"
[disabled]="showLoader" icon="ui-icon-close"
pButton
type="button"></button>
</div>
</div>
</div>
</div>
</div>
<hr/>
</div>
<!-- End steps section --> <!-- End steps section -->
<!-- Start messaging section --> <!-- Start messaging section -->
<div class="ui-g-12 ui-md-12"> <div class="ui-g-12 ui-md-12">
...@@ -463,48 +421,7 @@ ...@@ -463,48 +421,7 @@
</p-header> </p-header>
<div class="ui-g form-group" *ngIf="!panel.collapsed"> <div class="ui-g form-group" *ngIf="!panel.collapsed">
<!-- Start steps section --> <!-- Start steps section -->
<div class="ui-g-12 ui-md-12"> <ng-container *ngTemplateOutlet="stepsTemplate; context:{stage: stage}"></ng-container>
<div class="form-group row">
<div class="col-md-6">
<h3>Steps</h3>
</div>
<div *ngIf="stepTypes && stepTypes.length" class="col-md-offset-8 col-md-4">
<app-select-2 (valChange)="addStep($event, stage)" [data]="stepTypes"
[value]="stepTypes[0]"
fieldLabel="Description">
</app-select-2>
</div>
</div>
<div *ngIf="stage.Steps.length===0">
No steps added...
</div>
<div (dndDrop)="onDrop($event, stage.Steps, stage.ObjectID)"
[class.disable-drop]="draggingId!=null && draggingId !== stage.ObjectID"
dndDropzone>
<div [hidden]="draggingId !== stage.ObjectID" dndPlaceholderRef
style="background: #CCCCCC; border: 1px dashed #000; width: 50%; height: 53px"></div>
<div *ngFor="let step of stage.Steps" class="ui-g">
<div (dndEnd)="onDragEnd($event)"
(dndStart)="onDragStart(step, stage.Steps, stage.ObjectID)"
[dndDraggable]="step"
class="ui-g-6"
dndEffectAllowed="copy">
<div class="ui-g">
<div class="col-md-8 interactive">
<h4>{{step.StepType.Description}}</h4>
</div>
<div class="col-md-4">
<button (click)="removeStep(step, stage)"
[disabled]="showLoader" icon="ui-icon-close"
pButton
type="button"></button>
</div>
</div>
</div>
</div>
</div>
<hr/>
</div>
<!-- End steps section --> <!-- End steps section -->
<!-- Start messaging section --> <!-- Start messaging section -->
<div class="ui-g-12 ui-md-12"> <div class="ui-g-12 ui-md-12">
...@@ -969,3 +886,50 @@ ...@@ -969,3 +886,50 @@
<p-confirmDialog header="Confirmation" key="RemoveRow" autoZIndex="false" baseZIndex="12000" <p-confirmDialog header="Confirmation" key="RemoveRow" autoZIndex="false" baseZIndex="12000"
icon="pi pi-exclamation-triangle" appendTo="body"> icon="pi pi-exclamation-triangle" appendTo="body">
</p-confirmDialog> </p-confirmDialog>
<ng-template #stepsTemplate let-stage="stage">
<div class="ui-g-12 ui-md-12">
<div class="form-group row">
<div class="col-md-6">
<h3>Steps</h3>
</div>
<div *ngIf="stepTypes && stepTypes.length" class="col-md-offset-2 col-md-4">
<app-select-2 (valChange)="addStep($event, stage)" [data]="stepTypes"
[value]="stepTypes[0]"
fieldLabel="Description">
</app-select-2>
</div>
</div>
<div *ngIf="stage.Steps.length===0">
No steps added...
</div>
<div (dndDrop)="onDrop($event, stage.Steps, stage.ObjectID)"
[class.disable-drop]="draggingId!=null && draggingId !== stage.ObjectID"
dndDropzone>
<div [hidden]="draggingId !== stage.ObjectID" dndPlaceholderRef
style="background: #CCCCCC; border: 1px dashed #000; width: 50%; height: 53px"></div>
<div *ngFor="let step of stage.Steps" class="ui-g">
<div (dndEnd)="onDragEnd($event)"
(dndStart)="onDragStart(step, stage.Steps, stage.ObjectID)"
[dndDraggable]="step"
class="ui-g-6"
dndEffectAllowed="copy">
<div class="ui-g">
<div class="col-md-8 interactive">
<h4>{{step.StepType.Description}}</h4>
</div>
<div class="col-md-4">
<button (click)="removeStep(step, stage)"
[disabled]="showLoader" icon="ui-icon-close"
pButton
type="button"></button>
</div>
</div>
</div>
</div>
</div>
<hr/>
</div>
</ng-template>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment