mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
notify library ID conflict (#509)
This commit is contained in:
@@ -112,7 +112,7 @@ export class LibraryDialogComponent implements OnInit {
|
||||
this.success.emit(folder);
|
||||
dialog.close(folder);
|
||||
},
|
||||
(error) => this.error.emit('LIBRARY.ERRORS.GENERIC')
|
||||
(error) => this.handleError(error)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -137,4 +137,14 @@ export class LibraryDialogComponent implements OnInit {
|
||||
.replace(/[\s]/g, '-')
|
||||
.replace(/[^A-Za-z0-9-]/g, '');
|
||||
}
|
||||
|
||||
private handleError(error: any): any {
|
||||
const { error: { statusCode } } = JSON.parse(error.message);
|
||||
|
||||
if (statusCode === 409) {
|
||||
this.form.controls['id'].setErrors({ message: 'LIBRARY.ERRORS.CONFLICT' });
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
@@ -287,7 +287,8 @@
|
||||
},
|
||||
"ERRORS": {
|
||||
"GENERIC": "There was an error",
|
||||
"EXISTENT_SITE": "ID already used (it might be in the trashcan).",
|
||||
"EXISTENT_SITE": "This Site ID isn't available. Try a different one",
|
||||
"CONFLICT": "ID already used (it might be in the trashcan).",
|
||||
"ID_TOO_LONG": "Use 72 characters or less for the URL name",
|
||||
"DESCRIPTION_TOO_LONG": "Use 512 characters or less for description",
|
||||
"TITLE_TOO_LONG": "Use 256 characters or less for title",
|
||||
|
Reference in New Issue
Block a user