diff --git a/.prettierrc.json b/.prettierrc.json
index 932ed3ef..0c45137e 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -1,7 +1,7 @@
{
"trailingComma": "es5",
"tabWidth": 4,
- "semi": false,
+ "semi": true,
"singleQuote": true,
"printWidth": 100
}
diff --git a/packages/editor/src/components/canvas/index.tsx b/packages/editor/src/components/canvas/index.tsx
index dbc87f1f..eeb2d746 100644
--- a/packages/editor/src/components/canvas/index.tsx
+++ b/packages/editor/src/components/canvas/index.tsx
@@ -1,6 +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 8f35d710..7cc7eb85 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 b42ffdca..d654d237 100644
--- a/packages/editor/src/components/footer/index.tsx
+++ b/packages/editor/src/components/footer/index.tsx
@@ -1,6 +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 e9d95535..b731d333 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;
-`
+`;
diff --git a/packages/editor/src/components/frame/index.tsx b/packages/editor/src/components/frame/index.tsx
index 31f88de4..b809c9db 100644
--- a/packages/editor/src/components/frame/index.tsx
+++ b/packages/editor/src/components/frame/index.tsx
@@ -1,8 +1,8 @@
-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 => (
@@ -10,6 +10,6 @@ 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 d892f457..41bb56ec 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;
-`
+`;
diff --git a/packages/editor/src/components/top-bar/index.tsx b/packages/editor/src/components/top-bar/index.tsx
index 09f3f28c..dca249aa 100644
--- a/packages/editor/src/components/top-bar/index.tsx
+++ b/packages/editor/src/components/top-bar/index.tsx
@@ -1,6 +1,6 @@
-import React from 'react'
-import { StyledTopBar } from './styled'
+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 aed29805..a107695a 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;
-`
+`;
diff --git a/packages/editor/src/index.tsx b/packages/editor/src/index.tsx
index 2a51ac6a..5b7b798e 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 99fcd521..38464207 100644
--- a/packages/editor/src/size.ts
+++ b/packages/editor/src/size.ts
@@ -1,9 +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 8a9d518a..9b59b244 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')
- })
+ cy.visit('http://localhost:3000/c/maps');
+ });
it('should load the maps page', () => {
- MapsPage.isLoaded()
- })
+ MapsPage.isLoaded();
+ });
it('should open the create dialog', () => {
- MapsPage.create()
- MapsPage.isCreateDialogVisible()
- })
-})
+ MapsPage.create();
+ MapsPage.isCreateDialogVisible();
+ });
+});
diff --git a/packages/webapp/cypress/pageObject/MapsPage.ts b/packages/webapp/cypress/pageObject/MapsPage.ts
index 73e877eb..4eb598ea 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')
+ return cy.findByTestId('create');
}
static create() {
- return cy.findByTestId('create').click()
+ 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')
+ return cy.findAllByText('Create a new mindmap');
}
}
diff --git a/packages/webapp/cypress/plugins/index.ts b/packages/webapp/cypress/plugins/index.ts
index ab93c3fe..ba628097 100644
--- a/packages/webapp/cypress/plugins/index.ts
+++ b/packages/webapp/cypress/plugins/index.ts
@@ -4,4 +4,4 @@
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
-}
+};
diff --git a/packages/webapp/cypress/support/commands.ts b/packages/webapp/cypress/support/commands.ts
index 5aed0db5..b634ea9b 100644
--- a/packages/webapp/cypress/support/commands.ts
+++ b/packages/webapp/cypress/support/commands.ts
@@ -1 +1 @@
-import '@testing-library/cypress/add-commands'
+import '@testing-library/cypress/add-commands';
diff --git a/packages/webapp/cypress/support/index.ts b/packages/webapp/cypress/support/index.ts
index 43c03b75..1221b17e 100644
--- a/packages/webapp/cypress/support/index.ts
+++ b/packages/webapp/cypress/support/index.ts
@@ -1 +1 @@
-import './commands'
+import './commands';
diff --git a/packages/webapp/src/@types/index.d.ts b/packages/webapp/src/@types/index.d.ts
index dbd12dc9..e238d01c 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 b44fe72c..88b73a55 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
+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
+ 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 73492f7b..1699ab7d 100644
--- a/packages/webapp/src/app.tsx
+++ b/packages/webapp/src/app.tsx
@@ -1,20 +1,20 @@
-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 { 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 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';
const queryClient = new QueryClient({
defaultOptions: {
@@ -23,11 +23,11 @@ const queryClient = new QueryClient({
staleTime: 5 * 1000 * 60, // 10 minutes
},
},
-})
+});
const App = (): ReactElement => {
- const appi18n = new AppI18n()
- const locale = appi18n.getBrowserLocale()
+ const appi18n = new AppI18n();
+ const locale = appi18n.getBrowserLocale();
return locale.message ? (
@@ -70,7 +70,7 @@ const App = (): ReactElement => {
) : (
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 dfa5ead2..fa8957a4 100644
--- a/packages/webapp/src/classes/app-i18n/index.ts
+++ b/packages/webapp/src/classes/app-i18n/index.ts
@@ -1,60 +1,60 @@
-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)
+ 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 = {
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')),
FR: new Locale('de', 'Deutsch', require('./../../compiled-lang/de.json')),
-}
+};
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}`
+ 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 bc0ffc2e..cbe48f8c 100644
--- a/packages/webapp/src/classes/client/client-health-sentinel/index.tsx
+++ b/packages/webapp/src/classes/client/client-health-sentinel/index.tsx
@@ -1,21 +1,21 @@
-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 (
@@ -50,6 +50,6 @@ const ClientHealthSentinel = (): React.ReactElement => {
- )
-}
-export default ClientHealthSentinel
+ );
+};
+export default ClientHealthSentinel;
diff --git a/packages/webapp/src/classes/client/index.ts b/packages/webapp/src/classes/client/index.ts
index 4633e3fd..a683fbd4 100644
--- a/packages/webapp/src/classes/client/index.ts
+++ b/packages/webapp/src/classes/client/index.ts
@@ -1,108 +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
- msg: 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
+ 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;
- 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