From 38c8bd454a98bb362a40d4f9ea08324efd1c37b2 Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Wed, 3 Feb 2021 16:20:01 +0100 Subject: [PATCH] request #19263: Empty and error state illustrations of the taskboard are not displayed The issue happens for two reasons: * since the v5.0 of file-loader everything is considered to be usable as a ES module by default. This does not work in this situation. * SVG loaded through `` is a bit of grey area in the Content-Security-Policy specification [0][1] and a result it does not work on Firefox when `default-src` is set to none. In order to solve the issue while keeping the overall app not too big, the parts of the SVG have been splitted into individual components and are loaded asynchronously. The opportunity has also been taken to optimize the SVGs with SVGO [2]. [0] https://github.com/w3c/webappsec-csp/issues/199 [1] https://github.com/w3c/webappsec-csp/issues/198 [2] https://github.com/svg/svgo Change-Id: Ia66419a50e73eadaffdd31bf3b1b70a5328592d3 --- plugins/scaled_agile/webpack.common.js | 1 - .../scripts/taskboard/src/components/App.vue | 6 +- .../EmptyState/NoContentEmptyState.vue | 19 +- .../NoContentEmptyStateIllustration.vue | 160 +++++++++++ .../NoContentEmptyState.test.ts.snap | 17 +- .../BoardWithoutAnyColumnsErrorForAdmin.vue | 19 +- ...outAnyColumnsErrorForAdminIllustration.vue | 108 +++++++ .../BoardWithoutAnyColumnsErrorForUsers.vue | 21 +- ...outAnyColumnsErrorForUsersIllustration.vue | 199 +++++++++++++ .../components/GlobalError/GlobalAppError.vue | 17 +- .../GlobalAppErrorIllustration.vue | 97 +++++++ ...ithoutAnyColumnsErrorForAdmin.test.ts.snap | 12 +- ...ithoutAnyColumnsErrorForUsers.test.ts.snap | 24 +- .../__snapshots__/GlobalAppError.test.ts.snap | 12 +- .../taskboard/src/images/illustrations.svg | 269 ------------------ plugins/taskboard/webpack.common.js | 1 - tools/utils/scripts/webpack-rule-configs.js | 7 - 17 files changed, 624 insertions(+), 365 deletions(-) create mode 100644 plugins/taskboard/scripts/taskboard/src/components/EmptyState/NoContentEmptyStateIllustration.vue create mode 100644 plugins/taskboard/scripts/taskboard/src/components/GlobalError/BoardWithoutAnyColumnsErrorForAdminIllustration.vue create mode 100644 plugins/taskboard/scripts/taskboard/src/components/GlobalError/BoardWithoutAnyColumnsErrorForUsersIllustration.vue create mode 100644 plugins/taskboard/scripts/taskboard/src/components/GlobalError/GlobalAppErrorIllustration.vue delete mode 100644 plugins/taskboard/scripts/taskboard/src/images/illustrations.svg diff --git a/plugins/scaled_agile/webpack.common.js b/plugins/scaled_agile/webpack.common.js index 81f3dff71bc..89efb6249dc 100644 --- a/plugins/scaled_agile/webpack.common.js +++ b/plugins/scaled_agile/webpack.common.js @@ -53,7 +53,6 @@ module.exports = [ ), webpack_configurator.rule_easygettext_loader, webpack_configurator.rule_vue_loader, - webpack_configurator.rule_file_loader_images, webpack_configurator.rule_scss_loader, ], }, diff --git a/plugins/taskboard/scripts/taskboard/src/components/App.vue b/plugins/taskboard/scripts/taskboard/src/components/App.vue index e50f12a42c0..d9fab5d4f5b 100644 --- a/plugins/taskboard/scripts/taskboard/src/components/App.vue +++ b/plugins/taskboard/scripts/taskboard/src/components/App.vue @@ -31,12 +31,12 @@ import Vue from "vue"; import { namespace, State, Getter } from "vuex-class"; import { Component } from "vue-property-decorator"; -import BoardWithoutAnyColumnsError from "./GlobalError/BoardWithoutAnyColumnsError.vue"; -import GlobalAppError from "./GlobalError/GlobalAppError.vue"; import { ColumnDefinition, TaskboardEvent } from "../type"; import TaskBoard from "./TaskBoard/TaskBoard.vue"; -import NoContentEmptyState from "./EmptyState/NoContentEmptyState.vue"; import EventBus from "./../helpers/event-bus"; +import NoContentEmptyState from "./EmptyState/NoContentEmptyState.vue"; +import BoardWithoutAnyColumnsError from "./GlobalError/BoardWithoutAnyColumnsError.vue"; +import GlobalAppError from "./GlobalError/GlobalAppError.vue"; const column = namespace("column"); const error = namespace("error"); diff --git a/plugins/taskboard/scripts/taskboard/src/components/EmptyState/NoContentEmptyState.vue b/plugins/taskboard/scripts/taskboard/src/components/EmptyState/NoContentEmptyState.vue index cee1488a4af..a9500e2a0da 100644 --- a/plugins/taskboard/scripts/taskboard/src/components/EmptyState/NoContentEmptyState.vue +++ b/plugins/taskboard/scripts/taskboard/src/components/EmptyState/NoContentEmptyState.vue @@ -18,15 +18,10 @@ - --> -