diff --git a/packages/webapp/lang/en.json b/packages/webapp/lang/en.json index de488f3f..2ed716e7 100644 --- a/packages/webapp/lang/en.json +++ b/packages/webapp/lang/en.json @@ -2,6 +2,9 @@ "action.cancel-button": { "defaultMessage": "Cancel" }, + "action.close-button": { + "defaultMessage": "Close" + }, "action.delete": { "defaultMessage": "Delete" }, @@ -20,6 +23,9 @@ "action.info": { "defaultMessage": "Info" }, + "action.info-title": { + "defaultMessage": "Info" + }, "action.open": { "defaultMessage": "Open" }, @@ -38,6 +44,9 @@ "common.wait": { "defaultMessage": "Please wait ..." }, + "duplicate.title": { + "defaultMessage": "Duplicate" + }, "footer.aboutus": { "defaultMessage": "About Us" }, @@ -126,6 +135,12 @@ "registration.title": { "defaultMessage": "Become a member" }, + "rename.description": { + "defaultMessage": "Please, fill the new map name and description." + }, + "rename.title": { + "defaultMessage": "Rename" + }, "resetpassword.success.title": { "defaultMessage": "Your account has been created successfully" } diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 721abb41..fe21b6b9 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -42,7 +42,7 @@ "webpack-dev-server": "^3.11.0" }, "dependencies": { - "@material-ui/core": "^4.11.2", + "@material-ui/core": "^4.11.1", "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.0.0-alpha.57", "@reduxjs/toolkit": "^1.5.0", @@ -57,4 +57,4 @@ "react-router-dom": "^5.2.0", "styled-components": "^5.1.7" } -} +} \ No newline at end of file diff --git a/packages/webapp/src/compiled-lang/en.json b/packages/webapp/src/compiled-lang/en.json index 3716dff7..11384c39 100644 --- a/packages/webapp/src/compiled-lang/en.json +++ b/packages/webapp/src/compiled-lang/en.json @@ -5,6 +5,12 @@ "value": "Cancel" } ], + "action.close-button": [ + { + "type": 0, + "value": "Close" + } + ], "action.delete": [ { "type": 0, @@ -41,6 +47,12 @@ "value": "Info" } ], + "action.info-title": [ + { + "type": 0, + "value": "Info" + } + ], "action.open": [ { "type": 0, @@ -77,6 +89,12 @@ "value": "Please wait ..." } ], + "duplicate.title": [ + { + "type": 0, + "value": "Duplicate" + } + ], "footer.aboutus": [ { "type": 0, @@ -251,6 +269,18 @@ "value": "Become a member" } ], + "rename.description": [ + { + "type": 0, + "value": "Please, fill the new map name and description." + } + ], + "rename.title": [ + { + "type": 0, + "value": "Rename" + } + ], "resetpassword.success.title": [ { "type": 0, diff --git a/packages/webapp/src/compiled-lang/es.json b/packages/webapp/src/compiled-lang/es.json index 466510d0..670a6a2a 100644 --- a/packages/webapp/src/compiled-lang/es.json +++ b/packages/webapp/src/compiled-lang/es.json @@ -1,78 +1,116 @@ { - "footer.aboutus": [{ - "type": 0, - "value": "Sobre Nosotros" - }], - "footer.contactus": [{ - "type": 0, - "value": "Contáctenos" - }], - "footer.donations": [{ - "type": 0, - "value": "Donaciones" - }], - "footer.faq": [{ - "type": 0, - "value": "Preguntas Frecuentes" - }], - "footer.feedback": [{ - "type": 0, - "value": "Feedback" - }], - "footer.opensource": [{ - "type": 0, - "value": "Open Source" - }], - "footer.termsandconditions": [{ - "type": 0, - "value": "Terminos y Condiciones" - }], - "header.donthaveaccount": [{ - "type": 0, - "value": "No tienes una cuenta ?" - }], - "login.email": [{ - "type": 0, - "value": "Email" - }], - "login.error": [{ - "type": 0, - "value": "El email o la contraseña no es valida." - }], - "login.forgotpwd": [{ - "type": 0, - "value": "Olvidaste la contraseña ?" - }], - "login.hsqldbcofig": [{ - "type": 0, - "value": "Warning: Although HSQLDB is bundled with WiseMapping by default during the installation, we do not recommend this database for production use. Please consider using MySQL 5.7 instead. You can find more information how to configure MySQL" - }], - "login.loginto": [{ - "type": 0, - "value": "Ingresar a tu Cuenta" - }], - "login.password": [{ - "type": 0, - "value": "Contraseña" - }], - "login.remberme": [{ - "type": 0, - "value": "Recordarme" - }], - "login.signin": [{ - "type": 0, - "value": "Ingresar" - }], - "login.signup": [{ - "type": 0, - "value": "Registrarse" - }], - "login.userinactive": [{ - "type": 0, - "value": "Sorry, your account has not been activated yet. You'll receive a notification email when it becomes active. Stay tuned!." - }], - "login.welcome": [{ - "type": 0, - "value": "Bienvenido" - }] + "footer.aboutus": [ + { + "type": 0, + "value": "Sobre Nosotros" + } + ], + "footer.contactus": [ + { + "type": 0, + "value": "Contáctenos" + } + ], + "footer.donations": [ + { + "type": 0, + "value": "Donaciones" + } + ], + "footer.faq": [ + { + "type": 0, + "value": "Preguntas Frecuentes" + } + ], + "footer.feedback": [ + { + "type": 0, + "value": "Feedback" + } + ], + "footer.opensource": [ + { + "type": 0, + "value": "Open Source" + } + ], + "footer.termsandconditions": [ + { + "type": 0, + "value": "Terminos y Condiciones" + } + ], + "header.donthaveaccount": [ + { + "type": 0, + "value": "No tienes una cuenta ?" + } + ], + "login.email": [ + { + "type": 0, + "value": "Email" + } + ], + "login.error": [ + { + "type": 0, + "value": "El email o la contraseña no es valida." + } + ], + "login.forgotpwd": [ + { + "type": 0, + "value": "Olvidaste la contraseña ?" + } + ], + "login.hsqldbcofig": [ + { + "type": 0, + "value": "Warning: Although HSQLDB is bundled with WiseMapping by default during the installation, we do not recommend this database for production use. Please consider using MySQL 5.7 instead. You can find more information how to configure MySQL" + } + ], + "login.loginto": [ + { + "type": 0, + "value": "Ingresar a tu Cuenta" + } + ], + "login.password": [ + { + "type": 0, + "value": "Contraseña" + } + ], + "login.remberme": [ + { + "type": 0, + "value": "Recordarme" + } + ], + "login.signin": [ + { + "type": 0, + "value": "Ingresar" + } + ], + "login.signup": [ + { + "type": 0, + "value": "Registrarse" + } + ], + "login.userinactive": [ + { + "type": 0, + "value": "Sorry, your account has not been activated yet. You'll receive a notification email when it becomes active. Stay tuned!." + } + ], + "login.welcome": [ + { + "type": 0, + "value": "Bienvenido" + } + ] } \ No newline at end of file diff --git a/packages/webapp/src/components/layout/form-container/styled.ts b/packages/webapp/src/components/layout/form-container/styled.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/webapp/src/components/maps-page/action-chooser/index.tsx b/packages/webapp/src/components/maps-page/action-chooser/index.tsx index add511bf..b0b6615a 100644 --- a/packages/webapp/src/components/maps-page/action-chooser/index.tsx +++ b/packages/webapp/src/components/maps-page/action-chooser/index.tsx @@ -9,10 +9,10 @@ import EditOutlinedIcon from '@material-ui/icons/EditOutlined'; import PublicOutlinedIcon from '@material-ui/icons/PublicOutlined'; import PrintOutlinedIcon from '@material-ui/icons/PrintOutlined'; import ShareOutlinedIcon from '@material-ui/icons/ShareOutlined'; -import { StyledMenuItem } from '../maps-list/styled'; +import { StyledMenuItem } from './styled'; import { FormattedMessage } from 'react-intl'; -export type ActionType = 'open' | 'share' | 'delete' | 'info' | 'duplicate' | 'export' | 'rename' | 'print' | 'info' | 'publish' | undefined; +export type ActionType = 'open' | 'share' | 'delete' | 'info' | 'duplicate' | 'export' | 'rename' | 'print' | 'info' | 'publish' | 'history'| undefined; interface ActionProps { onClose: (action: ActionType) => void; @@ -36,6 +36,7 @@ const ActionChooser = (props: ActionProps) => { keepMounted open={Boolean(anchor)} onClose={handleOnClose(undefined)} + > @@ -70,6 +71,11 @@ const ActionChooser = (props: ActionProps) => { + + + + + ); } diff --git a/packages/webapp/src/components/maps-page/action-chooser/styled.ts b/packages/webapp/src/components/maps-page/action-chooser/styled.ts new file mode 100644 index 00000000..8347a02d --- /dev/null +++ b/packages/webapp/src/components/maps-page/action-chooser/styled.ts @@ -0,0 +1,10 @@ +import { MenuItem, withStyles } from "@material-ui/core"; + +export const StyledMenuItem = withStyles({ + root: { + width: '300px', + padding: '10px 20px', + marging: '0px 20px' + } + })(MenuItem) + \ No newline at end of file diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/action-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/action-dialog/index.tsx index 4635f654..42bf0f40 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/action-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/action-dialog/index.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { Button, DialogContentText, DialogTitle } from "@material-ui/core"; -import { FormattedMessage, MessageDescriptor, useIntl } from "react-intl"; +import { Button, DialogContentText } from "@material-ui/core"; +import { FormattedMessage, useIntl } from "react-intl"; import { ErrorInfo } from "../../../../services/Service"; import { StyledDialog, StyledDialogActions, StyledDialogContent, StyledDialogTitle } from "./style"; import GlobalError from "../../../form/global-error"; @@ -12,9 +12,9 @@ export type DialogProps = { children: any; error?: ErrorInfo; - title: MessageDescriptor; - description?: MessageDescriptor; - submitButton?: MessageDescriptor; + title: string; + description?: string; + submitButton?: string; } const BaseDialog = (props: DialogProps) => { @@ -23,7 +23,7 @@ const BaseDialog = (props: DialogProps) => { const isOpen = props.open; const handleOnSubmit = props.onSubmit; - const description = props.description ? ({intl.formatMessage(props.description)}) : null; + const description = props.description ? ({props.description}) : null; return (
@@ -34,7 +34,7 @@ const BaseDialog = (props: DialogProps) => { fullWidth={true}>
- {intl.formatMessage(props.title)} + {props.title} @@ -49,7 +49,7 @@ const BaseDialog = (props: DialogProps) => { {handleOnSubmit ? ( ) : null } diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/delete/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/delete/index.tsx index e04ef7ab..13ccc074 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/delete/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/delete/index.tsx @@ -10,6 +10,8 @@ import BaseDialog from "../action-dialog"; const DeleteDialog = (props: DialogProps) => { + const intl = useIntl(); + const service: Service = useSelector(activeInstance); const queryClient = useQueryClient(); const mutation = useMutation((id: number) => service.deleteMap(id), @@ -33,8 +35,8 @@ const DeleteDialog = (props: DialogProps) => {
+ title={intl.formatMessage({ id: "action.delete-title", defaultMessage: "Delete" })} + submitButton={intl.formatMessage({ id: "action.delete-title", defaultMessage: "Delete" })} > Delete '{map?.name}' diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/duplicate/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/duplicate/index.tsx index 39b68ef6..cbae8461 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/duplicate/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/duplicate/index.tsx @@ -2,10 +2,11 @@ import React, { useEffect } from "react"; import { useIntl } from "react-intl"; import { useMutation, useQueryClient } from "react-query"; import { useSelector } from "react-redux"; +import { FormControl } from "@material-ui/core"; + import { BasicMapInfo, ErrorInfo, Service } from "../../../../services/Service"; import { activeInstance } from '../../../../reducers/serviceSlice'; import Input from "../../../form/input"; -import { FormControl } from "@material-ui/core"; import { DialogProps, fetchMapById, handleOnMutationSuccess } from ".."; import BaseDialog from "../action-dialog"; @@ -71,10 +72,10 @@ const DuplicateDialog = (props: DialogProps) => { return (
- + title={intl.formatMessage({ id: 'duplicate.title', defaultMessage: 'Duplicate' })} + description={intl.formatMessage({ id: 'rename.description', defaultMessage: 'Please, fill the new map name and description.' })} + submitButton={intl.formatMessage({ id: 'duplicate.title', defaultMessage: 'Duplicate' })}> + diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/info/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/info/index.tsx index 401c6735..f28312a3 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/info/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/info/index.tsx @@ -5,12 +5,14 @@ import { Service } from "../../../../services/Service"; import { activeInstance } from '../../../../reducers/serviceSlice'; import { DialogProps, fetchMapById } from ".."; import BaseDialog from "../action-dialog"; +import { useIntl } from "react-intl"; const InfoDialog = (props: DialogProps) => { const service: Service = useSelector(activeInstance); const queryClient = useQueryClient(); - + const intl = useIntl(); + const mapId = props.mapId; const handleOnClose = (): void => { @@ -22,7 +24,7 @@ const InfoDialog = (props: DialogProps) => {
+ title={intl.formatMessage({ id: "action.info-title", defaultMessage: "Info" })}>