Skip to content

Commit 20af2c4

Browse files
authored
Merge pull request #116 from onepanelio/feature/onepanelio.core-320.loading.indicator.edit.workflow.template
feat: loading indicator when updating an edited workflow template
2 parents d414dad + 61bbe18 commit 20af2c4

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/app/workflow-template/workflow-template-edit/workflow-template-edit.component.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@
3434
</div>
3535
<div class="mt-5 d-flex justify-content-between">
3636
<button mat-button class="font-medium-gray cancel-button" (click)="cancel()">CANCEL</button>
37-
<div>
38-
<button mat-flat-button color="accent" class="op-rounded op-button border-secondary" (click)="update()">Save</button>
39-
</div>
37+
<app-button [loading]="saving" (click)="update()">
38+
Save
39+
<span class="loading">Saving</span>
40+
</app-button>
4041
</div>
4142
</div>
4243
</div>

src/app/workflow-template/workflow-template-edit/workflow-template-edit.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ export class WorkflowTemplateEditComponent implements OnInit, CanComponentDeacti
5151
*/
5252
manifestChanged = false;
5353

54+
/**
55+
* saving is true if the editor is currently saving the data and false otherwise.
56+
*/
57+
saving = false;
58+
5459
get workflowTemplate(): WorkflowTemplate {
5560
return this._workflowTemplate;
5661
}
@@ -148,6 +153,8 @@ export class WorkflowTemplateEditComponent implements OnInit, CanComponentDeacti
148153

149154
const manifestText = this.manifestDagEditor.manifestTextCurrent;
150155

156+
this.saving = true;
157+
151158
this.workflowTemplateService
152159
.createWorkflowTemplateVersion(
153160
this.namespace,
@@ -159,11 +166,14 @@ export class WorkflowTemplateEditComponent implements OnInit, CanComponentDeacti
159166
})
160167
.subscribe(res => {
161168
this.appRouter.navigateToWorkflowTemplateView(this.namespace, this.workflowTemplate.uid);
169+
this.saving = false;
162170
}, (err: HttpErrorResponse) => {
163171
this.manifestDagEditor.error = {
164172
message: err.error.message,
165173
type: 'danger',
166174
};
175+
176+
this.saving = false;
167177
});
168178
}
169179

0 commit comments

Comments
 (0)