-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathblocks-editor.component.html
123 lines (110 loc) · 5.37 KB
/
blocks-editor.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<mat-accordion cdkDropList (cdkDropListDropped)="drop($event)">
<mat-expansion-panel *ngFor="let block of blocks; let i = index" cdkDrag>
<mat-expansion-panel-header>
<mat-icon class="drag-handle" cdkDragHandle>reorder</mat-icon>
<app-kendraio-icon [icon]="blockIcons[block.type]||''"></app-kendraio-icon>
<span class="block-type-title" >{{ blockTypes[block.type]?.label||block.type}}{{ blockTitles[i] ? ": "+blockTitles[i] :""}}</span>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
<ng-container [ngSwitch]="block.type">
<ng-container *ngSwitchCase="'graphql'">
<app-block-graphql-builder-box [block]="block"
#value
(updateBlock)="onUpdateBlock(i, value)"></app-block-graphql-builder-box>
<mat-action-row>
<button mat-flat-button color="primary" (click)="onUpdateBlock(i, value)">
<mat-icon>save</mat-icon>
<span class="button-label">Update</span>
</button>
<button style="margin-left: 1em" mat-flat-button color="warn" (click)="onDeleteBlock(i)">
<mat-icon>delete</mat-icon>
<span class="button-label">Delete</span>
</button>
</mat-action-row>
</ng-container>
<ng-container *ngSwitchCase="'mapping'">
<app-block-mapping-builder-box [block]="block"
#value
(updateBlock)="onUpdateBlock(i, value)"></app-block-mapping-builder-box>
<mat-action-row>
<button mat-flat-button color="primary" (click)="onUpdateBlock(i, value)">
<mat-icon>save</mat-icon>
<span class="button-label">Update</span>
</button>
<button style="margin-left: 1em" mat-flat-button color="warn" (click)="onDeleteBlock(i)">
<mat-icon>delete</mat-icon>
<span class="button-label">Delete</span>
</button>
</mat-action-row>
</ng-container>
<ng-container *ngSwitchCase="'multi-dev'">
<app-block-multi-builder-box [block]="block"
#value
(updateBlock)="onUpdateBlock(i, value)"></app-block-multi-builder-box>
<mat-action-row>
<button mat-flat-button color="primary" (click)="onUpdateBlock(i, value)">
<mat-icon>save</mat-icon>
<span class="button-label">Update</span>
</button>
<button style="margin-left: 1em" mat-flat-button color="warn" (click)="onDeleteBlock(i)">
<mat-icon>delete</mat-icon>
<span class="button-label">Delete</span>
</button>
</mat-action-row>
</ng-container>
<ng-container *ngSwitchCase="'gosub'">
<app-block-gosub-builder-box [block]="block"
#value
(updateBlock)="onUpdateBlock(i, value)"></app-block-gosub-builder-box>
<mat-action-row>
<button mat-flat-button color="primary" (click)="onUpdateBlock(i, value)">
<mat-icon>save</mat-icon>
<span class="button-label">Update</span>
</button>
<button style="margin-left: 1em" mat-flat-button color="warn" (click)="onDeleteBlock(i)">
<mat-icon>delete</mat-icon>
<span class="button-label">Delete</span>
</button>
</mat-action-row>
</ng-container>
<ng-container *ngSwitchCase="'comparison'">
<app-block-comparison-builder-box [block]="block"
#value
(updateBlock)="onUpdateBlock(i, value)"></app-block-comparison-builder-box>
<mat-action-row>
<button mat-flat-button color="primary" (click)="onUpdateBlock(i, value)">
<mat-icon>save</mat-icon>
<span class="button-label">Update</span>
</button>
<button style="margin-left: 1em" mat-flat-button color="warn" (click)="onDeleteBlock(i)">
<mat-icon>delete</mat-icon>
<span class="button-label">Delete</span>
</button>
</mat-action-row>
</ng-container>
<ng-container *ngSwitchDefault>
<app-block-builder-box [block]="block"
#value
(updateBlock)="onUpdateBlock(i, value)"></app-block-builder-box>
<mat-action-row>
<button mat-flat-button color="primary" (click)="onUpdateBlock(i, value)">
<mat-icon>save</mat-icon>
<span class="button-label">Update</span>
</button>
<button style="margin-left: 1em" mat-flat-button color="warn" (click)="onDeleteBlock(i)">
<mat-icon>delete</mat-icon>
<span class="button-label">Delete</span>
</button>
</mat-action-row>
</ng-container>
</ng-container>
</ng-template>
</mat-expansion-panel>
</mat-accordion>
<br>
<button mat-flat-button (click)="addBlock()" data-cy="blocks-editor-add-task">
<mat-icon>add</mat-icon>
<span class="button-label">Add Task</span>
</button>
<br>
<!-- <pre>{{ blocks | json }}</pre>-->