Skip to content

Commit 6f9ff7a

Browse files
139748: added link to existing process page on duplicate process creation
1 parent 2dad719 commit 6f9ff7a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/app/process-page/form/process-form.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,16 @@ export class ProcessFormComponent implements OnInit {
9999
this.sendBack();
100100
} else if (rd.statusCode === 422) {
101101
const title = this.translationService.get('process.new.notification.error.title');
102-
this.notificationsService.error(title, rd.errorMessage);
102+
let content: string;
103+
if (rd.errorMessage.includes(';')) {
104+
const splitErrorMessage = rd.errorMessage.split(';');
105+
content = this.immediatelyStartScript ?
106+
splitErrorMessage[1] + `</br>To start that process now, go to <a href="/processes/${splitErrorMessage[0]}">process ${splitErrorMessage[0]}</a>` :
107+
splitErrorMessage[1];
108+
} else {
109+
content = rd.errorMessage;
110+
}
111+
this.notificationsService.error(title, content,undefined, true);
103112
} else {
104113
const title = this.translationService.get('process.new.notification.error.title');
105114
const content = this.translationService.get('process.new.notification.error.content');

0 commit comments

Comments
 (0)