From 897511c3477f67fd44c9d312b00e9c1c0d7431eb Mon Sep 17 00:00:00 2001 From: ozer550 Date: Thu, 19 Jun 2025 22:55:23 +0530 Subject: [PATCH 1/4] initial removal of svg tag --- .../frontend/shared/utils/icons.js | 30 ++++++++ .../shared/views/channel/ChannelThumbnail.vue | 4 +- .../frontend/shared/views/files/Thumbnail.vue | 74 ++++++++++--------- 3 files changed, 71 insertions(+), 37 deletions(-) create mode 100644 contentcuration/contentcuration/frontend/shared/utils/icons.js diff --git a/contentcuration/contentcuration/frontend/shared/utils/icons.js b/contentcuration/contentcuration/frontend/shared/utils/icons.js new file mode 100644 index 0000000000..5fbe2f3ff4 --- /dev/null +++ b/contentcuration/contentcuration/frontend/shared/utils/icons.js @@ -0,0 +1,30 @@ +import camelCase from 'lodash/camelCase'; +import { ContentKindsNames } from 'shared/leUtils/ContentKinds'; + +const EMPTY = '_empty'; +const CONTENT_KIND_ICONS = { + [ContentKindsNames.TOPIC]: 'topic', + [ContentKindsNames.TOPIC + EMPTY]: 'emptyTopic', + [ContentKindsNames.VIDEO]: 'video', + [ContentKindsNames.AUDIO]: 'audio', + [ContentKindsNames.SLIDESHOW]: 'slideshow', + [ContentKindsNames.EXERCISE]: 'exercise', + [ContentKindsNames.DOCUMENT]: 'document', + [ContentKindsNames.HTML5]: 'html5', + [ContentKindsNames.ZIM]: 'html5', +}; + +export function getContentKindIcon(kind, isEmpty = false) { + const icon = (isEmpty ? [kind + EMPTY] : []).concat([kind]).find(k => k in CONTENT_KIND_ICONS); + return icon ? CONTENT_KIND_ICONS[icon] : 'error'; +} + +export function getLearningActivityIcon(activity) { + if (activity.toLowerCase() === 'explore') { + return 'interactShaded'; + } else if (activity === 'multiple') { + return 'allActivities'; + } else { + return `${camelCase(activity) + 'Solid'}`; + } +} diff --git a/contentcuration/contentcuration/frontend/shared/views/channel/ChannelThumbnail.vue b/contentcuration/contentcuration/frontend/shared/views/channel/ChannelThumbnail.vue index d8a5a07d84..25d4a7fbb3 100644 --- a/contentcuration/contentcuration/frontend/shared/views/channel/ChannelThumbnail.vue +++ b/contentcuration/contentcuration/frontend/shared/views/channel/ChannelThumbnail.vue @@ -16,7 +16,7 @@ > - @@ -55,33 +54,26 @@ - - - +
- +
@@ -89,8 +81,8 @@