From b4745299669dd53c9b20cf74c7e0e2b02c314e01 Mon Sep 17 00:00:00 2001
From: Juan Allo Ron <2070972+juanallo@users.noreply.github.com>
Date: Mon, 22 Feb 2021 22:16:10 -0800
Subject: [PATCH 1/5] adding basic config for prettier
---
.eslintrc.json | 1 +
.prettierignore | 6 +
.prettierrc.json | 7 ++
package.json | 9 +-
packages/editor/package.json | 2 +
packages/webapp/package.json | 2 +
yarn.lock | 217 ++++++++++++++++++++++++++++++++++-
7 files changed, 237 insertions(+), 7 deletions(-)
create mode 100644 .prettierignore
create mode 100644 .prettierrc.json
diff --git a/.eslintrc.json b/.eslintrc.json
index a72b93b9..01ee5e2a 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -5,6 +5,7 @@
},
"extends": [
"eslint:recommended",
+ "prettier",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000..0e4cfbd3
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,6 @@
+node_modules
+public
+dist
+lang
+coverage
+*.json
diff --git a/.prettierrc.json b/.prettierrc.json
new file mode 100644
index 00000000..932ed3ef
--- /dev/null
+++ b/.prettierrc.json
@@ -0,0 +1,7 @@
+{
+ "trailingComma": "es5",
+ "tabWidth": 4,
+ "semi": false,
+ "singleQuote": true,
+ "printWidth": 100
+}
diff --git a/package.json b/package.json
index e3c283ae..e1715b94 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,8 @@
},
"private": true,
"devDependencies": {
- "lerna": "^3.16.4"
+ "lerna": "^3.16.4",
+ "prettier": "^2.2.1"
},
"workspaces": [
"packages/*"
@@ -37,5 +38,9 @@
]
},
"homepage": "http://localhost:8080/react",
- "license": "https://wisemapping.atlassian.net/wiki/spaces/WS/pages/524357/WiseMapping+Public+License+Version+1.0+WPL"
+ "license": "https://wisemapping.atlassian.net/wiki/spaces/WS/pages/524357/WiseMapping+Public+License+Version+1.0+WPL",
+ "dependencies": {
+ "husky": "^5.1.1",
+ "lint-staged": "^10.5.4"
+ }
}
diff --git a/packages/editor/package.json b/packages/editor/package.json
index bed76ce5..463b4523 100644
--- a/packages/editor/package.json
+++ b/packages/editor/package.json
@@ -15,8 +15,10 @@
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"eslint": "^7.14.0",
+ "eslint-config-prettier": "^8.0.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
+ "prettier": "^2.2.1",
"ts-loader": "^8.0.11",
"ts-node": "^9.0.0",
"typescript": "^4.1.2"
diff --git a/packages/webapp/package.json b/packages/webapp/package.json
index b02fc7fa..ade50ce9 100644
--- a/packages/webapp/package.json
+++ b/packages/webapp/package.json
@@ -29,11 +29,13 @@
"css-loader": "^5.0.1",
"cypress": "^6.5.0",
"eslint": "^7.14.0",
+ "eslint-config-prettier": "^8.0.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"file-loader": "^6.2.0",
"html-webpack-dynamic-env-plugin": "^0.0.2",
"html-webpack-plugin": "^5.1.0",
+ "prettier": "^2.2.1",
"sass-loader": "^10.1.0",
"style-loader": "^2.0.0",
"ts-loader": "^8.0.11",
diff --git a/yarn.lock b/yarn.lock
index be93e8ff..0b3294c3 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1353,6 +1353,11 @@
version "2.4.0"
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
+"@types/parse-json@^4.0.0":
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
+ integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==
+
"@types/prop-types@*":
version "15.7.3"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
@@ -1747,6 +1752,14 @@ agentkeepalive@^3.4.1:
dependencies:
humanize-ms "^1.2.1"
+aggregate-error@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a"
+ integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==
+ dependencies:
+ clean-stack "^2.0.0"
+ indent-string "^4.0.0"
+
ajv-errors@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d"
@@ -1785,6 +1798,13 @@ ansi-escapes@^3.0.0, ansi-escapes@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b"
+ansi-escapes@^4.3.0:
+ version "4.3.1"
+ resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61"
+ integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==
+ dependencies:
+ type-fest "^0.11.0"
+
ansi-html@0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e"
@@ -2465,6 +2485,11 @@ clean-css@^4.2.3:
dependencies:
source-map "~0.6.0"
+clean-stack@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
+ integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==
+
clean-webpack-plugin@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-3.0.0.tgz#a99d8ec34c1c628a4541567aa7b457446460c62b"
@@ -2485,6 +2510,13 @@ cli-cursor@^2.0.0, cli-cursor@^2.1.0:
dependencies:
restore-cursor "^2.0.0"
+cli-cursor@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307"
+ integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==
+ dependencies:
+ restore-cursor "^3.1.0"
+
cli-table3@~0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.0.tgz#b7b1bc65ca8e7b5cef9124e13dc2b21e2ce4faee"
@@ -2503,6 +2535,14 @@ cli-truncate@^0.2.1:
slice-ansi "0.0.4"
string-width "^1.0.1"
+cli-truncate@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7"
+ integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==
+ dependencies:
+ slice-ansi "^3.0.0"
+ string-width "^4.2.0"
+
cli-width@^2.0.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
@@ -2829,6 +2869,17 @@ cosmiconfig@^5.1.0:
js-yaml "^3.13.1"
parse-json "^4.0.0"
+cosmiconfig@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3"
+ integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==
+ dependencies:
+ "@types/parse-json" "^4.0.0"
+ import-fresh "^3.2.1"
+ parse-json "^5.0.0"
+ path-type "^4.0.0"
+ yaml "^1.10.0"
+
create-require@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
@@ -3019,7 +3070,7 @@ debug@3.1.0:
dependencies:
ms "2.0.0"
-debug@4.3.1, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
+debug@4.3.1, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0:
version "4.3.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==
@@ -3479,6 +3530,11 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
+eslint-config-prettier@^8.0.0:
+ version "8.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.0.0.tgz#024d661444319686c588c8849c8da33815dbdb1c"
+ integrity sha512-5EaAVPsIHu+grmm5WKjxUia4yHgRrbkd8I0ffqUSwixCPMVBrbS97UnzlEY/Q7OWo584vgixefM0kJnUfo/VjA==
+
eslint-plugin-react-hooks@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556"
@@ -3670,7 +3726,7 @@ execa@^1.0.0:
signal-exit "^3.0.0"
strip-eof "^1.0.0"
-execa@^4.0.2:
+execa@^4.0.2, execa@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a"
integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==
@@ -3893,6 +3949,13 @@ figures@^2.0.0:
dependencies:
escape-string-regexp "^1.0.5"
+figures@^3.2.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af"
+ integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==
+ dependencies:
+ escape-string-regexp "^1.0.5"
+
file-entry-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.0.tgz#7921a89c391c6d93efec2169ac6bf300c527ea0a"
@@ -4129,6 +4192,11 @@ get-intrinsic@^1.0.1, get-intrinsic@^1.0.2, get-intrinsic@^1.1.0:
has "^1.0.3"
has-symbols "^1.0.1"
+get-own-enumerable-property-symbols@^3.0.0:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664"
+ integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==
+
get-pkg-repo@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d"
@@ -4600,6 +4668,11 @@ humanize-ms@^1.2.1:
dependencies:
ms "^2.0.0"
+husky@^5.1.1:
+ version "5.1.1"
+ resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.1.tgz#8678953fd8deb86f387cbf1ad50bb2f7f96e83f2"
+ integrity sha512-80LZ736V0Nr4/st0c2COYaMbEQhHNmAbLMN8J/kLk7/mo0QdUkUGNDjv/7jVkhug377Wh8wfbWyaVXEJ/h2B/Q==
+
hyphenate-style-name@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz#691879af8e220aea5750e8827db4ef62a54e361d"
@@ -4994,7 +5067,7 @@ is-number@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
-is-obj@^1.0.0:
+is-obj@^1.0.0, is-obj@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f"
@@ -5056,6 +5129,11 @@ is-regex@^1.0.4, is-regex@^1.1.1:
call-bind "^1.0.2"
has-symbols "^1.0.1"
+is-regexp@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069"
+ integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk=
+
is-ssh@^1.3.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.2.tgz#a4b82ab63d73976fd8263cceee27f99a88bdae2b"
@@ -5384,6 +5462,27 @@ lines-and-columns@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00"
+lint-staged@^10.5.4:
+ version "10.5.4"
+ resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.5.4.tgz#cd153b5f0987d2371fc1d2847a409a2fe705b665"
+ integrity sha512-EechC3DdFic/TdOPgj/RB3FicqE6932LTHCUm0Y2fsD9KGlLB+RwJl2q1IYBIvEsKzDOgn0D4gll+YxG5RsrKg==
+ dependencies:
+ chalk "^4.1.0"
+ cli-truncate "^2.1.0"
+ commander "^6.2.0"
+ cosmiconfig "^7.0.0"
+ debug "^4.2.0"
+ dedent "^0.7.0"
+ enquirer "^2.3.6"
+ execa "^4.1.0"
+ listr2 "^3.2.2"
+ log-symbols "^4.0.0"
+ micromatch "^4.0.2"
+ normalize-path "^3.0.0"
+ please-upgrade-node "^3.2.0"
+ string-argv "0.3.1"
+ stringify-object "^3.3.0"
+
listr-silent-renderer@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e"
@@ -5413,6 +5512,21 @@ listr-verbose-renderer@^0.5.0:
date-fns "^1.27.2"
figures "^2.0.0"
+listr2@^3.2.2:
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.3.2.tgz#e9dc899ba5997f365d25349d62b586f01257be5b"
+ integrity sha512-mGwDWg5Zq2m96Ern+RFTgzh6otSfLtHqhWKhoNvCErr46komaWAs1G8K6Th4VENps3cKySKGJXL1yAiCjmt5IQ==
+ dependencies:
+ chalk "^4.1.0"
+ cli-truncate "^2.1.0"
+ figures "^3.2.0"
+ indent-string "^4.0.0"
+ log-update "^4.0.0"
+ p-map "^4.0.0"
+ rxjs "^6.6.3"
+ through "^2.3.8"
+ wrap-ansi "^7.0.0"
+
listr@^0.14.3:
version "0.14.3"
resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586"
@@ -5574,6 +5688,16 @@ log-update@^2.3.0:
cli-cursor "^2.0.0"
wrap-ansi "^3.0.1"
+log-update@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1"
+ integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==
+ dependencies:
+ ansi-escapes "^4.3.0"
+ cli-cursor "^3.1.0"
+ slice-ansi "^4.0.0"
+ wrap-ansi "^6.2.0"
+
loglevel@^1.6.8:
version "1.7.1"
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197"
@@ -6467,6 +6591,13 @@ p-map@^2.0.0, p-map@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175"
+p-map@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b"
+ integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==
+ dependencies:
+ aggregate-error "^3.0.0"
+
p-pipe@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-1.2.0.tgz#4b1a11399a11520a67790ee5a0c1d5881d6befe9"
@@ -6711,6 +6842,13 @@ pkg-dir@^4.2.0:
dependencies:
find-up "^4.0.0"
+please-upgrade-node@^3.2.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942"
+ integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==
+ dependencies:
+ semver-compare "^1.0.0"
+
popper.js@1.16.1-lts:
version "1.16.1-lts"
resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1-lts.tgz#cf6847b807da3799d80ee3d6d2f90df8a3f50b05"
@@ -6847,6 +6985,11 @@ prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
+prettier@^2.2.1:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
+ integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
+
pretty-bytes@^5.4.1:
version "5.5.0"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.5.0.tgz#0cecda50a74a941589498011cf23275aa82b339e"
@@ -7472,6 +7615,14 @@ restore-cursor@^2.0.0:
onetime "^2.0.0"
signal-exit "^3.0.2"
+restore-cursor@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e"
+ integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==
+ dependencies:
+ onetime "^5.1.0"
+ signal-exit "^3.0.2"
+
ret@~0.1.10:
version "0.1.15"
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
@@ -7583,6 +7734,11 @@ selfsigned@^1.10.8:
dependencies:
node-forge "^0.10.0"
+semver-compare@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
+ integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
+
"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
@@ -7742,6 +7898,15 @@ slice-ansi@0.0.4:
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"
integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=
+slice-ansi@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787"
+ integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==
+ dependencies:
+ ansi-styles "^4.0.0"
+ astral-regex "^2.0.0"
+ is-fullwidth-code-point "^3.0.0"
+
slice-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b"
@@ -8017,6 +8182,11 @@ strict-uri-encode@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546"
+string-argv@0.3.1:
+ version "0.3.1"
+ resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da"
+ integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==
+
string-hash@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b"
@@ -8044,7 +8214,7 @@ string-width@^3.0.0, string-width@^3.1.0:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^5.1.0"
-string-width@^4.2.0:
+string-width@^4.1.0, string-width@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5"
dependencies:
@@ -8090,6 +8260,15 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"
+stringify-object@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629"
+ integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==
+ dependencies:
+ get-own-enumerable-property-symbols "^3.0.0"
+ is-obj "^1.0.1"
+ is-regexp "^1.0.0"
+
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
@@ -8348,7 +8527,7 @@ through2@^4.0.0:
dependencies:
readable-stream "3"
-through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@~2.3, through@~2.3.1:
+through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8, through@~2.3, through@~2.3.1:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
@@ -8497,6 +8676,11 @@ type-check@^0.4.0, type-check@~0.4.0:
dependencies:
prelude-ls "^1.2.1"
+type-fest@^0.11.0:
+ version "0.11.0"
+ resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1"
+ integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==
+
type-fest@^0.18.0:
version "0.18.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f"
@@ -8945,6 +9129,24 @@ wrap-ansi@^5.1.0:
string-width "^3.0.0"
strip-ansi "^5.0.0"
+wrap-ansi@^6.2.0:
+ version "6.2.0"
+ resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53"
+ integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==
+ dependencies:
+ ansi-styles "^4.0.0"
+ string-width "^4.1.0"
+ strip-ansi "^6.0.0"
+
+wrap-ansi@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
+ integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
+ dependencies:
+ ansi-styles "^4.0.0"
+ string-width "^4.1.0"
+ strip-ansi "^6.0.0"
+
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
@@ -9012,6 +9214,11 @@ yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
+yaml@^1.10.0:
+ version "1.10.0"
+ resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e"
+ integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==
+
yargs-parser@^13.1.2:
version "13.1.2"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38"
From 46119e848cd63e4638d45ff5a03f65ad9c9da9ee Mon Sep 17 00:00:00 2001
From: Juan Allo Ron <2070972+juanallo@users.noreply.github.com>
Date: Mon, 22 Feb 2021 22:27:19 -0800
Subject: [PATCH 2/5] adding pre-commit hook to prettier
---
package.json | 14 ++++++++---
yarn.lock | 70 +++++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 77 insertions(+), 7 deletions(-)
diff --git a/package.json b/package.json
index e1715b94..b7f69627 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,9 @@
},
"private": true,
"devDependencies": {
+ "husky": "4",
"lerna": "^3.16.4",
+ "lint-staged": "^10.5.4",
"prettier": "^2.2.1"
},
"workspaces": [
@@ -39,8 +41,14 @@
},
"homepage": "http://localhost:8080/react",
"license": "https://wisemapping.atlassian.net/wiki/spaces/WS/pages/524357/WiseMapping+Public+License+Version+1.0+WPL",
- "dependencies": {
- "husky": "^5.1.1",
- "lint-staged": "^10.5.4"
+ "husky": {
+ "hooks": {
+ "pre-commit": "lint-staged"
+ }
+ },
+ "lint-staged": {
+ "**/*.{ts,tsx}": [
+ "prettier --write"
+ ]
}
}
diff --git a/yarn.lock b/yarn.lock
index 0b3294c3..e2d487dc 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2657,6 +2657,11 @@ compare-func@^2.0.0:
array-ify "^1.0.0"
dot-prop "^5.1.0"
+compare-versions@^3.6.0:
+ version "3.6.0"
+ resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62"
+ integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==
+
component-emitter@^1.2.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
@@ -4030,6 +4035,21 @@ find-up@^4.0.0, find-up@^4.1.0:
locate-path "^5.0.0"
path-exists "^4.0.0"
+find-up@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
+ integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
+ dependencies:
+ locate-path "^6.0.0"
+ path-exists "^4.0.0"
+
+find-versions@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-4.0.0.tgz#3c57e573bf97769b8cb8df16934b627915da4965"
+ integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==
+ dependencies:
+ semver-regex "^3.1.2"
+
flat-cache@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
@@ -4668,10 +4688,21 @@ humanize-ms@^1.2.1:
dependencies:
ms "^2.0.0"
-husky@^5.1.1:
- version "5.1.1"
- resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.1.tgz#8678953fd8deb86f387cbf1ad50bb2f7f96e83f2"
- integrity sha512-80LZ736V0Nr4/st0c2COYaMbEQhHNmAbLMN8J/kLk7/mo0QdUkUGNDjv/7jVkhug377Wh8wfbWyaVXEJ/h2B/Q==
+husky@4:
+ version "4.3.8"
+ resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d"
+ integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==
+ dependencies:
+ chalk "^4.0.0"
+ ci-info "^2.0.0"
+ compare-versions "^3.6.0"
+ cosmiconfig "^7.0.0"
+ find-versions "^4.0.0"
+ opencollective-postinstall "^2.0.2"
+ pkg-dir "^5.0.0"
+ please-upgrade-node "^3.2.0"
+ slash "^3.0.0"
+ which-pm-runs "^1.0.0"
hyphenate-style-name@^1.0.3:
version "1.0.4"
@@ -5611,6 +5642,13 @@ locate-path@^5.0.0:
dependencies:
p-locate "^4.1.0"
+locate-path@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
+ integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
+ dependencies:
+ p-locate "^5.0.0"
+
lodash._reinterpolate@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
@@ -6482,6 +6520,11 @@ onetime@^5.1.0, onetime@^5.1.2:
dependencies:
mimic-fn "^2.1.0"
+opencollective-postinstall@^2.0.2:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
+ integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==
+
opener@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598"
@@ -6581,6 +6624,13 @@ p-locate@^4.1.0:
dependencies:
p-limit "^2.2.0"
+p-locate@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
+ integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
+ dependencies:
+ p-limit "^3.0.2"
+
p-map-series@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/p-map-series/-/p-map-series-1.0.0.tgz#bf98fe575705658a9e1351befb85ae4c1f07bdca"
@@ -6842,6 +6892,13 @@ pkg-dir@^4.2.0:
dependencies:
find-up "^4.0.0"
+pkg-dir@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760"
+ integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==
+ dependencies:
+ find-up "^5.0.0"
+
please-upgrade-node@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942"
@@ -7739,6 +7796,11 @@ semver-compare@^1.0.0:
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
+semver-regex@^3.1.2:
+ version "3.1.2"
+ resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807"
+ integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA==
+
"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
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 3/5] 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