From a1867168ec3325c895fd944612bc86bb79af16cb Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 31 Jan 2021 18:04:50 -0800 Subject: [PATCH] Complete menu navigation --- packages/webapp/lang/en.json | 11 +- packages/webapp/src/compiled-lang/en.json | 20 ++- .../components/forgot-password-page/index.tsx | 2 +- .../components/form/global-error/index.tsx | 2 +- .../src/components/form/input/index.tsx | 2 +- .../maps-page/action-chooser/index.tsx | 1 + .../action-dispatcher/action-dialog/index.tsx | 2 +- .../action-dispatcher/delete/index.tsx | 4 +- .../action-dispatcher/duplicate/index.tsx | 6 +- .../maps-page/action-dispatcher/index.tsx | 3 +- .../action-dispatcher/info/index.tsx | 4 +- .../action-dispatcher/rename/index.tsx | 2 +- .../webapp/src/components/maps-page/index.tsx | 158 +++++++++++------- .../components/maps-page/maps-list/index.tsx | 73 ++++++-- .../components/maps-page/maps-list/styled.ts | 9 +- .../webapp/src/components/maps-page/style.ts | 13 +- .../components/registration-page/index.tsx | 2 +- packages/webapp/src/reducers/serviceSlice.ts | 8 +- packages/webapp/src/services/index.ts | 48 ++++++ .../{Service.ts => mock-service/index.ts} | 79 +++------ 20 files changed, 288 insertions(+), 161 deletions(-) create mode 100644 packages/webapp/src/services/index.ts rename packages/webapp/src/services/{Service.ts => mock-service/index.ts} (84%) diff --git a/packages/webapp/lang/en.json b/packages/webapp/lang/en.json index 2ed716e7..1efb8af6 100644 --- a/packages/webapp/lang/en.json +++ b/packages/webapp/lang/en.json @@ -6,7 +6,7 @@ "defaultMessage": "Close" }, "action.delete": { - "defaultMessage": "Delete" + "defaultMessage": "History" }, "action.delete-description": { "defaultMessage": "Deleted mindmap can not be recovered. Do you want to continue ?." @@ -26,6 +26,9 @@ "action.info-title": { "defaultMessage": "Info" }, + "action.label": { + "defaultMessage": "Add Label" + }, "action.open": { "defaultMessage": "Open" }, @@ -120,6 +123,12 @@ "login.userinactive": { "defaultMessage": "Sorry, your account has not been activated yet. You'll receive a notification email when it becomes active. Stay tuned!." }, + "menu.account": { + "defaultMessage": "Account" + }, + "menu.signout": { + "defaultMessage": "Sign Out" + }, "registration.desc": { "defaultMessage": "Signing up is free and just take a moment" }, diff --git a/packages/webapp/src/compiled-lang/en.json b/packages/webapp/src/compiled-lang/en.json index 11384c39..c38c5779 100644 --- a/packages/webapp/src/compiled-lang/en.json +++ b/packages/webapp/src/compiled-lang/en.json @@ -14,7 +14,7 @@ "action.delete": [ { "type": 0, - "value": "Delete" + "value": "History" } ], "action.delete-description": [ @@ -53,6 +53,12 @@ "value": "Info" } ], + "action.label": [ + { + "type": 0, + "value": "Add Label" + } + ], "action.open": [ { "type": 0, @@ -239,6 +245,18 @@ "value": "Sorry, your account has not been activated yet. You'll receive a notification email when it becomes active. Stay tuned!." } ], + "menu.account": [ + { + "type": 0, + "value": "Account" + } + ], + "menu.signout": [ + { + "type": 0, + "value": "Sign Out" + } + ], "registration.desc": [ { "type": 0, diff --git a/packages/webapp/src/components/forgot-password-page/index.tsx b/packages/webapp/src/components/forgot-password-page/index.tsx index 2eba8b73..9419e28d 100644 --- a/packages/webapp/src/components/forgot-password-page/index.tsx +++ b/packages/webapp/src/components/forgot-password-page/index.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react' import { FormattedMessage, useIntl } from 'react-intl' import { useHistory } from "react-router-dom" -import { Service, ErrorInfo } from '../../services/Service' +import Service, { ErrorInfo } from '../../services' import Header from '../layout/header' import Footer from '../layout/footer' diff --git a/packages/webapp/src/components/form/global-error/index.tsx b/packages/webapp/src/components/form/global-error/index.tsx index 56940fee..3f55c151 100644 --- a/packages/webapp/src/components/form/global-error/index.tsx +++ b/packages/webapp/src/components/form/global-error/index.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { ErrorInfo } from "../../../services/Service" +import { ErrorInfo } from "../../../services" import StyledAlert from "./styled"; diff --git a/packages/webapp/src/components/form/input/index.tsx b/packages/webapp/src/components/form/input/index.tsx index 2434768f..d78e5696 100644 --- a/packages/webapp/src/components/form/input/index.tsx +++ b/packages/webapp/src/components/form/input/index.tsx @@ -1,7 +1,7 @@ import { TextField } from "@material-ui/core"; import React, { ChangeEvent } from "react"; import { MessageDescriptor, useIntl } from "react-intl"; -import { ErrorInfo } from "../../../services/Service"; +import { ErrorInfo } from "../../../services"; type InputProps = { name: string; 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 c1fd0cbd..9ce2f70f 100644 --- a/packages/webapp/src/components/maps-page/action-chooser/index.tsx +++ b/packages/webapp/src/components/maps-page/action-chooser/index.tsx @@ -36,6 +36,7 @@ const ActionChooser = (props: ActionProps) => { keepMounted open={Boolean(anchor)} onClose={handleOnClose(undefined)} + elevation={1} > 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 42bf0f40..18fcff6e 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,7 +1,7 @@ import React from "react"; import { Button, DialogContentText } from "@material-ui/core"; import { FormattedMessage, useIntl } from "react-intl"; -import { ErrorInfo } from "../../../../services/Service"; +import { ErrorInfo } from "../../../../services"; import { StyledDialog, StyledDialogActions, StyledDialogContent, StyledDialogTitle } from "./style"; import GlobalError from "../../../form/global-error"; 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 13ccc074..57f9a5c6 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 @@ -3,7 +3,7 @@ import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import { useMutation, useQueryClient } from "react-query"; import { useSelector } from "react-redux"; -import { Service } from "../../../../services/Service"; +import Service from "../../../../services"; import { activeInstance } from '../../../../reducers/serviceSlice'; import { DialogProps, fetchMapById, handleOnMutationSuccess } from ".."; import BaseDialog from "../action-dialog"; @@ -35,7 +35,7 @@ const DeleteDialog = (props: DialogProps) => {
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 cbae8461..21ad9c5b 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 @@ -4,7 +4,7 @@ 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 Service, { BasicMapInfo, ErrorInfo } from "../../../../services"; import { activeInstance } from '../../../../reducers/serviceSlice'; import Input from "../../../form/input"; import { DialogProps, fetchMapById, handleOnMutationSuccess } from ".."; @@ -75,7 +75,7 @@ const DuplicateDialog = (props: DialogProps) => { 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' })}> - + @@ -84,7 +84,7 @@ const DuplicateDialog = (props: DialogProps) => { value={model.description} onChange={handleOnChange} required={false} fullWidth={true} /> -
+ ); } diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx index 3be2cb44..1ef13f4d 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx @@ -2,7 +2,8 @@ import React from 'react'; import RenameDialog from './rename'; import DeleteDialog from './delete'; import { ActionType } from '../action-chooser'; -import { ErrorInfo, MapInfo, Service } from '../../../services/Service'; +import { ErrorInfo, MapInfo } from '../../../services'; +import Service from '../../../services'; import { useSelector } from 'react-redux'; import { QueryClient, useQuery } from 'react-query'; import { activeInstance } from '../../../reducers/serviceSlice'; 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 f28312a3..b66af62c 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 @@ -1,7 +1,7 @@ import React from "react"; import { useQueryClient } from "react-query"; import { useSelector } from "react-redux"; -import { Service } from "../../../../services/Service"; +import Service from "../../../../services"; import { activeInstance } from '../../../../reducers/serviceSlice'; import { DialogProps, fetchMapById } from ".."; import BaseDialog from "../action-dialog"; @@ -26,7 +26,7 @@ const InfoDialog = (props: DialogProps) => { open={props.open} onClose={handleOnClose} title={intl.formatMessage({ id: "action.info-title", defaultMessage: "Info" })}> -