From 1c26b4ceb8e42387c8f6da7cb23b205ef9676475 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Mon, 6 Nov 2023 12:22:03 +0100 Subject: [PATCH] feat: Add List Drawers to Programs and rules Widgets - MEED-2848 - Meeds-io/MIPs#100 (#1299) This change will allow to retrieve the list of actions and programs from overview widgets instead of a direct link to full page applications. --- .../locale/portlet/Challenges_en.properties | 2 + .../webapp/vue-app/badgesOverview/main.js | 2 +- .../vue-app/create-program-button/main.js | 2 +- .../webapp/vue-app/myContributions/main.js | 2 +- .../main/webapp/vue-app/myReputation/main.js | 2 +- .../src/main/webapp/vue-app/myRewards/main.js | 2 +- .../main/webapp/vue-app/popularSpaces/main.js | 2 +- .../main/webapp/vue-app/profileStats/main.js | 2 +- .../components/ProgramDetailDrawer.vue | 8 +- .../components/ProgramOverviewItem.vue | 14 +- .../components/ProgramsOverview.vue | 28 ++- .../components/ProgramsOverviewListDrawer.vue | 90 ++++++++ .../programsOverview/initComponents.js | 2 + .../webapp/vue-app/programsOverview/main.js | 2 +- .../rules/components/RuleExtensions.vue | 6 +- .../components/drawers/RuleDetailDrawer.vue | 11 +- .../components/RulesOverviewListDrawer.vue | 208 ++++++++++++++++++ .../components/RulesOverviewReducedList.vue | 48 ++-- .../vue-app/rulesOverview/initComponents.js | 2 + .../components/RulesOverviewItem.vue | 20 +- .../components/RulesOverviewWidget.vue | 47 ++-- .../components/TopChallengers.vue | 3 +- .../webapp/vue-app/topChallengers/main.js | 2 +- .../webapp/vue-app/usersLeaderboard/main.js | 2 +- .../components/Profile.vue | 4 +- .../components/ProfileRealizationItem.vue | 2 +- .../components/ProfileRealizations.vue | 4 +- 27 files changed, 438 insertions(+), 81 deletions(-) create mode 100644 portlets/src/main/webapp/vue-app/programsOverview/components/ProgramsOverviewListDrawer.vue create mode 100644 portlets/src/main/webapp/vue-app/rulesOverview/components/RulesOverviewListDrawer.vue diff --git a/portlets/src/main/resources/locale/portlet/Challenges_en.properties b/portlets/src/main/resources/locale/portlet/Challenges_en.properties index e2039449e3..bc9faf4624 100644 --- a/portlets/src/main/resources/locale/portlet/Challenges_en.properties +++ b/portlets/src/main/resources/locale/portlet/Challenges_en.properties @@ -392,6 +392,8 @@ search.connector.label.rules=Actions gamification.overview.programs=Programs gamification.overview.weeklyLeaderboard=Weekly Leaderboard gamification.overview.actions=Actions +gamification.overview.actionsList=Actions list +gamification.overview.programsList=Programs list gamification.overview.leaderboard.drawer.title=Leaderboard gamification.overview.programsFilter.drawer.title=Filter per program gamification.overview.userAchievementsList.drawer.title=Achievements list diff --git a/portlets/src/main/webapp/vue-app/badgesOverview/main.js b/portlets/src/main/webapp/vue-app/badgesOverview/main.js index 5d877f09e3..1bfefce008 100644 --- a/portlets/src/main/webapp/vue-app/badgesOverview/main.js +++ b/portlets/src/main/webapp/vue-app/badgesOverview/main.js @@ -29,7 +29,7 @@ if (extensionRegistry) { const vuetify = Vue.prototype.vuetifyOptions; // getting language of user -const lang = eXo && eXo.env && eXo.env.portal && eXo.env.portal.language || 'en'; +const lang = eXo?.env?.portal?.language || 'en'; const resourceBundleName = 'locale.addon.Gamification'; const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/${resourceBundleName}-${lang}.json`; diff --git a/portlets/src/main/webapp/vue-app/create-program-button/main.js b/portlets/src/main/webapp/vue-app/create-program-button/main.js index b7437f38c4..2c2faf8f34 100644 --- a/portlets/src/main/webapp/vue-app/create-program-button/main.js +++ b/portlets/src/main/webapp/vue-app/create-program-button/main.js @@ -19,7 +19,7 @@ */ import './initComponents.js'; -const lang = eXo && eXo.env && eXo.env.portal && eXo.env.portal.language || 'en'; +const lang = eXo?.env?.portal?.language || 'en'; const urls = [ `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.portlet.Challenges-${lang}.json` ]; diff --git a/portlets/src/main/webapp/vue-app/myContributions/main.js b/portlets/src/main/webapp/vue-app/myContributions/main.js index cfded945fd..a739d0a84b 100644 --- a/portlets/src/main/webapp/vue-app/myContributions/main.js +++ b/portlets/src/main/webapp/vue-app/myContributions/main.js @@ -17,7 +17,7 @@ import './initComponents.js'; // getting language of user -const lang = eXo && eXo.env && eXo.env.portal && eXo.env.portal.language || 'en'; +const lang = eXo?.env?.portal?.language || 'en'; const resourceBundleName = 'locale.addon.Gamification'; const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/${resourceBundleName}-${lang}.json`; diff --git a/portlets/src/main/webapp/vue-app/myReputation/main.js b/portlets/src/main/webapp/vue-app/myReputation/main.js index d8a8bd7a43..719133e84c 100644 --- a/portlets/src/main/webapp/vue-app/myReputation/main.js +++ b/portlets/src/main/webapp/vue-app/myReputation/main.js @@ -23,7 +23,7 @@ extensionRegistry.registerComponent('my-reputation-overview-badges', 'my-reputat }); // getting language of user -const lang = eXo && eXo.env && eXo.env.portal && eXo.env.portal.language || 'en'; +const lang = eXo?.env?.portal?.language || 'en'; const resourceBundleName = 'locale.addon.Gamification'; const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/${resourceBundleName}-${lang}.json`; diff --git a/portlets/src/main/webapp/vue-app/myRewards/main.js b/portlets/src/main/webapp/vue-app/myRewards/main.js index 30235e7ebe..fae5b581c1 100644 --- a/portlets/src/main/webapp/vue-app/myRewards/main.js +++ b/portlets/src/main/webapp/vue-app/myRewards/main.js @@ -16,7 +16,7 @@ */ import './initComponents.js'; -const lang = eXo && eXo.env && eXo.env.portal && eXo.env.portal.language || 'en'; +const lang = eXo?.env?.portal?.language || 'en'; const urls = [ `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.addon.Gamification-${lang}.json`, `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.portlet.Challenges-${lang}.json` diff --git a/portlets/src/main/webapp/vue-app/popularSpaces/main.js b/portlets/src/main/webapp/vue-app/popularSpaces/main.js index 21d474cd69..a60454c2b3 100644 --- a/portlets/src/main/webapp/vue-app/popularSpaces/main.js +++ b/portlets/src/main/webapp/vue-app/popularSpaces/main.js @@ -29,7 +29,7 @@ if (extensionRegistry) { const vuetify = Vue.prototype.vuetifyOptions; // getting language of user -const lang = eXo && eXo.env && eXo.env.portal && eXo.env.portal.language || 'en'; +const lang = eXo?.env?.portal?.language || 'en'; const resourceBundleName = 'locale.addon.Gamification'; const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/${resourceBundleName}-${lang}.json`; diff --git a/portlets/src/main/webapp/vue-app/profileStats/main.js b/portlets/src/main/webapp/vue-app/profileStats/main.js index 7d3a39c7ce..494d04e993 100644 --- a/portlets/src/main/webapp/vue-app/profileStats/main.js +++ b/portlets/src/main/webapp/vue-app/profileStats/main.js @@ -19,7 +19,7 @@ import './initComponents.js'; const vuetify = Vue.prototype.vuetifyOptions; // getting language of user -const lang = eXo && eXo.env && eXo.env.portal && eXo.env.portal.language || 'en'; +const lang = eXo?.env?.portal?.language || 'en'; const resourceBundleName = 'locale.addon.Gamification'; const urls = [ diff --git a/portlets/src/main/webapp/vue-app/programsOverview/components/ProgramDetailDrawer.vue b/portlets/src/main/webapp/vue-app/programsOverview/components/ProgramDetailDrawer.vue index 0487a5c84f..d846a1b1aa 100644 --- a/portlets/src/main/webapp/vue-app/programsOverview/components/ProgramDetailDrawer.vue +++ b/portlets/src/main/webapp/vue-app/programsOverview/components/ProgramDetailDrawer.vue @@ -23,7 +23,8 @@ id="programDetailDrawer" ref="drawer" v-model="drawer" - :right="!$vuetify.rtl"> + :right="!$vuetify.rtl" + :go-back-button="goBackButton">