mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-08 13:57:42 +00:00
fix(console): add flow toasts (#4247)
fix: add flow toasts Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
parent
3c67c9756d
commit
e39d82c031
@ -70,6 +70,7 @@ export class ActionsComponent {
|
|||||||
this.mgmtService
|
this.mgmtService
|
||||||
.clearFlow(this.flowType)
|
.clearFlow(this.flowType)
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
|
this.toast.showInfo('FLOWS.FLOWCLEARED', true);
|
||||||
this.loadFlow();
|
this.loadFlow();
|
||||||
})
|
})
|
||||||
.catch((error: any) => {
|
.catch((error: any) => {
|
||||||
@ -94,6 +95,7 @@ export class ActionsComponent {
|
|||||||
this.mgmtService
|
this.mgmtService
|
||||||
.setTriggerActions(req.getActionIdsList(), req.getFlowType(), req.getTriggerType())
|
.setTriggerActions(req.getActionIdsList(), req.getFlowType(), req.getTriggerType())
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
|
this.toast.showInfo('FLOWS.FLOWCHANGED', true);
|
||||||
this.loadFlow();
|
this.loadFlow();
|
||||||
})
|
})
|
||||||
.catch((error: any) => {
|
.catch((error: any) => {
|
||||||
|
@ -6,73 +6,57 @@ import { SetTriggerActionsRequest } from 'src/app/proto/generated/zitadel/manage
|
|||||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'cnsl-add-flow-dialog',
|
selector: 'cnsl-add-flow-dialog',
|
||||||
templateUrl: './add-flow-dialog.component.html',
|
templateUrl: './add-flow-dialog.component.html',
|
||||||
styleUrls: ['./add-flow-dialog.component.scss'],
|
styleUrls: ['./add-flow-dialog.component.scss'],
|
||||||
})
|
})
|
||||||
export class AddFlowDialogComponent {
|
export class AddFlowDialogComponent {
|
||||||
public actions: Action.AsObject[] = [];
|
public actions: Action.AsObject[] = [];
|
||||||
public typesForSelection: FlowType[] = [
|
public typesForSelection: FlowType[] = [FlowType.FLOW_TYPE_EXTERNAL_AUTHENTICATION];
|
||||||
FlowType.FLOW_TYPE_EXTERNAL_AUTHENTICATION,
|
public triggerTypesForSelection: TriggerType[] = [
|
||||||
];
|
TriggerType.TRIGGER_TYPE_POST_AUTHENTICATION,
|
||||||
public triggerTypesForSelection: TriggerType[] = [
|
TriggerType.TRIGGER_TYPE_POST_CREATION,
|
||||||
TriggerType.TRIGGER_TYPE_POST_AUTHENTICATION,
|
TriggerType.TRIGGER_TYPE_PRE_CREATION,
|
||||||
TriggerType.TRIGGER_TYPE_POST_CREATION,
|
];
|
||||||
TriggerType.TRIGGER_TYPE_PRE_CREATION,
|
|
||||||
];
|
|
||||||
|
|
||||||
public form!: UntypedFormGroup;
|
public form!: UntypedFormGroup;
|
||||||
constructor(
|
constructor(
|
||||||
private toast: ToastService,
|
private toast: ToastService,
|
||||||
private mgmtService: ManagementService,
|
private mgmtService: ManagementService,
|
||||||
private fb: UntypedFormBuilder,
|
private fb: UntypedFormBuilder,
|
||||||
public dialogRef: MatDialogRef<AddFlowDialogComponent>,
|
public dialogRef: MatDialogRef<AddFlowDialogComponent>,
|
||||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||||
) {
|
) {
|
||||||
this.form = this.fb.group({
|
this.form = this.fb.group({
|
||||||
flowType: [data.flowType ? data.flowType : '', [Validators.required]],
|
flowType: [data.flowType ? data.flowType : '', [Validators.required]],
|
||||||
triggerType: [data.triggerType ? data.triggerType : '', [Validators.required]],
|
triggerType: [data.triggerType ? data.triggerType : '', [Validators.required]],
|
||||||
actionIdsList: [data.actions ? (data.actions as Action.AsObject[]).map(a => a.id) : [], [Validators.required]],
|
actionIdsList: [data.actions ? (data.actions as Action.AsObject[]).map((a) => a.id) : [], [Validators.required]],
|
||||||
});
|
});
|
||||||
this.getActionIds();
|
this.getActionIds();
|
||||||
}
|
}
|
||||||
|
|
||||||
private getActionIds(): Promise<void> {
|
private getActionIds(): Promise<void> {
|
||||||
return this.mgmtService.listActions().then(resp => {
|
return this.mgmtService
|
||||||
|
.listActions()
|
||||||
|
.then((resp) => {
|
||||||
this.actions = resp.resultList;
|
this.actions = resp.resultList;
|
||||||
}).catch((error: any) => {
|
})
|
||||||
|
.catch((error: any) => {
|
||||||
this.toast.showError(error);
|
this.toast.showError(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public closeDialog(): void {
|
public closeDialog(): void {
|
||||||
this.dialogRef.close(false);
|
this.dialogRef.close(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public closeDialogWithSuccess(): void {
|
public closeDialogWithSuccess(): void {
|
||||||
// if (this.id) {
|
const req = new SetTriggerActionsRequest();
|
||||||
// const req = new UpdateActionRequest();
|
req.setActionIdsList(this.form.get('actionIdsList')?.value);
|
||||||
// req.setId(this.id);
|
req.setFlowType(this.form.get('flowType')?.value);
|
||||||
// req.setName(this.name);
|
req.setTriggerType(this.form.get('triggerType')?.value);
|
||||||
// req.setScript(this.script);
|
|
||||||
|
|
||||||
// const duration = new Duration();
|
this.dialogRef.close(req);
|
||||||
// duration.setNanos(0);
|
}
|
||||||
// duration.setSeconds(this.durationInSec);
|
|
||||||
|
|
||||||
// req.setAllowedToFail(this.allowedToFail);
|
|
||||||
|
|
||||||
// req.setTimeout(duration)
|
|
||||||
// this.dialogRef.close(req);
|
|
||||||
// } else {
|
|
||||||
const req = new SetTriggerActionsRequest();
|
|
||||||
req.setActionIdsList(this.form.get('actionIdsList')?.value);
|
|
||||||
req.setFlowType(this.form.get('flowType')?.value);
|
|
||||||
req.setTriggerType(this.form.get('triggerType')?.value);
|
|
||||||
|
|
||||||
this.dialogRef.close(req);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -664,6 +664,8 @@
|
|||||||
"3": "Post Creation"
|
"3": "Post Creation"
|
||||||
},
|
},
|
||||||
"ADDTRIGGER": "Trigger hinzufügen",
|
"ADDTRIGGER": "Trigger hinzufügen",
|
||||||
|
"FLOWCHANGED": "Der Ablauf wurde geändert",
|
||||||
|
"FLOWCLEARED": "Der Ablauf wurde zurückgesetzt",
|
||||||
"TIMEOUT": "Timeout",
|
"TIMEOUT": "Timeout",
|
||||||
"TIMEOUTINSEC": "Timeout in Sekunden",
|
"TIMEOUTINSEC": "Timeout in Sekunden",
|
||||||
"ALLOWEDTOFAIL": "Allowed To Fail",
|
"ALLOWEDTOFAIL": "Allowed To Fail",
|
||||||
|
@ -664,6 +664,8 @@
|
|||||||
"3": "Post Creation"
|
"3": "Post Creation"
|
||||||
},
|
},
|
||||||
"ADDTRIGGER": "Add trigger",
|
"ADDTRIGGER": "Add trigger",
|
||||||
|
"FLOWCHANGED": "The flow was changed successfully",
|
||||||
|
"FLOWCLEARED": "The flow was reset successfully",
|
||||||
"TIMEOUT": "Timeout",
|
"TIMEOUT": "Timeout",
|
||||||
"TIMEOUTINSEC": "Timeout in seconds",
|
"TIMEOUTINSEC": "Timeout in seconds",
|
||||||
"ALLOWEDTOFAIL": "Allowed To Fail",
|
"ALLOWEDTOFAIL": "Allowed To Fail",
|
||||||
|
@ -664,6 +664,8 @@
|
|||||||
"3": "Post création"
|
"3": "Post création"
|
||||||
},
|
},
|
||||||
"ADDTRIGGER": "Ajouter un déclencheur",
|
"ADDTRIGGER": "Ajouter un déclencheur",
|
||||||
|
"FLOWCHANGED": "Le processus a été modifié",
|
||||||
|
"FLOWCLEARED": "Le processus a été supprimé avec succès",
|
||||||
"TIMEOUT": "Délai d'attente",
|
"TIMEOUT": "Délai d'attente",
|
||||||
"TIMEOUTINSEC": "Délai en secondes",
|
"TIMEOUTINSEC": "Délai en secondes",
|
||||||
"ALLOWEDTOFAIL": "Autorisé à échouer",
|
"ALLOWEDTOFAIL": "Autorisé à échouer",
|
||||||
|
@ -664,6 +664,8 @@
|
|||||||
"3": "Post creazione"
|
"3": "Post creazione"
|
||||||
},
|
},
|
||||||
"ADDTRIGGER": "Aggiungi trigger",
|
"ADDTRIGGER": "Aggiungi trigger",
|
||||||
|
"FLOWCHANGED": "Il processo è stato modificato con successo.",
|
||||||
|
"FLOWCLEARED": "Il processo è stato eliminato con successo.",
|
||||||
"TIMEOUT": "Timeout",
|
"TIMEOUT": "Timeout",
|
||||||
"TIMEOUTINSEC": "Timeout in secondi",
|
"TIMEOUTINSEC": "Timeout in secondi",
|
||||||
"ALLOWEDTOFAIL": "Può fallire",
|
"ALLOWEDTOFAIL": "Può fallire",
|
||||||
@ -685,8 +687,8 @@
|
|||||||
"DELETE_SUCCESS": "Azione rimossa con successo."
|
"DELETE_SUCCESS": "Azione rimossa con successo."
|
||||||
},
|
},
|
||||||
"CLEAR": {
|
"CLEAR": {
|
||||||
"TITLE": "Flow zurücksetzen?",
|
"TITLE": "Elimina processo",
|
||||||
"DESCRIPTION": "Stai per cancellare un'azione. Questa azione non può essere annullata. Vuoi continuare?"
|
"DESCRIPTION": "Stai per eliminare un processo. Questa azione non può essere annullata. Vuoi continuare?"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"TOAST": {
|
"TOAST": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user