From c7b928dcea8f12450b1d13215887aa7418142541 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Tue, 10 Oct 2023 12:13:24 +0100 Subject: [PATCH] feat: Reuse centralized Toast Notifs component - MEED-2627 - Meeds-io/MIPs#99 (#425) Prior to this change, the toast notifications wasn't relying on the centralized reusable component to display alerts. This change removes the specific alerts in order to reuse the centralized component. --- .../vue-app/wallet-admin/walletAdmin.js | 4 +- .../webapp/vue-app/wallet-app/walletAPI.js | 4 +- .../components/WalletNotificationAlert.vue | 56 +++++++------------ .../wallet-common/wallet-overview/main.js | 9 +-- .../WalletSettingsInternalDetails.vue | 3 - .../main/webapp/vue-app/wallet-reward/main.js | 4 +- 6 files changed, 29 insertions(+), 51 deletions(-) diff --git a/wallet-webapps/src/main/webapp/vue-app/wallet-admin/walletAdmin.js b/wallet-webapps/src/main/webapp/vue-app/wallet-admin/walletAdmin.js index 625c4b2a4..5543ddcff 100644 --- a/wallet-webapps/src/main/webapp/vue-app/wallet-admin/walletAdmin.js +++ b/wallet-webapps/src/main/webapp/vue-app/wallet-admin/walletAdmin.js @@ -26,10 +26,10 @@ const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale export function init() { exoi18n.loadLanguageAsync(lang, url).then(i18n => { - new Vue({ + Vue.createApp({ render: (h) => h(WalletAdminApp), i18n, vuetify, - }).$mount('#WalletAdminApp'); + }, '#WalletAdminApp', 'Wallet Administration'); }); } \ No newline at end of file diff --git a/wallet-webapps/src/main/webapp/vue-app/wallet-app/walletAPI.js b/wallet-webapps/src/main/webapp/vue-app/wallet-app/walletAPI.js index c5bbbacb3..6ca920232 100644 --- a/wallet-webapps/src/main/webapp/vue-app/wallet-app/walletAPI.js +++ b/wallet-webapps/src/main/webapp/vue-app/wallet-app/walletAPI.js @@ -32,11 +32,11 @@ export function initAPI() { window.LocalWeb3 = LocalWeb3; - new Vue({ + Vue.createApp({ render: (h) => h(WalletAPIApp), i18n, vuetify, - }).$mount('#WalletAPIApp'); + }, '#WalletAPIApp', 'Wallet API'); }); }); } diff --git a/wallet-webapps/src/main/webapp/vue-app/wallet-common/components/WalletNotificationAlert.vue b/wallet-webapps/src/main/webapp/vue-app/wallet-common/components/WalletNotificationAlert.vue index b1c9c9461..ee2240838 100644 --- a/wallet-webapps/src/main/webapp/vue-app/wallet-common/components/WalletNotificationAlert.vue +++ b/wallet-webapps/src/main/webapp/vue-app/wallet-common/components/WalletNotificationAlert.vue @@ -14,34 +14,9 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> - diff --git a/wallet-webapps/src/main/webapp/vue-app/wallet-common/wallet-overview/main.js b/wallet-webapps/src/main/webapp/vue-app/wallet-common/wallet-overview/main.js index d03d0edfb..52052659b 100644 --- a/wallet-webapps/src/main/webapp/vue-app/wallet-common/wallet-overview/main.js +++ b/wallet-webapps/src/main/webapp/vue-app/wallet-common/wallet-overview/main.js @@ -33,18 +33,15 @@ const lang = (eXo && eXo.env && eXo.env.portal && eXo.env.portal.language) || 'e const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.addon.Wallet-${lang}.json`; const appId = 'WalletOverview'; -const cacheId = `${appId}_${eXo.env.portal.profileOwnerIdentityId}`; export function init() { exoi18n.loadLanguageAsync(lang, url).then(i18n => { - const appElement = document.createElement('div'); - appElement.id = appId; // init Vue app when locale ressources are ready - new Vue({ - template: ``, + Vue.createApp({ + template: ``, i18n, vuetify, - }).$mount(appElement); + }, `#${appId}`, 'Wallet Overview'); }); } diff --git a/wallet-webapps/src/main/webapp/vue-app/wallet-common/wallet-settings/components/WalletSettingsInternalDetails.vue b/wallet-webapps/src/main/webapp/vue-app/wallet-common/wallet-settings/components/WalletSettingsInternalDetails.vue index 812b44d7b..be3e18bbd 100644 --- a/wallet-webapps/src/main/webapp/vue-app/wallet-common/wallet-settings/components/WalletSettingsInternalDetails.vue +++ b/wallet-webapps/src/main/webapp/vue-app/wallet-common/wallet-settings/components/WalletSettingsInternalDetails.vue @@ -124,9 +124,6 @@ export default { }, data: () => ({ displayManagePasswordDetails: false, - alert: false, - type: '', - message: '', provider: null }), computed: { diff --git a/wallet-webapps/src/main/webapp/vue-app/wallet-reward/main.js b/wallet-webapps/src/main/webapp/vue-app/wallet-reward/main.js index 861984826..111c35f4e 100644 --- a/wallet-webapps/src/main/webapp/vue-app/wallet-reward/main.js +++ b/wallet-webapps/src/main/webapp/vue-app/wallet-reward/main.js @@ -35,10 +35,10 @@ const appId = 'RewardApp'; export function init() { exoi18n.loadLanguageAsync(lang, url).then(i18n => { - new Vue({ + Vue.createApp({ template: ``, i18n, vuetify, - }).$mount(`#${appId}`); + }, `#${appId}`, 'Wallet Reward'); }); } \ No newline at end of file