From 837709cab61461c8c5a4be7fd14cdd0ec43e9545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 22 Jan 2021 10:24:43 +0100 Subject: [PATCH 01/15] adds dummy errorStore to client lib --- .../client/src/components/ClientApp.svelte | 3 +- .../client/src/components/Component.svelte | 1 + packages/client/src/sdk.js | 3 +- packages/client/src/store/error.js | 3 + packages/client/src/store/index.js | 1 + packages/server/yarn.lock | 231 +----------------- packages/standard-components/yarn.lock | 5 - 7 files changed, 12 insertions(+), 235 deletions(-) create mode 100644 packages/client/src/store/error.js diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 222344420e..42946c809d 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -3,12 +3,13 @@ import { setContext, onMount } from "svelte" import Component from "./Component.svelte" import SDK from "../sdk" - import { createDataStore, initialise, screenStore } from "../store" + import { createDataStore, initialise, screenStore, errorStore } from "../store" // Provide contexts setContext("sdk", SDK) setContext("component", writable({})) setContext("data", createDataStore()) + setContext("error", errorStore) setContext("screenslot", false) let loaded = false diff --git a/packages/client/src/components/Component.svelte b/packages/client/src/components/Component.svelte index 7361573efd..50aeed5346 100644 --- a/packages/client/src/components/Component.svelte +++ b/packages/client/src/components/Component.svelte @@ -10,6 +10,7 @@ // Get contexts const dataContext = getContext("data") + const errorContext = getContext("error") const screenslotContext = getContext("screenslot") // Create component context diff --git a/packages/client/src/sdk.js b/packages/client/src/sdk.js index ba7a3d3a9e..0eb27e532b 100644 --- a/packages/client/src/sdk.js +++ b/packages/client/src/sdk.js @@ -1,5 +1,5 @@ import * as API from "./api" -import { authStore, routeStore, screenStore, bindingStore } from "./store" +import { authStore, errorStore, routeStore, screenStore, bindingStore } from "./store" import { styleable } from "./utils/styleable" import { linkable } from "./utils/linkable" import DataProvider from "./components/DataProvider.svelte" @@ -7,6 +7,7 @@ import DataProvider from "./components/DataProvider.svelte" export default { API, authStore, + errorStore, routeStore, screenStore, styleable, diff --git a/packages/client/src/store/error.js b/packages/client/src/store/error.js new file mode 100644 index 0000000000..01c819d2d2 --- /dev/null +++ b/packages/client/src/store/error.js @@ -0,0 +1,3 @@ +import { writable } from "svelte/store" + +export const errorStore = writable('') diff --git a/packages/client/src/store/index.js b/packages/client/src/store/index.js index 2a3edb6d01..a9265acb5c 100644 --- a/packages/client/src/store/index.js +++ b/packages/client/src/store/index.js @@ -1,4 +1,5 @@ export { authStore } from "./auth" +export { errorStore } from "./error" export { routeStore } from "./routes" export { screenStore } from "./screens" export { builderStore } from "./builder" diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 9547ac0e87..7afc56f29d 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -228,16 +228,6 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" -"@budibase/client@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@budibase/client/-/client-0.4.3.tgz#eaf1ac83ed04722c29ea51907ac7c2190bd09b74" - integrity sha512-gfVIU7P1HCMuH9rgmqgv2pD5oFDwwuX0QF3+FXuKR3/Cr6JW+bstVsNZHGgwOrmbxT3oAxfeNX186zrQupJ42w== - dependencies: - deep-equal "^2.0.1" - mustache "^4.0.1" - regexparam "^1.3.0" - svelte-spa-router "^3.0.5" - "@cnakazawa/watch@^1.0.3": version "1.0.4" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" @@ -1337,11 +1327,6 @@ array-equal@^1.0.0: resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= -array-filter@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" - integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM= - array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" @@ -1419,13 +1404,6 @@ atomic-sleep@^1.0.0: resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== -available-typed-arrays@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz#6b098ca9d8039079ee3f77f7b783c4480ba513f5" - integrity sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ== - dependencies: - array-filter "^1.0.0" - aws-sdk@^2.767.0: version "2.771.0" resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.771.0.tgz#ff4beb0a04d6ab1ae962c85dfb42e3e9bfe2b93b" @@ -1818,14 +1796,6 @@ cacheable-request@^6.0.0: normalize-url "^4.1.0" responselike "^1.0.2" -call-bind@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.0.tgz#24127054bb3f9bdcb4b1fb82418186072f77b8ce" - integrity sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.0" - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -2336,27 +2306,6 @@ decompress@^4.2.1: pify "^2.3.0" strip-dirs "^2.0.0" -deep-equal@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.0.5.tgz#55cd2fe326d83f9cbf7261ef0e060b3f724c5cb9" - integrity sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw== - dependencies: - call-bind "^1.0.0" - es-get-iterator "^1.1.1" - get-intrinsic "^1.0.1" - is-arguments "^1.0.4" - is-date-object "^1.0.2" - is-regex "^1.1.1" - isarray "^2.0.5" - object-is "^1.1.4" - object-keys "^1.1.1" - object.assign "^4.1.2" - regexp.prototype.flags "^1.3.0" - side-channel "^1.0.3" - which-boxed-primitive "^1.0.1" - which-collection "^1.0.1" - which-typed-array "^1.1.2" - deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -2760,7 +2709,7 @@ es-abstract@^1.17.0-next.1, es-abstract@^1.17.2, es-abstract@^1.17.5: string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" -es-abstract@^1.18.0-next.0, es-abstract@^1.18.0-next.1: +es-abstract@^1.18.0-next.0: version "1.18.0-next.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== @@ -2778,20 +2727,6 @@ es-abstract@^1.18.0-next.0, es-abstract@^1.18.0-next.1: string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" -es-get-iterator@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.1.tgz#b93ddd867af16d5118e00881396533c1c6647ad9" - integrity sha512-qorBw8Y7B15DVLaJWy6WdEV/ZkieBcu6QCq/xzWzGOKJqgG1j754vXRfZ3NY7HSShneqU43mPB4OkQBTkvHhFw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.1" - has-symbols "^1.0.1" - is-arguments "^1.0.4" - is-map "^2.0.1" - is-set "^2.0.1" - is-string "^1.0.5" - isarray "^2.0.5" - es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" @@ -3469,15 +3404,6 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.0, get-intrinsic@^1.0.1, get-intrinsic@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49" - integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - get-stream@3.0.0, get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -4014,23 +3940,11 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-arguments@^1.0.4: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" - integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== - dependencies: - call-bind "^1.0.0" - is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= -is-bigint@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.1.tgz#6923051dfcbc764278540b9ce0e6b3213aa5ebc2" - integrity sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg== - is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -4038,13 +3952,6 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-boolean-object@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.0.tgz#e2aaad3a3a8fca34c28f6eee135b156ed2587ff0" - integrity sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA== - dependencies: - call-bind "^1.0.0" - is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -4081,7 +3988,7 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-date-object@^1.0.1, is-date-object@^1.0.2: +is-date-object@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== @@ -4166,11 +4073,6 @@ is-installed-globally@^0.3.1: global-dirs "^2.0.1" is-path-inside "^3.0.1" -is-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" - integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== - is-natural-number@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" @@ -4186,11 +4088,6 @@ is-npm@^4.0.0: resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== -is-number-object@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" - integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== - is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -4242,22 +4139,12 @@ is-retry-allowed@^1.1.0: resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== -is-set@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" - integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== - is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= -is-string@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" - integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== - -is-symbol@^1.0.2, is-symbol@^1.0.3: +is-symbol@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== @@ -4273,17 +4160,6 @@ is-type-of@^1.0.0: is-class-hotfix "~0.0.6" isstream "~0.1.2" -is-typed-array@^1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.4.tgz#1f66f34a283a3c94a4335434661ca53fff801120" - integrity sha512-ILaRgn4zaSrVNXNGtON6iFNotXW3hAPF3+0fB1usg2jFlWqo5fEDdmJkz0zBfoi7Dgskr8Khi2xZ8cXqZEfXNA== - dependencies: - available-typed-arrays "^1.0.2" - call-bind "^1.0.0" - es-abstract "^1.18.0-next.1" - foreach "^2.0.5" - has-symbols "^1.0.1" - is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -4294,16 +4170,6 @@ is-utf8@^0.2.0: resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= -is-weakmap@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" - integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== - -is-weakset@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.1.tgz#e9a0af88dbd751589f5e50d80f4c98b780884f83" - integrity sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw== - is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -4336,11 +4202,6 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= -isarray@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" - integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== - isbinaryfile@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.6.tgz#edcb62b224e2b4710830b67498c8e4e5a4d2610b" @@ -5916,19 +5777,6 @@ object-inspect@^1.8.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== -object-inspect@^1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" - integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== - -object-is@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.4.tgz#63d6c83c00a43f4cbc9434eb9757c8a5b8565068" - integrity sha512-1ZvAZ4wlF7IyPVOcE1Omikt7UpaFlOQq0HlSti+ZvDH3UiD2brwGMwDbyV43jao2bKJ+4+WdPJHSd7kgzKYVqg== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" @@ -5951,16 +5799,6 @@ object.assign@^4.1.1: has-symbols "^1.0.1" object-keys "^1.1.1" -object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" - object-keys "^1.1.1" - object.getownpropertydescriptors@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" @@ -6894,19 +6732,6 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp.prototype.flags@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" - integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - -regexparam@1.3.0, regexparam@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-1.3.0.tgz#2fe42c93e32a40eff6235d635e0ffa344b92965f" - integrity sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g== - regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" @@ -7291,15 +7116,6 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -side-channel@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" @@ -7745,13 +7561,6 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -svelte-spa-router@^3.0.5: - version "3.1.0" - resolved "https://registry.yarnpkg.com/svelte-spa-router/-/svelte-spa-router-3.1.0.tgz#a929f0def7e12c41f32bc356f91685aeadcd75bf" - integrity sha512-jlM/xwjn57mylr+pzHYCOOy+IPQauT46gOucNGTBu6jHcFXu3F+oaojN4PXC1LYizRGxFB6QA0qnYbZnRfX7Sg== - dependencies: - regexparam "1.3.0" - svelte@^3.30.0: version "3.31.2" resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.31.2.tgz#d2ddf6cacbb95e4cc3796207510b660a25586324" @@ -8368,45 +8177,11 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" -which-boxed-primitive@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -which-collection@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906" - integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== - dependencies: - is-map "^2.0.1" - is-set "^2.0.1" - is-weakmap "^2.0.1" - is-weakset "^2.0.1" - which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which-typed-array@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.4.tgz#8fcb7d3ee5adf2d771066fba7cf37e32fe8711ff" - integrity sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA== - dependencies: - available-typed-arrays "^1.0.2" - call-bind "^1.0.0" - es-abstract "^1.18.0-next.1" - foreach "^2.0.5" - function-bind "^1.1.1" - has-symbols "^1.0.1" - is-typed-array "^1.1.3" - which@^1.2.9, which@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" diff --git a/packages/standard-components/yarn.lock b/packages/standard-components/yarn.lock index 2a4358a78a..682c048276 100644 --- a/packages/standard-components/yarn.lock +++ b/packages/standard-components/yarn.lock @@ -58,11 +58,6 @@ dependencies: ag-grid-community "^24.0.0" -"@fortawesome/fontawesome-free@^5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.14.0.tgz#a371e91029ebf265015e64f81bfbf7d228c9681f" - integrity sha512-OfdMsF+ZQgdKHP9jUbmDcRrP0eX90XXrsXIdyjLbkmSBzmMXPABB8eobUJtivaupucYaByz6WNe1PI1JuYm3qA== - "@polka/url@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@polka/url/-/url-0.5.0.tgz#b21510597fd601e5d7c95008b76bf0d254ebfd31" From 75c85978cb21c0ad9a2a0b9b6f1c1ab070433441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 22 Jan 2021 10:42:15 +0100 Subject: [PATCH 02/15] switch name --- packages/client/package.json | 1 + .../client/src/components/ClientApp.svelte | 4 ++-- packages/client/src/sdk.js | 4 ++-- packages/client/src/store/error.js | 3 --- packages/client/src/store/index.js | 2 +- packages/client/src/store/notifier.js | 23 +++++++++++++++++++ packages/client/yarn.lock | 12 ++++++++++ packages/standard-components/src/Icon.svelte | 3 +++ 8 files changed, 44 insertions(+), 8 deletions(-) delete mode 100644 packages/client/src/store/error.js create mode 100644 packages/client/src/store/notifier.js diff --git a/packages/client/package.json b/packages/client/package.json index 9a40bea639..c3d2c2f746 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -12,6 +12,7 @@ "deep-equal": "^2.0.1", "mustache": "^4.0.1", "regexparam": "^1.3.0", + "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" }, "devDependencies": { diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 42946c809d..e25f67e69e 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -3,13 +3,13 @@ import { setContext, onMount } from "svelte" import Component from "./Component.svelte" import SDK from "../sdk" - import { createDataStore, initialise, screenStore, errorStore } from "../store" + import { createDataStore, initialise, screenStore, notificationStore } from "../store" // Provide contexts setContext("sdk", SDK) setContext("component", writable({})) setContext("data", createDataStore()) - setContext("error", errorStore) + setContext("notification", notificationStore) setContext("screenslot", false) let loaded = false diff --git a/packages/client/src/sdk.js b/packages/client/src/sdk.js index 0eb27e532b..5c796db7a9 100644 --- a/packages/client/src/sdk.js +++ b/packages/client/src/sdk.js @@ -1,5 +1,5 @@ import * as API from "./api" -import { authStore, errorStore, routeStore, screenStore, bindingStore } from "./store" +import { authStore, notificationStore, routeStore, screenStore, bindingStore } from "./store" import { styleable } from "./utils/styleable" import { linkable } from "./utils/linkable" import DataProvider from "./components/DataProvider.svelte" @@ -7,7 +7,7 @@ import DataProvider from "./components/DataProvider.svelte" export default { API, authStore, - errorStore, + notificationStore, routeStore, screenStore, styleable, diff --git a/packages/client/src/store/error.js b/packages/client/src/store/error.js deleted file mode 100644 index 01c819d2d2..0000000000 --- a/packages/client/src/store/error.js +++ /dev/null @@ -1,3 +0,0 @@ -import { writable } from "svelte/store" - -export const errorStore = writable('') diff --git a/packages/client/src/store/index.js b/packages/client/src/store/index.js index a9265acb5c..324d8c23e8 100644 --- a/packages/client/src/store/index.js +++ b/packages/client/src/store/index.js @@ -1,5 +1,5 @@ export { authStore } from "./auth" -export { errorStore } from "./error" +export { notificationStore } from "./notifier" export { routeStore } from "./routes" export { screenStore } from "./screens" export { builderStore } from "./builder" diff --git a/packages/client/src/store/notifier.js b/packages/client/src/store/notifier.js new file mode 100644 index 0000000000..85e708e92a --- /dev/null +++ b/packages/client/src/store/notifier.js @@ -0,0 +1,23 @@ +import { writable } from "svelte/store" +import { generate } from "shortid" + +export const notificationStore = writable({ + notifications: [], +}) + +export function send(message, type = "default") { + notificationStore.update(state => { + state.notifications = [ + ...state.notifications, + { id: generate(), type, message }, + ] + return state + }) +} + +export const notifier = { + danger: msg => send(msg, "danger"), + warning: msg => send(msg, "warning"), + info: msg => send(msg, "info"), + success: msg => send(msg, "success"), +} diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index e90defb427..6660faa3eb 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -1367,6 +1367,11 @@ mustache@^4.0.1: resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.0.1.tgz#d99beb031701ad433338e7ea65e0489416c854a2" integrity sha512-yL5VE97+OXn4+Er3THSmTdCFCtx5hHWzrolvH+JObZnUYwuaG7XV+Ch4fR2cIrcYI0tFHxS7iyFYl14bW8y2sA== +nanoid@^2.1.0: + version "2.1.11" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280" + integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA== + nwsapi@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" @@ -1808,6 +1813,13 @@ sha.js@^2.4.0, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" +shortid@^2.2.15: + version "2.2.16" + resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.16.tgz#b742b8f0cb96406fd391c76bfc18a67a57fe5608" + integrity sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g== + dependencies: + nanoid "^2.1.0" + side-channel@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.3.tgz#cdc46b057550bbab63706210838df5d4c19519c3" diff --git a/packages/standard-components/src/Icon.svelte b/packages/standard-components/src/Icon.svelte index d175bfd6b0..4b8838d43e 100644 --- a/packages/standard-components/src/Icon.svelte +++ b/packages/standard-components/src/Icon.svelte @@ -3,6 +3,9 @@ const { styleable } = getContext("sdk") const component = getContext("component") + const notification = getContext("notification") + + console.log($notification) export let icon = "" export let size = "fa-lg" From 0c3c21361bfc13024e4f29027a05ee45754b2b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 22 Jan 2021 11:37:34 +0100 Subject: [PATCH 03/15] first pass at custom store to handle notifications --- .../Notification/NotificationDisplay.svelte | 1 - .../client/src/components/ClientApp.svelte | 4 +- .../src/components/NotificationDisplay.svelte | 71 +++++++++++++++++++ packages/client/src/store/index.js | 2 +- packages/client/src/store/notification.js | 36 ++++++++++ packages/client/src/store/notifier.js | 23 ------ packages/standard-components/src/Icon.svelte | 3 - 7 files changed, 111 insertions(+), 29 deletions(-) create mode 100644 packages/client/src/components/NotificationDisplay.svelte create mode 100644 packages/client/src/store/notification.js delete mode 100644 packages/client/src/store/notifier.js diff --git a/packages/builder/src/components/common/Notification/NotificationDisplay.svelte b/packages/builder/src/components/common/Notification/NotificationDisplay.svelte index 976059a5bf..657bc3bcdb 100644 --- a/packages/builder/src/components/common/Notification/NotificationDisplay.svelte +++ b/packages/builder/src/components/common/Notification/NotificationDisplay.svelte @@ -1,6 +1,5 @@ + +
+ {#each $notificationStore.notifications as notification (notification.id)} +
+
{notification.message}
+ {#if notification.icon}{/if} +
+ {/each} +
+ + + \ No newline at end of file diff --git a/packages/client/src/store/index.js b/packages/client/src/store/index.js index 324d8c23e8..ae1a477c8f 100644 --- a/packages/client/src/store/index.js +++ b/packages/client/src/store/index.js @@ -1,5 +1,5 @@ export { authStore } from "./auth" -export { notificationStore } from "./notifier" +export { notificationStore } from "./notification" export { routeStore } from "./routes" export { screenStore } from "./screens" export { builderStore } from "./builder" diff --git a/packages/client/src/store/notification.js b/packages/client/src/store/notification.js new file mode 100644 index 0000000000..854238fd9e --- /dev/null +++ b/packages/client/src/store/notification.js @@ -0,0 +1,36 @@ +import { writable, derived } from "svelte/store" + +let NOTIFICATION_TIMEOUT = 3000 + +export const createNotificationStore = () => { + const _notifications = writable([]) + + const send = (message, type = "default") => { + _notifications.update(state => { + state = [ + ...state, + { id: 1, type, message }, + ] + }) + } + + const notifications = derived(_notifications, ($_notifications, set) => { + const timeout = setTimeout({ + set($_notifications) + }, NOTIFICATION_TIMEOUT) + + return () => { + clearTimeout(timeout); + }; + }) + const {subscribe} = notifications + + return { + subscribe, + send, + danger: msg => send(msg, "danger"), + warning: msg => send(msg, "warning"), + info: msg => send(msg, "info"), + success: msg => send(msg, "success"), + } +} \ No newline at end of file diff --git a/packages/client/src/store/notifier.js b/packages/client/src/store/notifier.js deleted file mode 100644 index 85e708e92a..0000000000 --- a/packages/client/src/store/notifier.js +++ /dev/null @@ -1,23 +0,0 @@ -import { writable } from "svelte/store" -import { generate } from "shortid" - -export const notificationStore = writable({ - notifications: [], -}) - -export function send(message, type = "default") { - notificationStore.update(state => { - state.notifications = [ - ...state.notifications, - { id: generate(), type, message }, - ] - return state - }) -} - -export const notifier = { - danger: msg => send(msg, "danger"), - warning: msg => send(msg, "warning"), - info: msg => send(msg, "info"), - success: msg => send(msg, "success"), -} diff --git a/packages/standard-components/src/Icon.svelte b/packages/standard-components/src/Icon.svelte index 4b8838d43e..d175bfd6b0 100644 --- a/packages/standard-components/src/Icon.svelte +++ b/packages/standard-components/src/Icon.svelte @@ -3,9 +3,6 @@ const { styleable } = getContext("sdk") const component = getContext("component") - const notification = getContext("notification") - - console.log($notification) export let icon = "" export let size = "fa-lg" From 8f0405623c2fa63eec70129587e0e8642b070b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 22 Jan 2021 12:21:44 +0100 Subject: [PATCH 04/15] finishes notificationStore --- .../client/src/components/ClientApp.svelte | 6 +- .../src/components/NotificationDisplay.svelte | 71 ------------------- packages/client/src/store/notification.js | 42 +++++++---- packages/standard-components/src/Icon.svelte | 9 ++- 4 files changed, 40 insertions(+), 88 deletions(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 404a91f210..b0337bd53f 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -2,7 +2,6 @@ import { writable } from "svelte/store" import { setContext, onMount } from "svelte" import Component from "./Component.svelte" - import NotificationDisplay from './NotificationDisplay.svelte' import SDK from "../sdk" import { createDataStore, initialise, screenStore, notificationStore } from "../store" @@ -10,7 +9,7 @@ setContext("sdk", SDK) setContext("component", writable({})) setContext("data", createDataStore()) - setContext("notifier", notificationStore) + setContext("notification", notificationStore) setContext("screenslot", false) let loaded = false @@ -24,5 +23,4 @@ {#if loaded && $screenStore.activeLayout} -{/if} - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/packages/client/src/components/NotificationDisplay.svelte b/packages/client/src/components/NotificationDisplay.svelte index 9b57cc932e..e69de29bb2 100644 --- a/packages/client/src/components/NotificationDisplay.svelte +++ b/packages/client/src/components/NotificationDisplay.svelte @@ -1,71 +0,0 @@ - - -
- {#each $notificationStore.notifications as notification (notification.id)} -
-
{notification.message}
- {#if notification.icon}{/if} -
- {/each} -
- - - \ No newline at end of file diff --git a/packages/client/src/store/notification.js b/packages/client/src/store/notification.js index 854238fd9e..d6c892ecb8 100644 --- a/packages/client/src/store/notification.js +++ b/packages/client/src/store/notification.js @@ -1,29 +1,37 @@ import { writable, derived } from "svelte/store" +import { generate } from "shortid" + let NOTIFICATION_TIMEOUT = 3000 -export const createNotificationStore = () => { +const createNotificationStore = () => { const _notifications = writable([]) const send = (message, type = "default") => { _notifications.update(state => { - state = [ + return [ ...state, - { id: 1, type, message }, + { id: generate(), type, message }, ] }) } const notifications = derived(_notifications, ($_notifications, set) => { - const timeout = setTimeout({ - set($_notifications) - }, NOTIFICATION_TIMEOUT) - - return () => { - clearTimeout(timeout); - }; + set($_notifications) + if ($_notifications.length > 0) { + const timeout = setTimeout(() => { + _notifications.update(state => { + state.shift() + return state + }) + set($_notifications) + }, NOTIFICATION_TIMEOUT) + return () => { + clearTimeout(timeout); + }; + } }) - const {subscribe} = notifications + const { subscribe } = notifications return { subscribe, @@ -33,4 +41,14 @@ export const createNotificationStore = () => { info: msg => send(msg, "info"), success: msg => send(msg, "success"), } -} \ No newline at end of file +} + +export const notificationStore = createNotificationStore() + +// setTimeout(() => { +// notificationStore.update(state => { +// state.notifications.shift() +// state.notifications = state.notifications +// return state +// }) +// }, timeout) \ No newline at end of file diff --git a/packages/standard-components/src/Icon.svelte b/packages/standard-components/src/Icon.svelte index d175bfd6b0..8b5db301a6 100644 --- a/packages/standard-components/src/Icon.svelte +++ b/packages/standard-components/src/Icon.svelte @@ -3,6 +3,9 @@ const { styleable } = getContext("sdk") const component = getContext("component") + const notification = getContext("notification") + + $: console.log($notification) export let icon = "" export let size = "fa-lg" @@ -17,4 +20,8 @@ \ No newline at end of file + class="{icon} {size}" /> + + \ No newline at end of file From 36c212048e9d33a4d4e40eac08b2bbf4c366b305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 22 Jan 2021 12:31:56 +0100 Subject: [PATCH 05/15] adds notification toast capability to the client --- .../client/src/components/ClientApp.svelte | 4 +- .../src/components/NotificationDisplay.svelte | 58 +++++++++++++++++++ packages/standard-components/src/Icon.svelte | 9 +-- 3 files changed, 62 insertions(+), 9 deletions(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index b0337bd53f..ece44ab3ee 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -2,6 +2,7 @@ import { writable } from "svelte/store" import { setContext, onMount } from "svelte" import Component from "./Component.svelte" + import NotificationDisplay from './NotificationDisplay.svelte' import SDK from "../sdk" import { createDataStore, initialise, screenStore, notificationStore } from "../store" @@ -23,4 +24,5 @@ {#if loaded && $screenStore.activeLayout} -{/if} \ No newline at end of file +{/if} + \ No newline at end of file diff --git a/packages/client/src/components/NotificationDisplay.svelte b/packages/client/src/components/NotificationDisplay.svelte index e69de29bb2..2bae13bfc9 100644 --- a/packages/client/src/components/NotificationDisplay.svelte +++ b/packages/client/src/components/NotificationDisplay.svelte @@ -0,0 +1,58 @@ + + +
+ {#each $notifications as notification (notification.id)} +
+
{notification.message}
+ {#if notification.icon}{/if} +
+ {/each} +
+ + + \ No newline at end of file diff --git a/packages/standard-components/src/Icon.svelte b/packages/standard-components/src/Icon.svelte index 8b5db301a6..d175bfd6b0 100644 --- a/packages/standard-components/src/Icon.svelte +++ b/packages/standard-components/src/Icon.svelte @@ -3,9 +3,6 @@ const { styleable } = getContext("sdk") const component = getContext("component") - const notification = getContext("notification") - - $: console.log($notification) export let icon = "" export let size = "fa-lg" @@ -20,8 +17,4 @@ - - \ No newline at end of file + class="{icon} {size}" /> \ No newline at end of file From 21e46285f7bf1ae9c0cfa8efa9f110cd01132754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 22 Jan 2021 12:44:23 +0100 Subject: [PATCH 06/15] minor fixes --- packages/client/src/components/ClientApp.svelte | 2 +- .../client/src/components/NotificationDisplay.svelte | 2 +- packages/client/src/store/notification.js | 10 +--------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index ece44ab3ee..b2dd927106 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -10,7 +10,7 @@ setContext("sdk", SDK) setContext("component", writable({})) setContext("data", createDataStore()) - setContext("notification", notificationStore) + setContext("notifications", notificationStore) setContext("screenslot", false) let loaded = false diff --git a/packages/client/src/components/NotificationDisplay.svelte b/packages/client/src/components/NotificationDisplay.svelte index 2bae13bfc9..3206c60ec7 100644 --- a/packages/client/src/components/NotificationDisplay.svelte +++ b/packages/client/src/components/NotificationDisplay.svelte @@ -1,7 +1,7 @@