Skip to content
Snippets Groups Projects
Verified Commit abb9a25f authored by Damien's avatar Damien
Browse files

[FEAT] #186 Visual notifications for entity

parent 812e9166
No related branches found
No related tags found
No related merge requests found
...@@ -20,25 +20,25 @@ declare var angularGlobals: any; ...@@ -20,25 +20,25 @@ declare var angularGlobals: any;
}) })
export class EntitiesAdministrationComponent extends AutoCompletePlugin implements OnInit { export class EntitiesAdministrationComponent extends AutoCompletePlugin implements OnInit {
private _mobileQueryListener: () => void; private _mobileQueryListener : () => void;
mobileQuery: MediaQueryList; mobileQuery : MediaQueryList;
dialogRef: MatDialogRef<any>; dialogRef : MatDialogRef<any>;
coreUrl: string; coreUrl : string;
lang: any = LANG; lang : any = LANG;
loading: boolean = false; loading : boolean = false;
entities: any[] = []; entities : any[] = [];
listTemplateRoles: any[] = []; listTemplateRoles : any[] = [];
entityTypeList: any[] = []; entityTypeList : any[] = [];
currentEntity: any = {}; currentEntity : any = {};
isDraggable: boolean = true; isDraggable : boolean = true;
creationMode: boolean = false; creationMode : boolean = false;
idCircuitVisa: number; idCircuitVisa : number;
config: any = {}; config : any = {};
dataSource = new MatTableDataSource(this.currentEntity.users); dataSource = new MatTableDataSource(this.currentEntity.users);
displayedColumns = ['firstname', 'lastname']; displayedColumns = ['firstname', 'lastname'];
@ViewChild('snav2') sidenav: MatSidenav; @ViewChild('snav2') sidenav: MatSidenav;
...@@ -257,7 +257,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -257,7 +257,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
this.http.put(this.coreUrl + "rest/listTemplates/" + this.currentEntity.listTemplate.id, newDiffList) this.http.put(this.coreUrl + "rest/listTemplates/" + this.currentEntity.listTemplate.id, newDiffList)
.subscribe((data: any) => { .subscribe((data: any) => {
this.currentEntity.listTemplate.id = data.id; this.currentEntity.listTemplate.id = data.id;
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.diffusionModelUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
...@@ -265,7 +265,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -265,7 +265,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
this.http.post(this.coreUrl + "rest/listTemplates", newDiffList) this.http.post(this.coreUrl + "rest/listTemplates", newDiffList)
.subscribe((data: any) => { .subscribe((data: any) => {
this.currentEntity.listTemplate.id = data.id; this.currentEntity.listTemplate.id = data.id;
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.diffusionModelUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
...@@ -311,7 +311,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -311,7 +311,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
.subscribe((data: any) => { .subscribe((data: any) => {
this.idCircuitVisa = data.id; this.idCircuitVisa = data.id;
this.currentEntity.visaTemplate.push(newElemListModel); this.currentEntity.visaTemplate.push(newElemListModel);
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.diffusionModelUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
...@@ -320,7 +320,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -320,7 +320,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
.subscribe((data: any) => { .subscribe((data: any) => {
this.idCircuitVisa = data.id; this.idCircuitVisa = data.id;
this.currentEntity.visaTemplate.push(newElemListModel); this.currentEntity.visaTemplate.push(newElemListModel);
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.diffusionModelUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
...@@ -501,7 +501,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -501,7 +501,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.diffusionModelUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
...@@ -515,12 +515,13 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -515,12 +515,13 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.diffusionModelUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
} }
} }
updateDiffListVisa(template: any): any { updateDiffListVisa(template: any): any {
var newDiffList = { var newDiffList = {
"object_id": this.currentEntity.entity_id, "object_id": this.currentEntity.entity_id,
...@@ -547,12 +548,13 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -547,12 +548,13 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
this.http.put(this.coreUrl + "rest/listTemplates/" + this.idCircuitVisa, newDiffList) this.http.put(this.coreUrl + "rest/listTemplates/" + this.idCircuitVisa, newDiffList)
.subscribe((data: any) => { .subscribe((data: any) => {
this.idCircuitVisa = data.id; this.idCircuitVisa = data.id;
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.diffusionModelUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
} }
removeDiffList(i: number, role: string): any { removeDiffList(i: number, role: string): any {
this.currentEntity.listTemplate[role].splice(i, 1); this.currentEntity.listTemplate[role].splice(i, 1);
var newDiffList = { var newDiffList = {
...@@ -585,11 +587,12 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -585,11 +587,12 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.diffusionModelUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
} }
removeDiffListVisa(template: any, i: number): any { removeDiffListVisa(template: any, i: number): any {
this.currentEntity.visaTemplate.splice(i, 1); this.currentEntity.visaTemplate.splice(i, 1);
...@@ -620,7 +623,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -620,7 +623,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
this.http.put(this.coreUrl + "rest/listTemplates/" + this.idCircuitVisa, newDiffList) this.http.put(this.coreUrl + "rest/listTemplates/" + this.idCircuitVisa, newDiffList)
.subscribe((data: any) => { .subscribe((data: any) => {
this.idCircuitVisa = data.id; this.idCircuitVisa = data.id;
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.diffusionModelUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
...@@ -628,7 +631,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -628,7 +631,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
this.http.delete(this.coreUrl + "rest/listTemplates/" + this.idCircuitVisa) this.http.delete(this.coreUrl + "rest/listTemplates/" + this.idCircuitVisa)
.subscribe(() => { .subscribe(() => {
this.idCircuitVisa = null; this.idCircuitVisa = null;
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.diffusionModelUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
...@@ -649,7 +652,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -649,7 +652,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
if (this.currentEntity.listTemplate) { if (this.currentEntity.listTemplate) {
this.currentEntity.listTemplate[role.id] = []; this.currentEntity.listTemplate[role.id] = [];
} }
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.listTemplatesRolesUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
...@@ -668,7 +671,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen ...@@ -668,7 +671,7 @@ export class EntitiesAdministrationComponent extends AutoCompletePlugin implemen
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
} }
this.notify.success(this.lang.entityUpdated); this.notify.success(this.lang.listTemplatesRolesUpdated);
}, (err) => { }, (err) => {
this.notify.error(err.error.errors); this.notify.error(err.error.errors);
}); });
......
...@@ -36,39 +36,39 @@ export const LANG_EN = { ...@@ -36,39 +36,39 @@ export const LANG_EN = {
"attachment" : "Attachment", "attachment" : "Attachment",
"attachments" : "Attachments", "attachments" : "Attachments",
"august" : "August", "august" : "August",
"authorize" : "Authorize", "authorize" : "Authorize",
"autoLogoutAbsence" : "You are going to be automaticaly disconnected after your redirections", "autoLogoutAbsence" : "You are going to be automaticaly disconnected after your redirections",
"available" : "available", "available" : "available",
"availableGroups" : "Available groups", "availableGroups" : "Available groups",
"availableStatuses" : "Available statuses", "availableStatuses" : "Available statuses",
"avis" : "Avis circuit", "avis" : "Avis circuit",
"back" : "Back", "back" : "Back",
"basket" : "Basket", "basket" : "Basket",
"basketAdded" : "Basket added", "basketAdded" : "Basket added",
"basketCreation" : "Basket creation", "basketCreation" : "Basket creation",
"basketDeleted" : "Basket deleted", "basketDeleted" : "Basket deleted",
"basketModification" : "Basket modification", "basketModification" : "Basket modification",
"basketNotification" : "Toggle notification for this basket", "basketNotification" : "Toggle notification for this basket",
"baskets" : "Baskets", "baskets" : "Baskets",
"basketsOrder" : "Manage baskets order", "basketsOrder" : "Manage baskets order",
"basketUpdated" : "Basket updated", "basketUpdated" : "Basket updated",
"browsing" : "Browsing", "browsing" : "Browsing",
"calDays" : "calendar days", "calDays" : "calendar days",
"canBeModified" : "Index modification", "canBeModified" : "Index modification",
"canBeSearched" : "Searchable", "canBeSearched" : "Searchable",
"cancel" : "Cancel", "cancel" : "Cancel",
"cases" : "Cases", "cases" : "Cases",
"changeMyPassword" : "Change my password", "changeMyPassword" : "Change my password",
"chooseBasket" : "Choose a basket", "chooseBasket" : "Choose a basket",
"chooseCategoryAssociation" : "Choose one or some associatedd categories", "chooseCategoryAssociation" : "Choose one or some associatedd categories",
"chooseDefaultAction" : "Choose main action", "chooseDefaultAction" : "Choose main action",
"chooseEntity" : "Choose a entity", "chooseEntity" : "Choose a entity",
"chooseGroup" : "Choose a group", "chooseGroup" : "Choose a group",
"chooseRedirectGroup" : "Choose another group", "chooseRedirectGroup" : "Choose another group",
"chronoNumber" : "Chrono number", "chronoNumber" : "Chrono number",
"city" : "City", "city" : "City",
"clause" : "Clause", "clause" : "Clause",
"clickOn" : "Click on", "clickOn" : "Click on",
"color" : "Color", "color" : "Color",
"content_management" : "Ressource revision", "content_management" : "Ressource revision",
"country" : "Country", "country" : "Country",
...@@ -168,6 +168,7 @@ export const LANG_EN = { ...@@ -168,6 +168,7 @@ export const LANG_EN = {
"lastname" : "Lastname", "lastname" : "Lastname",
"life_cycle" : "Life cycle", "life_cycle" : "Life cycle",
"linkGroup" : "Link a group", "linkGroup" : "Link a group",
"listTemplatesRolesUpdated" : "Roles updated",
"logout" : "Logout", "logout" : "Logout",
"maarchApplication" : "Maarch App", "maarchApplication" : "Maarch App",
"manageAbsences" : "Manage absences", "manageAbsences" : "Manage absences",
...@@ -198,7 +199,7 @@ export const LANG_EN = { ...@@ -198,7 +199,7 @@ export const LANG_EN = {
"noReplacement" : "No replacement", "noReplacement" : "No replacement",
"notes" : "Notes", "notes" : "Notes",
"notificationAdded" : "Notification added", "notificationAdded" : "Notification added",
"notificationCreation" : "Notification creation", "notificationCreation" : "Notification creation",
"notificationDeleted" : "Notification deleted", "notificationDeleted" : "Notification deleted",
"NotificationDiffusionType" : "Diffusion type", "NotificationDiffusionType" : "Diffusion type",
"NotificationEnabled" : "Enabled", "NotificationEnabled" : "Enabled",
...@@ -220,41 +221,41 @@ export const LANG_EN = { ...@@ -220,41 +221,41 @@ export const LANG_EN = {
"others" : "Other(s)", "others" : "Other(s)",
"otherActions" : "Other(s) action(s)", "otherActions" : "Other(s) action(s)",
"otherInformations" : "Other(s) information(s)", "otherInformations" : "Other(s) information(s)",
"otherParameters" : "Other(s) parameter(s)", "otherParameters" : "Other(s) parameter(s)",
"outOf" : "of", "outOf" : "of",
"page" : "Page", "page" : "Page",
"parameter" : "Parameter", "parameter" : "Parameter",
"parameterAdded" : "Parameter added", "parameterAdded" : "Parameter added",
"parameterCreation" : "Parameter creation", "parameterCreation" : "Parameter creation",
"parameterDeleted" : "Parameter deleted", "parameterDeleted" : "Parameter deleted",
"parameterModification" : "Parameter modification", "parameterModification" : "Parameter modification",
"parameters" : "Parameters", "parameters" : "Parameters",
"parameterUpdated" : "Parameter updated", "parameterUpdated" : "Parameter updated",
"phoneNumber" : "Phone number", "phoneNumber" : "Phone number",
"primaryEntity" : "Primary entity", "primaryEntity" : "Primary entity",
"priorities" : "Priorities", "priorities" : "Priorities",
"priorityAdded" : "Priority added", "priorityAdded" : "Priority added",
"priorityCreation" : "Priority creation", "priorityCreation" : "Priority creation",
"priorityDeleted" : "Priority deleted", "priorityDeleted" : "Priority deleted",
"priorityModification" : "Priority modification", "priorityModification" : "Priority modification",
"priorityUpdated" : "Priority updated", "priorityUpdated" : "Priority updated",
"privileges" : "Privileges", "privileges" : "Privileges",
"processAction" : "Process action(s)", "processAction" : "Process action(s)",
"processDelay" : "Process delay", "processDelay" : "Process delay",
"processDelayDoctype" : "doctype delay is used", "processDelayDoctype" : "doctype delay is used",
"processType" : "Process type", "processType" : "Process type",
"pswReseted" : "Password reseted", "pswReseted" : "Password reseted",
"record" : "element(s)", "record" : "element(s)",
"records" : "result(s)", "records" : "result(s)",
"recordsPerPage" : "result per page", "recordsPerPage" : "result per page",
"redirectBasket" : "Redirect basket", "redirectBasket" : "Redirect basket",
"redirects" : "Redirections", "redirects" : "Redirections",
"reinitPassword" : "Reset password", "reinitPassword" : "Reset password",
"relatedUsers" : "Related users", "relatedUsers" : "Related users",
"renewPsw" : "Enter the password again", "renewPsw" : "Enter the password again",
"reports" : "Reports", "reports" : "Reports",
"resetPsw" : "Reset password", "resetPsw" : "Reset password",
"resId" : "Res Identifier", "resId" : "Res Identifier",
"resultPage" : "Result page", "resultPage" : "Result page",
"resultPageUpdated" : "Page de résultat modifié", "resultPageUpdated" : "Page de résultat modifié",
"role" : "Role", "role" : "Role",
...@@ -405,6 +406,5 @@ export const LANG_EN = { ...@@ -405,6 +406,5 @@ export const LANG_EN = {
"numericPackageImported" : "Numeric package imported", "numericPackageImported" : "Numeric package imported",
"enterValue" : "You must enter a value", "enterValue" : "You must enter a value",
"patternId" : "Value must contain only alphanumeric, dot, underscore or dash", "patternId" : "Value must contain only alphanumeric, dot, underscore or dash",
"alreadyExist" : "Identifiant already exists", "alreadyExist" : "Identifiant already exists"
}; };
...@@ -22,7 +22,7 @@ export const LANG_FR = { ...@@ -22,7 +22,7 @@ export const LANG_FR = {
"active" : "Actif", "active" : "Actif",
"activeCron" : "Tâche(s) active(s)", "activeCron" : "Tâche(s) active(s)",
"add" : "Ajouter", "add" : "Ajouter",
"additionalRoles" : "Role(s) supplémentaire(s)", "additionalRoles" : "Rôle(s) supplémentaire(s)",
"address" : "Adresse", "address" : "Adresse",
"addStatus" : "Ajouter un statut", "addStatus" : "Ajouter un statut",
"addUser" : "Ajouter un utilisateur", "addUser" : "Ajouter un utilisateur",
...@@ -182,6 +182,7 @@ export const LANG_FR = { ...@@ -182,6 +182,7 @@ export const LANG_FR = {
"lastname" : "Nom", "lastname" : "Nom",
"life_cycle" : "Cycle de vie", "life_cycle" : "Cycle de vie",
"linkGroup" : "Associer un groupe", "linkGroup" : "Associer un groupe",
"listTemplatesRolesUpdated" : "Rôles modifiés",
"logout" : "Se déconnecter", "logout" : "Se déconnecter",
"maarchApplication" : "Application Maarch", "maarchApplication" : "Application Maarch",
"manageAbsences" : "Rediriger mes bannettes", "manageAbsences" : "Rediriger mes bannettes",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment