From a15056d8409cc21ae0003a1fe6ff39e583efe6c9 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Tue, 13 Jul 2021 05:53:26 +0300 Subject: [PATCH 1/6] refactor(AlertModal): reuse AeButton --- src/components/AlertModal.vue | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/components/AlertModal.vue b/src/components/AlertModal.vue index 8dc284422..850253236 100644 --- a/src/components/AlertModal.vue +++ b/src/components/AlertModal.vue @@ -16,12 +16,9 @@ > {{ row }}

- + @@ -30,8 +27,10 @@ diff --git a/src/components/Dialog.vue b/src/components/Dialog.vue new file mode 100644 index 000000000..1e1fea444 --- /dev/null +++ b/src/components/Dialog.vue @@ -0,0 +1,68 @@ + + + + + From af9b3988027a3d85af95b3ae0e1c9dcf42d95642 Mon Sep 17 00:00:00 2001 From: Yury Shapkarin Date: Thu, 1 Apr 2021 16:01:29 +0300 Subject: [PATCH 4/6] feat: global error handler, ErrorReportModal --- package-lock.json | 15 ++ package.json | 1 + src/assets/iconCodeError.svg | 28 ++++ src/assets/iconThumbUp.svg | 33 +++++ src/components/Dialog.vue | 61 +++++++- src/components/ErrorReportModal.vue | 139 +++++++++++++++++++ src/components/ErrorReportSubmittedModal.vue | 35 +++++ src/locales/en.json | 16 +++ src/locales/es.json | 16 +++ src/locales/fr.json | 16 +++ src/locales/zh.json | 16 +++ src/store/index.js | 2 + src/store/plugins/errorHandler.js | 54 +++++++ src/utils/backend.js | 8 ++ src/views/modals.js | 12 ++ 15 files changed, 446 insertions(+), 6 deletions(-) create mode 100644 src/assets/iconCodeError.svg create mode 100644 src/assets/iconThumbUp.svg create mode 100644 src/components/ErrorReportModal.vue create mode 100644 src/components/ErrorReportSubmittedModal.vue create mode 100644 src/store/plugins/errorHandler.js diff --git a/package-lock.json b/package-lock.json index 37d98b6c8..2bf11ed21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19359,6 +19359,21 @@ } } }, + "serialize-error": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-8.1.0.tgz", + "integrity": "sha512-3NnuWfM6vBYoy5gZFvHiYsVbafvI9vZv/+jlIigFn4oP4zjNPK3LhcY0xSCgeb1a5L8jO71Mit9LlNoi2UfDDQ==", + "requires": { + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" + } + } + }, "serialize-javascript": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", diff --git a/package.json b/package.json index fcd92f8b5..5fdc0a8cb 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "lru-cache": "^6.0.0", "node-fetch": "^2.6.1", "normalize.css": "^8.0.1", + "serialize-error": "^8.1.0", "serve-static": "^1.14.1", "sophia-bonding-curve": "github:aeternity/BondingCurve#1.0.0-alpha.2", "soundcloud-widget": "^0.2.1", diff --git a/src/assets/iconCodeError.svg b/src/assets/iconCodeError.svg new file mode 100644 index 000000000..45dc8f973 --- /dev/null +++ b/src/assets/iconCodeError.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + diff --git a/src/assets/iconThumbUp.svg b/src/assets/iconThumbUp.svg new file mode 100644 index 000000000..d636e2a6f --- /dev/null +++ b/src/assets/iconThumbUp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/components/Dialog.vue b/src/components/Dialog.vue index 1e1fea444..266262b0b 100644 --- a/src/components/Dialog.vue +++ b/src/components/Dialog.vue @@ -5,6 +5,13 @@ @click.self="$emit('close')" >
+ + + +

{{ title }}

+

+ {{ subtitle }} +

@@ -40,29 +55,63 @@ export default { text-align: center; width: 25rem; margin: auto; - padding: 2.5rem; + padding: 40px 32px; background-color: $actions_ribbon_background_color; border-radius: 0.25rem; border: 1px solid $card_border_color; box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.25); + font-size: 15px; + line-height: 24px; + color: $tip_note_color; + position: relative; @include smallest { width: 100%; padding: 1rem; } + .close { + position: absolute; + top: 8px; + right: 8px; + color: $light_font_color; + + &:hover { + color: #fff; + } + + svg { + height: 32px; + } + } + .icon { - img, svg { - height: 2rem; - margin-bottom: 0.85rem; + img, + svg { + display: block; + margin: 0 auto 8px auto; + height: 48px; } } - h1 { + h1, + h2 { + margin-top: 0; color: $standard_font_color; - font-size: 1rem; font-weight: 500; } + + h1 { + font-size: 19px; + line-height: 22px; + margin-bottom: 24px; + } + + h2 { + font-size: 15px; + line-height: 24px; + margin-bottom: 8px; + } } } diff --git a/src/components/ErrorReportModal.vue b/src/components/ErrorReportModal.vue new file mode 100644 index 000000000..c1a206afa --- /dev/null +++ b/src/components/ErrorReportModal.vue @@ -0,0 +1,139 @@ +