Skip to content
Snippets Groups Projects
Commit 19fcaaf4 authored by ncamera's avatar ncamera
Browse files

Empezar a actualizar las traducciones

parent a3f83482
No related branches found
No related tags found
1 merge request!1Se actualiza Angular a la versión 13 y se resuelven vulnerabilidades
...@@ -158,6 +158,12 @@ export class ArchivosComponent { ...@@ -158,6 +158,12 @@ export class ArchivosComponent {
*/ */
modalSeeScoreOpened = true; modalSeeScoreOpened = true;
private notificationTypeDictonarty = {
error: (message: string) => this.notifService.error(message),
success: (message: string) => this.notifService.success(message),
warning: (message: string) => this.notifService.warning(message),
};
constructor( constructor(
private router: Router, private router: Router,
private notifService: NotificacionService, private notifService: NotificacionService,
...@@ -209,6 +215,13 @@ export class ArchivosComponent { ...@@ -209,6 +215,13 @@ export class ArchivosComponent {
} }
this.ordenarArchivos(); this.ordenarArchivos();
} }
showNotification(type: "error" | "success" | "warning", traslation: string) {
this.translateService
.get(traslation)
.subscribe(this.notificationTypeDictonarty[type]);
}
ordenarMixto() { ordenarMixto() {
//1. primero las carpetas. //1. primero las carpetas.
this.archivosCompartidosSinDuplicados = this.archivosCompartidosSinDuplicados =
...@@ -296,9 +309,7 @@ export class ArchivosComponent { ...@@ -296,9 +309,7 @@ export class ArchivosComponent {
mostrarEliminarDialogo() { mostrarEliminarDialogo() {
// Chequear si se seleccionó un archivo // Chequear si se seleccionó un archivo
if (!this.archivoSeleccionado) { if (!this.archivoSeleccionado) {
this.notifService.warning( this.showNotification("warning", "i18n.warning.file.noSelected");
this.translateService.get("i18n.warning.file.noSelected").value
);
return; return;
} }
...@@ -658,9 +669,7 @@ export class ArchivosComponent { ...@@ -658,9 +669,7 @@ export class ArchivosComponent {
*/ */
confirmFileMove(event: CustomEvent) { confirmFileMove(event: CustomEvent) {
if (!this.archivoSeleccionado) { if (!this.archivoSeleccionado) {
this.notifService.warning( this.showNotification("warning", "i18n.warning.file.noSelected");
this.translateService.get("i18n.warning.file.noSelected").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