diff --git a/src/common/localization/en-us.ts b/src/common/localization/en-us.ts index c1cafbe6b..4dd320b9b 100644 --- a/src/common/localization/en-us.ts +++ b/src/common/localization/en-us.ts @@ -145,7 +145,7 @@ export const english: IAppStrings = { composing: "Model is composing, please wait...", column: { icon: { - name:"Composed Icon", + name: "Composed Icon", }, id: { headerName: "Model Id", @@ -480,7 +480,7 @@ export const english: IAppStrings = { keys: { lessThan: "<", greaterThan: ">", - }, + }, description: { prevPage: "Go to previous page", nextPage: "Go to next page", @@ -491,7 +491,7 @@ export const english: IAppStrings = { minus: "-", plus: "=", slash: "/", - }, + }, description: { in: "Zoom in", out: "Zoom out", @@ -502,11 +502,11 @@ export const english: IAppStrings = { keys: { delete: "Delete", backSpace: "Backspace", - }, + }, description: { delete: "Remove selection and delete labels of selected words", backSpace: "Remove selection and delete labels of selected words", - }, + }, }, drawnRegions: { keys: { @@ -575,6 +575,10 @@ export const english: IAppStrings = { message: `An error occured while deleting the project. Validate the project file and security token exist and try again`, }, + projectDeleteErrorSecurityTokenNotFound: { + title: "Security token not found when delete project", + message: "Security Token Not Found. Project [${project.name}] has been removed from FoTT tool." + }, projectNotFound: { title: "Error loading project", message: "We couldn't find the project file ${file} at the target blob container ${container}.\ @@ -672,6 +676,10 @@ export const english: IAppStrings = { title: "Model not found", message: "Model \"${modelID}\" not found. Please use another model.", }, + connectionNotExistError: { + title: "Connection doesn't exist", + message: "Connection doesn't exist." + }, getOcrError: { title: "Cannot load OCR file", message: "Failed to load from OCR file. Please check your connection or network settings.", diff --git a/src/common/localization/es-cl.ts b/src/common/localization/es-cl.ts index 1fa82c39f..0ac1f7351 100644 --- a/src/common/localization/es-cl.ts +++ b/src/common/localization/es-cl.ts @@ -422,7 +422,7 @@ export const spanish: IAppStrings = { }, canvasCommandBar: { items: { - layers:{ + layers: { text: "Capas", subMenuItems: { text: "Texto", @@ -481,7 +481,7 @@ export const spanish: IAppStrings = { keys: { lessThan: "<", greaterThan: ">", - }, + }, description: { prevPage: "Ir a la página anterior en documentos de varias páginas", nextPage: "Ir a la página siguiente en documentos de varias páginas", @@ -492,7 +492,7 @@ export const spanish: IAppStrings = { minus: "-", plus: "=", slash: "/", - }, + }, description: { in: "Acercarse", out: "Disminuir el zoom", @@ -503,11 +503,11 @@ export const spanish: IAppStrings = { keys: { delete: "Delete", backSpace: "Backspace", - }, + }, description: { delete: "Eliminar selección del mapa del documento o clave de selección de una etiqueta", backSpace: "Eliminar selección del mapa del documento o clave de selección de una etiqueta", - }, + }, }, drawnRegions: { keys: { @@ -523,7 +523,7 @@ export const spanish: IAppStrings = { tips: { quickLabeling: { name: "Etiquetado rápido", - description: "Las teclas de acceso rápido de 1 a 0 y todas las letras se asignan a las primeras 36 etiquetas, después de seleccionar una o varias palabras de los elementos de texto resaltados, al presionar estas teclas de acceso rápido, puede etiquetar las palabras seleccionadas.", + description: "Las teclas de acceso rápido de 1 a 0 y todas las letras se asignan a las primeras 36 etiquetas, después de seleccionar una o varias palabras de los elementos de texto resaltados, al presionar estas teclas de acceso rápido, puede etiquetar las palabras seleccionadas.", }, renameTag: { name: "Rename Tag", @@ -575,6 +575,10 @@ export const spanish: IAppStrings = { message: `Se ha producido un error al eliminar el proyecto. Validar el archivo de proyecto y el token de seguridad existen e inténtelo de nuevo`, }, + projectDeleteErrorSecurityTokenNotFound: { + title: 'No se encontró el token de seguridad al eliminar el proyecto', + message: "Token de seguridad no encontrado. El proyecto [$ {project.name}] se ha eliminado de la herramienta FoTT." + }, projectNotFound: { title: "", message: "", @@ -672,6 +676,10 @@ export const spanish: IAppStrings = { title: "Modelo no encontrado", message: "Modelo \"${modelID}\" no encontrado. Por favor use otro modelo.", }, + connectionNotExistError: { + title: "La conexión no existe", + message: "La conexión no existe." + }, getOcrError: { title: "No se puede cargar el archivo OCR", message: "Error al cargar desde el archivo OCR. Verifique su conexión o configuración de red." diff --git a/src/common/strings.ts b/src/common/strings.ts index 844590414..dbdb44ff4 100644 --- a/src/common/strings.ts +++ b/src/common/strings.ts @@ -547,6 +547,7 @@ export interface IAppStrings { projectInvalidSecurityToken: IErrorMetadata, projectUploadError: IErrorMetadata, projectDeleteError: IErrorMetadata, + projectDeleteErrorSecurityTokenNotFound: IErrorMetadata, projectNotFound: IErrorMetadata, genericRenderError: IErrorMetadata, securityTokenNotFound: IErrorMetadata, @@ -571,6 +572,7 @@ export interface IAppStrings { modelCountLimitExceeded: IErrorMetadata, requestSendError: IErrorMetadata, modelNotFound: IErrorMetadata, + connectionNotExistError: IErrorMetadata, getOcrError: IErrorMetadata, }; shareProject: { diff --git a/src/react/components/pages/homepage/homePage.tsx b/src/react/components/pages/homepage/homePage.tsx index 243c823c8..b9e9768bd 100644 --- a/src/react/components/pages/homepage/homePage.tsx +++ b/src/react/components/pages/homepage/homePage.tsx @@ -217,7 +217,16 @@ export default class HomePage extends React.Component { - await this.props.actions.deleteProject(project); + try { + await this.props.actions.deleteProject(project); + } catch (error) { + if(error instanceof AppError && error.errorCode === ErrorCode.SecurityTokenNotFound){ + toast.error(error.message, {autoClose:false}); + } + else{ + throw error; + } + } } private onProjectFileUpload = async (e, project) => { diff --git a/src/redux/actions/projectActions.ts b/src/redux/actions/projectActions.ts index 2aeb5f59d..6e1c5c276 100644 --- a/src/redux/actions/projectActions.ts +++ b/src/redux/actions/projectActions.ts @@ -152,11 +152,11 @@ export function deleteProject(project: IProject) .find((securityToken) => securityToken.name === project.securityToken); if (!projectToken) { - throw new AppError(ErrorCode.SecurityTokenNotFound, "Security Token Not Found"); + dispatch(deleteProjectAction(project)); + throw new AppError(ErrorCode.SecurityTokenNotFound, interpolate(strings.errors.projectDeleteErrorSecurityTokenNotFound.message, {project})); } const decryptedProject = await projectService.load(project, projectToken); - await projectService.delete(decryptedProject); dispatch(deleteProjectAction(decryptedProject)); };