From 035bf97474f7190b1bcb93c9fc21aa3268251c97 Mon Sep 17 00:00:00 2001
From: Juan Allo Ron <2070972+juanallo@users.noreply.github.com>
Date: Mon, 22 Feb 2021 22:37:29 -0800
Subject: [PATCH] formatting all the files
---
.../editor/src/components/canvas/index.tsx | 10 +-
.../editor/src/components/canvas/styled.ts | 4 +-
.../editor/src/components/footer/index.tsx | 10 +-
.../editor/src/components/footer/styled.ts | 12 +-
.../editor/src/components/frame/index.tsx | 24 +-
.../editor/src/components/frame/styled.ts | 12 +-
.../editor/src/components/top-bar/index.tsx | 8 +-
.../editor/src/components/top-bar/styled.ts | 12 +-
packages/editor/src/index.tsx | 4 +-
packages/editor/src/size.ts | 15 +-
.../webapp/cypress/integration/maps.test.ts | 26 +-
.../webapp/cypress/pageObject/MapsPage.ts | 20 +-
packages/webapp/cypress/plugins/index.ts | 4 +-
packages/webapp/cypress/support/index.ts | 2 +-
packages/webapp/src/@types/index.d.ts | 4 +-
packages/webapp/src/@types/typings.d.ts | 26 +-
packages/webapp/src/app.tsx | 125 +--
packages/webapp/src/classes/app-i18n/index.ts | 48 +-
.../client/client-health-sentinel/index.tsx | 53 +-
packages/webapp/src/classes/client/index.ts | 125 ++-
.../src/classes/client/mock-client/index.ts | 333 +++---
.../src/classes/client/rest-client/index.ts | 712 +++++++------
.../components/forgot-password-page/index.tsx | 109 +-
.../forgot-password-success-page/index.tsx | 63 +-
.../components/form/global-error/index.tsx | 29 +-
.../components/form/global-error/styled.ts | 15 +-
.../src/components/form/input/index.tsx | 50 +-
.../components/form/submit-button/index.tsx | 38 +-
.../src/components/layout/footer/index.tsx | 84 +-
.../src/components/layout/footer/styled.ts | 70 +-
.../layout/form-container/index.tsx | 10 +-
.../src/components/layout/header/index.tsx | 116 ++-
.../src/components/layout/header/styled.ts | 128 +--
.../src/components/login-page/index.tsx | 188 ++--
.../account-info-dialog/index.tsx | 184 ++--
.../change-password-dialog/index.tsx | 126 ++-
.../maps-page/account-menu/index.tsx | 89 +-
.../maps-page/action-chooser/index.tsx | 250 ++---
.../maps-page/action-chooser/styled.ts | 11 +-
.../action-dispatcher/base-dialog/index.tsx | 81 +-
.../action-dispatcher/base-dialog/style.ts | 32 +-
.../action-dispatcher/create-dialog/index.tsx | 120 ++-
.../action-dispatcher/delete-dialog/index.tsx | 103 +-
.../delete-multiselect-dialog/index.tsx | 103 +-
.../duplicate-dialog/index.tsx | 138 ++-
.../action-dispatcher/export-dialog/index.tsx | 235 +++--
.../action-dispatcher/export-dialog/style.ts | 14 +-
.../history-dialog/index.tsx | 205 ++--
.../action-dispatcher/import-dialog/index.tsx | 169 ++--
.../maps-page/action-dispatcher/index.tsx | 114 ++-
.../action-dispatcher/info-dialog/index.tsx | 181 ++--
.../action-dispatcher/info-dialog/style.ts | 14 +-
.../publish-dialog/index.tsx | 163 +--
.../action-dispatcher/publish-dialog/style.ts | 12 +-
.../action-dispatcher/rename-dialog/index.tsx | 141 +--
.../action-dispatcher/share-dialog/index.tsx | 437 ++++----
.../action-dispatcher/share-dialog/style.ts | 21 +-
.../components/maps-page/help-menu/index.tsx | 79 +-
.../webapp/src/components/maps-page/index.tsx | 358 ++++---
.../maps-page/language-menu/index.tsx | 134 +--
.../components/maps-page/maps-list/index.tsx | 956 ++++++++++--------
.../components/maps-page/maps-list/styled.ts | 200 ++--
.../components/maps-page/role-icon/index.tsx | 85 +-
.../webapp/src/components/maps-page/style.ts | 19 +-
.../components/registration-page/index.tsx | 235 +++--
.../registration-success-page/index.tsx | 76 +-
packages/webapp/src/index.tsx | 12 +-
packages/webapp/src/redux/clientSlice.ts | 130 ++-
packages/webapp/src/redux/store.ts | 15 +-
packages/webapp/src/theme/index.ts | 37 +-
70 files changed, 4365 insertions(+), 3403 deletions(-)
diff --git a/packages/editor/src/components/canvas/index.tsx b/packages/editor/src/components/canvas/index.tsx
index 6ad5cb89..dbc87f1f 100644
--- a/packages/editor/src/components/canvas/index.tsx
+++ b/packages/editor/src/components/canvas/index.tsx
@@ -1,8 +1,6 @@
-import React from 'react';
-import { StyledCanvas } from './styled';
+import React from 'react'
+import { StyledCanvas } from './styled'
-const Canvas = (): React.ReactElement => (
- canvas
-);
+const Canvas = (): React.ReactElement => canvas
-export default Canvas;
+export default Canvas
diff --git a/packages/editor/src/components/canvas/styled.ts b/packages/editor/src/components/canvas/styled.ts
index 7cc7eb85..8f35d710 100644
--- a/packages/editor/src/components/canvas/styled.ts
+++ b/packages/editor/src/components/canvas/styled.ts
@@ -1,8 +1,8 @@
-import styled from 'styled-components';
+import styled from 'styled-components'
export const StyledCanvas = styled.div`
height: 100%
width: 100%;
flex: 1;
-`;
+`
diff --git a/packages/editor/src/components/footer/index.tsx b/packages/editor/src/components/footer/index.tsx
index da0aad74..b42ffdca 100644
--- a/packages/editor/src/components/footer/index.tsx
+++ b/packages/editor/src/components/footer/index.tsx
@@ -1,8 +1,6 @@
-import React from 'react';
-import { StyledFooter } from './styled';
+import React from 'react'
+import { StyledFooter } from './styled'
-const Footer = (): React.ReactElement => (
- footer
-);
+const Footer = (): React.ReactElement => footer
-export default Footer;
+export default Footer
diff --git a/packages/editor/src/components/footer/styled.ts b/packages/editor/src/components/footer/styled.ts
index fd557520..e9d95535 100644
--- a/packages/editor/src/components/footer/styled.ts
+++ b/packages/editor/src/components/footer/styled.ts
@@ -1,8 +1,8 @@
-import styled from 'styled-components';
-import { times } from '../../size';
+import styled from 'styled-components'
+import { times } from '../../size'
export const StyledFooter = styled.div`
- height: ${times(10)};
- width: 100%;
- border: 1px solid black;
-`;
+ height: ${times(10)};
+ width: 100%;
+ border: 1px solid black;
+`
diff --git a/packages/editor/src/components/frame/index.tsx b/packages/editor/src/components/frame/index.tsx
index 2cf8527f..31f88de4 100644
--- a/packages/editor/src/components/frame/index.tsx
+++ b/packages/editor/src/components/frame/index.tsx
@@ -1,15 +1,15 @@
-import React from 'react';
-import Footer from '../footer';
-import TopBar from '../top-bar';
-import Canvas from '../canvas';
-import { StyledFrame } from './styled';
+import React from 'react'
+import Footer from '../footer'
+import TopBar from '../top-bar'
+import Canvas from '../canvas'
+import { StyledFrame } from './styled'
const Frame = (): React.ReactElement => (
-
-
-
-
-
-);
+
+
+
+
+
+)
-export default Frame;
+export default Frame
diff --git a/packages/editor/src/components/frame/styled.ts b/packages/editor/src/components/frame/styled.ts
index 0d31f372..d892f457 100644
--- a/packages/editor/src/components/frame/styled.ts
+++ b/packages/editor/src/components/frame/styled.ts
@@ -1,8 +1,8 @@
-import styled from 'styled-components';
+import styled from 'styled-components'
export const StyledFrame = styled.div`
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
-`;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+`
diff --git a/packages/editor/src/components/top-bar/index.tsx b/packages/editor/src/components/top-bar/index.tsx
index 5670f1de..09f3f28c 100644
--- a/packages/editor/src/components/top-bar/index.tsx
+++ b/packages/editor/src/components/top-bar/index.tsx
@@ -1,8 +1,6 @@
-import React from 'react';
+import React from 'react'
import { StyledTopBar } from './styled'
-const TopBar = ():React.ReactElement => (
- top bar
-);
+const TopBar = (): React.ReactElement => top bar
-export default TopBar;
+export default TopBar
diff --git a/packages/editor/src/components/top-bar/styled.ts b/packages/editor/src/components/top-bar/styled.ts
index f79be7be..aed29805 100644
--- a/packages/editor/src/components/top-bar/styled.ts
+++ b/packages/editor/src/components/top-bar/styled.ts
@@ -1,8 +1,8 @@
-import styled from 'styled-components';
-import { times } from '../../size';
+import styled from 'styled-components'
+import { times } from '../../size'
export const StyledTopBar = styled.div`
- height: ${times(10)};
- width: 100%;
- border: 1px solid black;
-`;
+ height: ${times(10)};
+ width: 100%;
+ border: 1px solid black;
+`
diff --git a/packages/editor/src/index.tsx b/packages/editor/src/index.tsx
index 5b7b798e..2a51ac6a 100644
--- a/packages/editor/src/index.tsx
+++ b/packages/editor/src/index.tsx
@@ -1,3 +1,3 @@
-import Editor from './components/frame';
+import Editor from './components/frame'
-export default Editor;
+export default Editor
diff --git a/packages/editor/src/size.ts b/packages/editor/src/size.ts
index e3432eb0..99fcd521 100644
--- a/packages/editor/src/size.ts
+++ b/packages/editor/src/size.ts
@@ -1,10 +1,9 @@
+const unit = 4 // pixels
-const unit = 4; // pixels
+export const XS = '4px'
+export const S = '8px'
+export const M = '16px'
+export const L = '24px'
+export const XL = '24px'
-export const XS = '4px';
-export const S = '8px';
-export const M = '16px';
-export const L = '24px';
-export const XL = '24px';
-
-export const times = (n: number):string => `${unit * n}px`;
+export const times = (n: number): string => `${unit * n}px`
diff --git a/packages/webapp/cypress/integration/maps.test.ts b/packages/webapp/cypress/integration/maps.test.ts
index de55c77d..8a9d518a 100644
--- a/packages/webapp/cypress/integration/maps.test.ts
+++ b/packages/webapp/cypress/integration/maps.test.ts
@@ -1,16 +1,16 @@
-import MapsPage from "../pageObject/MapsPage";
+import MapsPage from '../pageObject/MapsPage'
-context("Maps Page", () => {
- beforeEach(() => {
- cy.visit("http://localhost:3000/c/maps");
- });
+context('Maps Page', () => {
+ beforeEach(() => {
+ cy.visit('http://localhost:3000/c/maps')
+ })
- it("should load the maps page", () => {
- MapsPage.isLoaded();
- });
+ it('should load the maps page', () => {
+ MapsPage.isLoaded()
+ })
- it("should open the create dialog", () => {
- MapsPage.create();
- MapsPage.isCreateDialogVisible();
- });
-});
+ it('should open the create dialog', () => {
+ MapsPage.create()
+ MapsPage.isCreateDialogVisible()
+ })
+})
diff --git a/packages/webapp/cypress/pageObject/MapsPage.ts b/packages/webapp/cypress/pageObject/MapsPage.ts
index 1df20628..73e877eb 100644
--- a/packages/webapp/cypress/pageObject/MapsPage.ts
+++ b/packages/webapp/cypress/pageObject/MapsPage.ts
@@ -1,14 +1,14 @@
export default class MapsPage {
- static isLoaded() {
- return cy.findByTestId("create");
- }
+ static isLoaded() {
+ return cy.findByTestId('create')
+ }
- static create() {
- return cy.findByTestId("create").click();
- }
+ static create() {
+ return cy.findByTestId('create').click()
+ }
- static isCreateDialogVisible() {
- //TODO move to findByText when the double create dialog issue is solved
- return cy.findAllByText("Create a new mindmap");
- }
+ static isCreateDialogVisible() {
+ //TODO move to findByText when the double create dialog issue is solved
+ return cy.findAllByText('Create a new mindmap')
+ }
}
diff --git a/packages/webapp/cypress/plugins/index.ts b/packages/webapp/cypress/plugins/index.ts
index 5bfdbc45..ab93c3fe 100644
--- a/packages/webapp/cypress/plugins/index.ts
+++ b/packages/webapp/cypress/plugins/index.ts
@@ -2,6 +2,6 @@
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
- // `on` is used to hook into various events Cypress emits
- // `config` is the resolved Cypress config
+ // `on` is used to hook into various events Cypress emits
+ // `config` is the resolved Cypress config
}
diff --git a/packages/webapp/cypress/support/index.ts b/packages/webapp/cypress/support/index.ts
index f65e7f7c..43c03b75 100644
--- a/packages/webapp/cypress/support/index.ts
+++ b/packages/webapp/cypress/support/index.ts
@@ -1 +1 @@
-import './commands'
\ No newline at end of file
+import './commands'
diff --git a/packages/webapp/src/@types/index.d.ts b/packages/webapp/src/@types/index.d.ts
index e238d01c..dbd12dc9 100644
--- a/packages/webapp/src/@types/index.d.ts
+++ b/packages/webapp/src/@types/index.d.ts
@@ -1,2 +1,2 @@
-declare module '*.png';
-declare module '*.svg';
+declare module '*.png'
+declare module '*.svg'
diff --git a/packages/webapp/src/@types/typings.d.ts b/packages/webapp/src/@types/typings.d.ts
index fe4cdc9f..b44fe72c 100644
--- a/packages/webapp/src/@types/typings.d.ts
+++ b/packages/webapp/src/@types/typings.d.ts
@@ -1,19 +1,19 @@
-declare module '*.jpeg';
-declare module '*.jpg';
-declare module '*.jpeg';
-declare module '*.png';
-declare module '*.svg';
-declare module '*.json';
+declare module '*.jpeg'
+declare module '*.jpg'
+declare module '*.jpeg'
+declare module '*.png'
+declare module '*.svg'
+declare module '*.json'
import { Dayjs } from 'dayjs'
type DateType = string | number | Date | Dayjs
// @Todo: review if there is a better support for this.
declare module 'dayjs' {
- interface Dayjs {
- fromNow(withoutSuffix?: boolean): string
- from(compared: DateType, withoutSuffix?: boolean): string
- toNow(withoutSuffix?: boolean): string
- to(compared: DateType, withoutSuffix?: boolean): string
- }
-}
\ No newline at end of file
+ interface Dayjs {
+ fromNow(withoutSuffix?: boolean): string
+ from(compared: DateType, withoutSuffix?: boolean): string
+ toNow(withoutSuffix?: boolean): string
+ to(compared: DateType, withoutSuffix?: boolean): string
+ }
+}
diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx
index c343d32c..73492f7b 100644
--- a/packages/webapp/src/app.tsx
+++ b/packages/webapp/src/app.tsx
@@ -1,65 +1,76 @@
-import React, { ReactElement } from 'react';
-import { IntlProvider } from 'react-intl';
-import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom';
+import React, { ReactElement } from 'react'
+import { IntlProvider } from 'react-intl'
+import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom'
-import RegistrationSuccessPage from './components/registration-success-page';
-import ForgotPasswordSuccessPage from './components/forgot-password-success-page';
-import RegistationPage from './components/registration-page';
-import LoginPage from './components/login-page';
-import store from "./redux/store";
-import { ForgotPasswordPage } from './components/forgot-password-page';
-import { Provider } from 'react-redux';
-import { QueryClient, QueryClientProvider } from 'react-query';
+import RegistrationSuccessPage from './components/registration-success-page'
+import ForgotPasswordSuccessPage from './components/forgot-password-success-page'
+import RegistationPage from './components/registration-page'
+import LoginPage from './components/login-page'
+import store from './redux/store'
+import { ForgotPasswordPage } from './components/forgot-password-page'
+import { Provider } from 'react-redux'
+import { QueryClient, QueryClientProvider } from 'react-query'
import { theme } from './theme'
-import AppI18n, { Locales } from './classes/app-i18n';
-import MapsPage from './components/maps-page';
-import CssBaseline from '@material-ui/core/CssBaseline';
-import { ThemeProvider } from '@material-ui/core/styles';
+import AppI18n, { Locales } from './classes/app-i18n'
+import MapsPage from './components/maps-page'
+import CssBaseline from '@material-ui/core/CssBaseline'
+import { ThemeProvider } from '@material-ui/core/styles'
const queryClient = new QueryClient({
- defaultOptions: {
- queries: {
- refetchIntervalInBackground: false,
- staleTime: 5 * 1000 * 60 // 10 minutes
- }
- }
-});
+ defaultOptions: {
+ queries: {
+ refetchIntervalInBackground: false,
+ staleTime: 5 * 1000 * 60, // 10 minutes
+ },
+ },
+})
-const App = ():ReactElement => {
- const appi18n = new AppI18n();
- const locale = appi18n.getBrowserLocale();
+const App = (): ReactElement => {
+ const appi18n = new AppI18n()
+ const locale = appi18n.getBrowserLocale()
- return locale.message ? (
-
-
- }>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ) : (
Loading ...
)
+ return locale.message ? (
+
+
+ }
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ) : (
+ Loading ...
+ )
}
-export default App;
+export default App
diff --git a/packages/webapp/src/classes/app-i18n/index.ts b/packages/webapp/src/classes/app-i18n/index.ts
index 9af15a03..dfa5ead2 100644
--- a/packages/webapp/src/classes/app-i18n/index.ts
+++ b/packages/webapp/src/classes/app-i18n/index.ts
@@ -1,48 +1,46 @@
-import { fetchAccount } from './../../redux/clientSlice';
-import 'dayjs/locale/fr';
-import 'dayjs/locale/en';
-import 'dayjs/locale/es';
+import { fetchAccount } from './../../redux/clientSlice'
+import 'dayjs/locale/fr'
+import 'dayjs/locale/en'
+import 'dayjs/locale/es'
export class Locale {
- code: LocaleCode;
- label: string;
- message: Record ;
+ code: LocaleCode
+ label: string
+ message: Record
constructor(code: LocaleCode, label: string, message: unknown) {
- this.code = code;
- this.label = label;
- this.message = message as Record;
+ this.code = code
+ this.label = label
+ this.message = message as Record
}
}
export default class AppI18n {
public getUserLocale(): Locale {
- const account = fetchAccount();
- return account ? account.locale : this.getBrowserLocale();
+ const account = fetchAccount()
+ return account ? account.locale : this.getBrowserLocale()
}
public getBrowserLocale(): Locale {
- let localeCode = (navigator.languages && navigator.languages[0])
- || navigator.language;
+ let localeCode = (navigator.languages && navigator.languages[0]) || navigator.language
// Just remove the variant ...
- localeCode = localeCode.split('-')[0];
+ localeCode = localeCode.split('-')[0]
- let result = Locales.EN;
+ let result = Locales.EN
try {
result = localeFromStr(localeCode)
} catch {
- console.warn(`Unsupported languange code ${localeCode}`);
+ console.warn(`Unsupported languange code ${localeCode}`)
}
- return result;
+ return result
}
}
-export type LocaleCode = 'en' | 'es' | 'fr' | 'de';
+export type LocaleCode = 'en' | 'es' | 'fr' | 'de'
-export const Locales =
-{
+export const Locales = {
EN: new Locale('en', 'English', require('./../../compiled-lang/en.json')),
ES: new Locale('es', 'Español', require('./../../compiled-lang/es.json')),
DE: new Locale('fr', 'Français', require('./../../compiled-lang/fr.json')),
@@ -50,15 +48,13 @@ export const Locales =
}
export const localeFromStr = (code: string): Locale => {
- const locales: Locale[] = Object
- .values(Locales);
+ const locales: Locale[] = Object.values(Locales)
- const result = locales
- .find((l) => l.code == code);
+ const result = locales.find((l) => l.code == code)
if (!result) {
throw `Language code could not be found in list of default supported: + ${code}`
}
- return result;
+ return result
}
diff --git a/packages/webapp/src/classes/client/client-health-sentinel/index.tsx b/packages/webapp/src/classes/client/client-health-sentinel/index.tsx
index 43c5c0e9..bc0ffc2e 100644
--- a/packages/webapp/src/classes/client/client-health-sentinel/index.tsx
+++ b/packages/webapp/src/classes/client/client-health-sentinel/index.tsx
@@ -1,20 +1,20 @@
-import { useSelector } from 'react-redux';
-import React from "react";
-import { activeInstanceStatus, ClientStatus } from '../../../redux/clientSlice';
-import { FormattedMessage } from 'react-intl';
-import Dialog from '@material-ui/core/Dialog';
-import DialogTitle from '@material-ui/core/DialogTitle';
-import DialogContent from '@material-ui/core/DialogContent';
-import Alert from '@material-ui/lab/Alert';
-import DialogActions from '@material-ui/core/DialogActions';
-import Button from '@material-ui/core/Button';
-import AlertTitle from '@material-ui/lab/AlertTitle';
+import { useSelector } from 'react-redux'
+import React from 'react'
+import { activeInstanceStatus, ClientStatus } from '../../../redux/clientSlice'
+import { FormattedMessage } from 'react-intl'
+import Dialog from '@material-ui/core/Dialog'
+import DialogTitle from '@material-ui/core/DialogTitle'
+import DialogContent from '@material-ui/core/DialogContent'
+import Alert from '@material-ui/lab/Alert'
+import DialogActions from '@material-ui/core/DialogActions'
+import Button from '@material-ui/core/Button'
+import AlertTitle from '@material-ui/lab/AlertTitle'
const ClientHealthSentinel = (): React.ReactElement => {
- const status: ClientStatus = useSelector(activeInstanceStatus);
+ const status: ClientStatus = useSelector(activeInstanceStatus)
const handleOnClose = () => {
- window.location.href = '/c/login';
+ window.location.href = '/c/login'
}
return (
@@ -23,30 +23,33 @@ const ClientHealthSentinel = (): React.ReactElement => {
open={status.state != 'healthy'}
onClose={handleOnClose}
maxWidth="sm"
- fullWidth={true}>
-
+ fullWidth={true}
+ >
-
+
-
+
+
+
-
-
)
-};
-export default ClientHealthSentinel;
\ No newline at end of file
+}
+export default ClientHealthSentinel
diff --git a/packages/webapp/src/classes/client/index.ts b/packages/webapp/src/classes/client/index.ts
index 50c0069b..4633e3fd 100644
--- a/packages/webapp/src/classes/client/index.ts
+++ b/packages/webapp/src/classes/client/index.ts
@@ -1,109 +1,108 @@
-import { Locale, LocaleCode } from "../app-i18n"
+import { Locale, LocaleCode } from '../app-i18n'
export type NewUser = {
- email: string;
- firstname: string;
- lastname: string;
- password: string;
- recaptcha: string | null;
+ email: string
+ firstname: string
+ lastname: string
+ password: string
+ recaptcha: string | null
}
export type ImportMapInfo = {
- title: string;
- description?: string;
- contentType?: string;
- content?: ArrayBuffer | null | string;
+ title: string
+ description?: string
+ contentType?: string
+ content?: ArrayBuffer | null | string
}
export type Label = {
- id: number;
- title: string;
- color: string;
- iconName: string;
+ id: number
+ title: string
+ color: string
+ iconName: string
}
-export type Role = 'owner' | 'editor' | 'viewer';
+export type Role = 'owner' | 'editor' | 'viewer'
export type MapInfo = {
- id: number;
- starred: boolean;
- title: string;
- labels: number[];
- createdBy: string;
- creationTime: string;
- lastModificationBy: string;
- lastModificationTime: string;
- description: string;
- isPublic: boolean;
- role: Role;
+ id: number
+ starred: boolean
+ title: string
+ labels: number[]
+ createdBy: string
+ creationTime: string
+ lastModificationBy: string
+ lastModificationTime: string
+ description: string
+ isPublic: boolean
+ role: Role
}
export type ChangeHistory = {
- id: number;
- lastModificationBy: string;
- lastModificationTime: string;
+ id: number
+ lastModificationBy: string
+ lastModificationTime: string
}
export type BasicMapInfo = {
- title: string;
- description?: string;
+ title: string
+ description?: string
}
export type FieldError = {
- id: string,
+ id: string
msg: string
}
export type ErrorInfo = {
- msg?: string;
- fields?: Map;
+ msg?: string
+ fields?: Map
}
export type AccountInfo = {
- firstname: string;
- lastname: string;
- email: string;
- locale: Locale;
+ firstname: string
+ lastname: string
+ email: string
+ locale: Locale
}
export type Permission = {
- name?: string;
- email: string;
- role: Role;
+ name?: string
+ email: string
+ role: Role
}
interface Client {
deleteAccount(): Promise
importMap(model: ImportMapInfo): Promise
- createMap(map: BasicMapInfo): Promise;
- deleteMaps(ids: number[]): Promise;
- deleteMap(id: number): Promise;
- renameMap(id: number, basicInfo: BasicMapInfo): Promise;
- fetchAllMaps(): Promise;
+ createMap(map: BasicMapInfo): Promise
+ deleteMaps(ids: number[]): Promise
+ deleteMap(id: number): Promise
+ renameMap(id: number, basicInfo: BasicMapInfo): Promise
+ fetchAllMaps(): Promise
- fetchMapPermissions(id: number): Promise;
- addMapPermissions(id: number, message: string, permissions: Permission[]): Promise;
- deleteMapPermission(id: number, email: string): Promise;
+ fetchMapPermissions(id: number): Promise
+ addMapPermissions(id: number, message: string, permissions: Permission[]): Promise
+ deleteMapPermission(id: number, email: string): Promise
- duplicateMap(id: number, basicInfo: BasicMapInfo): Promise;
+ duplicateMap(id: number, basicInfo: BasicMapInfo): Promise
- updateAccountLanguage(locale: LocaleCode): Promise;
- updateAccountPassword(pasword: string): Promise;
- updateAccountInfo(firstname: string, lastname: string): Promise;
+ updateAccountLanguage(locale: LocaleCode): Promise
+ updateAccountPassword(pasword: string): Promise
+ updateAccountInfo(firstname: string, lastname: string): Promise
- updateStarred(id: number, starred: boolean): Promise;
- updateMapToPublic(id: number, starred: boolean): Promise;
+ updateStarred(id: number, starred: boolean): Promise
+ updateMapToPublic(id: number, starred: boolean): Promise
- fetchLabels(): Promise