ciyidogan commited on
Commit
809e803
·
verified ·
1 Parent(s): 148f84e

Update flare-ui/src/app/dialogs/api-edit-dialog/api-edit-dialog.component.html

Browse files
flare-ui/src/app/dialogs/api-edit-dialog/api-edit-dialog.component.html CHANGED
@@ -1,8 +1,17 @@
1
  <h2 mat-dialog-title>
2
- {{ data.mode === 'create' ? 'Create New API' : data.mode === 'duplicate' ? 'Duplicate API' : 'Edit API' }}
 
 
 
 
 
 
 
 
3
  </h2>
4
 
5
  <mat-dialog-content>
 
6
  <form [formGroup]="form">
7
  <mat-tab-group>
8
  <!-- General Tab -->
@@ -430,10 +439,27 @@
430
  </mat-dialog-content>
431
 
432
  <mat-dialog-actions align="end">
433
- <button mat-button (click)="cancel()">Cancel</button>
434
- <button mat-raised-button color="primary"
435
- (click)="save()"
436
- [disabled]="form.invalid || saving">
437
- {{ saving ? 'Saving...' : 'Save' }}
 
438
  </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
439
  </mat-dialog-actions>
 
1
  <h2 mat-dialog-title>
2
+ @if (data.mode === 'create') {
3
+ Create New API
4
+ } @else if (data.mode === 'duplicate') {
5
+ Duplicate API
6
+ } @else if (data.mode === 'test') {
7
+ Test API: {{ data.api.name }}
8
+ } @else {
9
+ Edit API: {{ data.api.name }}
10
+ }
11
  </h2>
12
 
13
  <mat-dialog-content>
14
+ <mat-tab-group [(selectedIndex)]="activeTabIndex">
15
  <form [formGroup]="form">
16
  <mat-tab-group>
17
  <!-- General Tab -->
 
439
  </mat-dialog-content>
440
 
441
  <mat-dialog-actions align="end">
442
+ <button mat-button (click)="cancel()">
443
+ @if (data.mode === 'test') {
444
+ Close
445
+ } @else {
446
+ Cancel
447
+ }
448
  </button>
449
+ @if (data.mode !== 'test') {
450
+ <button mat-raised-button color="primary"
451
+ (click)="save()"
452
+ [disabled]="saving || form.invalid">
453
+ @if (saving) {
454
+ <mat-icon class="spin">sync</mat-icon>
455
+ Saving...
456
+ } @else {
457
+ @if (data.mode === 'create' || data.mode === 'duplicate') {
458
+ Create
459
+ } @else {
460
+ Update
461
+ }
462
+ }
463
+ </button>
464
+ }
465
  </mat-dialog-actions>