Skip to content
Snippets Groups Projects
Commit 06f44efe authored by Dara Leslie Silvera Martinez's avatar Dara Leslie Silvera Martinez
Browse files

Traducciones aregladas para matefun y grupos

parent cdad2c4e
No related branches found
No related tags found
1 merge request!1Se actualiza Angular a la versión 13 y se resuelven vulnerabilidades
...@@ -84,6 +84,12 @@ export class GruposComponent { ...@@ -84,6 +84,12 @@ export class GruposComponent {
}); });
} }
private notificationTypeDictonarty = {
error: (message: string) => this.notifService.error(message),
success: (message: string) => this.notifService.success(message),
warning: (message: string) => this.notifService.warning(message),
};
ngOnInit() { ngOnInit() {
let cedula = this.authService.getUser().cedula; let cedula = this.authService.getUser().cedula;
this.loading = true; this.loading = true;
...@@ -97,6 +103,12 @@ export class GruposComponent { ...@@ -97,6 +103,12 @@ export class GruposComponent {
); );
} }
showNotification(type: "error" | "success" | "warning", traslation: string) {
this.translateService
.get(traslation)
.subscribe(this.notificationTypeDictonarty[type]);
}
//ordenar archivos del grupo seleccionado. //ordenar archivos del grupo seleccionado.
ordenarAlph(a, b) { ordenarAlph(a, b) {
if (a.nombre.toLowerCase() < b.nombre.toLowerCase()) return -1; if (a.nombre.toLowerCase() < b.nombre.toLowerCase()) return -1;
...@@ -238,20 +250,11 @@ export class GruposComponent { ...@@ -238,20 +250,11 @@ export class GruposComponent {
} }
cargarArchivoCompartido() { cargarArchivoCompartido() {
if (this.archivoSeleccionado) { if (!this.archivoSeleccionado || this.archivoSeleccionado.directorio) {
if (this.archivoSeleccionado.directorio) { this.showNotification("warning", "i18n.warning.file.noSelected");
this.notifService.warning( return;
this.translateService.get("i18n.warning.file.noSelected").value,
false
);
} else {
this.sessionService.setArchivo(this.archivoSeleccionado);
this.router.navigate(["/matefun"]);
}
} else {
this.notifService.warning(
this.translateService.get("i18n.warning.file.noSelected").value
);
} }
this.sessionService.setArchivo(this.archivoSeleccionado);
this.router.navigate(["/matefun"]);
} }
} }
...@@ -385,6 +385,12 @@ export class MateFunComponent { ...@@ -385,6 +385,12 @@ export class MateFunComponent {
} }
} }
private notificationTypeDictonarty = {
error: (message: string) => this.notifService.error(message),
success: (message: string) => this.notifService.success(message),
warning: (message: string) => this.notifService.warning(message),
};
ngOnInit() { ngOnInit() {
window["matefunComponent"] = { component: this }; window["matefunComponent"] = { component: this };
...@@ -504,6 +510,12 @@ export class MateFunComponent { ...@@ -504,6 +510,12 @@ export class MateFunComponent {
} }
} }
showNotification(type: "error" | "success" | "warning", traslation: string) {
this.translateService
.get(traslation)
.subscribe(this.notificationTypeDictonarty[type]);
}
makeAJump() { makeAJump() {
if (this.jump) { if (this.jump) {
this.jump = false; this.jump = false;
...@@ -808,9 +820,7 @@ export class MateFunComponent { ...@@ -808,9 +820,7 @@ export class MateFunComponent {
const padreId = event.detail.padreId; const padreId = event.detail.padreId;
if (nombre == undefined || nombre == "") { if (nombre == undefined || nombre == "") {
this.notifService.error( this.showNotification("error", "i18n.warning.file.invalidName");
this.translateService.get("i18n.warning.file.invalidName").value
);
return; return;
} }
...@@ -818,9 +828,7 @@ export class MateFunComponent { ...@@ -818,9 +828,7 @@ export class MateFunComponent {
var regex = /^[A-Z]/; var regex = /^[A-Z]/;
if (!regex.test(nombre)) { if (!regex.test(nombre)) {
this.notifService.error( this.showNotification("error", "i18n.warning.file.capitalLetter");
this.translateService.get("i18n.warning.file.capitalLetter").value
);
return; return;
} }
......
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