From a2c999ccefca1db2ac2a49f875db9fbc70ac6271 Mon Sep 17 00:00:00 2001 From: sylenien Date: Mon, 16 May 2022 17:54:20 +0200 Subject: [PATCH] fix(ui): fix weird wording, bug with svg --- frontend/app/svg/icons/dashboard-icn.svg | 48 ++++++++++++++++++++++++ frontend/app/types/dashboard/index.js | 8 ++-- frontend/scripts/icons.js | 9 +++-- 3 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 frontend/app/svg/icons/dashboard-icn.svg diff --git a/frontend/app/svg/icons/dashboard-icn.svg b/frontend/app/svg/icons/dashboard-icn.svg new file mode 100644 index 000000000..c14996229 --- /dev/null +++ b/frontend/app/svg/icons/dashboard-icn.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/app/types/dashboard/index.js b/frontend/app/types/dashboard/index.js index 7359334e5..c250d64d6 100644 --- a/frontend/app/types/dashboard/index.js +++ b/frontend/app/types/dashboard/index.js @@ -2,7 +2,7 @@ import { Map, List } from 'immutable'; import Session from 'Types/session'; import { camelCased } from 'App/utils'; -import { getChartFormatter } from './helper'; +import { getChartFormatter } from './helper'; import ProcessedSessions from './processedSessions'; import DomBuildingTime from './domBuildingTime'; import MemoryConsumption from './memoryConsumption'; @@ -84,7 +84,7 @@ export const WIDGET_LIST = [{ if (sessionK1 !== sessionK2) return sessionK2 - sessionK1; return i2.avgDuration - i1.avgDuration; }), - }, + }, // { // key: "errorsTrend", // name: "Most Impactful Errors", @@ -130,7 +130,7 @@ export const WIDGET_LIST = [{ }, { key: "overview", - name: "Overview Widgets", + name: "Overview Metrics", description: 'List of resources that are slowing down your website, sorted by the number of impacted sessions.', thumb: 'na.png', dataWrapper: (p, period) => { @@ -571,7 +571,7 @@ WIDGET_LIST.forEach(w => { WIDGET_MAP[ w.key ] = w; }); const OVERVIEW_WIDGET_MAP = {}; WIDGET_LIST.filter(w => w.type === 'overview').forEach(w => { OVERVIEW_WIDGET_MAP[ w.key ] = w; }); -export { +export { WIDGET_MAP, OVERVIEW_WIDGET_MAP, ProcessedSessions, diff --git a/frontend/scripts/icons.js b/frontend/scripts/icons.js index adc9352d0..90bdfcfed 100644 --- a/frontend/scripts/icons.js +++ b/frontend/scripts/icons.js @@ -8,7 +8,8 @@ const ICONS_DIRNAME = 'app/svg/icons'; const UI_DIRNAME = 'app/components/ui'; const svgo = new SVGO({ plugins: [ - { removeAttrs: { attrs: [ "width", "height", "class", "data-name", "dataName" ] } }, + //"width", "height", + { removeAttrs: { attrs: [ "class", "data-name", "dataName" ] } }, { addAttributesToSVGElement: { attributes: [ "width={ `${ width }px` }", "height={ `${ height }px` }" ] } }, { convertPathData: true }, // ? { removeViewBox: false }, // ? @@ -20,7 +21,7 @@ const svgo = new SVGO({ plugins: [ item.eachAttr(attr => { attr.name = attr.name.replace(/-([a-z])/g, gr => gr[1].toUpperCase()) }) - } + } }} ]}); @@ -41,7 +42,7 @@ ${ icons.map(name => ` case '${ name.slice(0, -4) }': return ${ .replace(/xlink\:href/g, 'xlinkHref') .replace(/xmlns\:xlink/g, 'xmlnsXlink') }`).join('\n') } - default: + default: if (window.ENV.PRODUCTION) return null; throw "unknown icon name " + name; } @@ -51,4 +52,4 @@ SVG.displayName = 'SVG'; export default SVG; `); -console.log('SVG.js generated') \ No newline at end of file +console.log('SVG.js generated')