+
+
-
+
{{ alertMessage }}
{{ alertLinkIcon }}
+
+
+ fa-times
+
+
@@ -86,6 +116,12 @@ export default {
alertLinkTooltip: null,
timeoutInstance: null,
maxIconsSize: '20px',
+ interval: 0,
+ progression: 0,
+ absolute: false,
+ left: 0,
+ startEvent: null,
+ moving: false,
}),
computed: {
isMobile() {
@@ -97,6 +133,26 @@ export default {
maxWidth() {
return this.isMobile && '100vw' || '50vw';
},
+ minWidth() {
+ return this.isMobile && '100vw' || 400;
+ },
+ minHeight() {
+ return this.isMobile && 69 || 57;
+ },
+ },
+ watch: {
+ snackbar() {
+ if (this.isMobile) {
+ if (this.snackbar) {
+ this.interval = window.setInterval(() => {
+ this.progression -= this.timeout / 1000;
+ }, 1000);
+ } else if (this.interval) {
+ window.clearInterval(this.interval);
+ this.interval = 0;
+ }
+ }
+ },
},
created() {
document.addEventListener('alert-message', (event) => {
@@ -157,10 +213,20 @@ export default {
});
});
this.$root.$on('close-alert-message', this.closeAlert);
+
+ // Kept for backward compatibility
+ document.addEventListener('notification-alert', event => {
+ this.openAlert({
+ alertType: event?.detail?.type,
+ alertMessage: event?.detail?.message,
+ });
+ });
},
methods: {
openAlert(params) {
+ this.reset();
this.closeAlert();
+ this.progression = 100;
this.$nextTick().then(() => {
this.useHtml = params.useHtml || false;
this.confeti = params.confeti || false;
@@ -206,6 +272,41 @@ export default {
this.linkCallback();
}
},
+ reset() {
+ this.absolute = false;
+ this.left = -8;
+ this.startEvent = null;
+ this.moving = false;
+ },
+ moveStart() {
+ if (this.absolute) {
+ return;
+ }
+ this.reset();
+ window.setTimeout(() => this.absolute = true, 50);
+ },
+ moveEnd() {
+ const confirm = Math.abs(this.left) > (window.innerWidth / 4);
+ if (confirm) {
+ this.snackbar = false;
+ } else {
+ this.reset();
+ }
+ },
+ moveSwipe(event) {
+ if (!this.absolute) {
+ return;
+ }
+ if (!this.startEvent) {
+ this.startEvent = event;
+ } else if (!this.moving) {
+ this.moving = true;
+ this.$nextTick().then(() => {
+ this.left = parseInt(event.touchmoveX - this.startEvent.touchmoveX) - 8;
+ this.moving = false;
+ });
+ }
+ },
},
};
\ No newline at end of file
diff --git a/webapp/portlet/src/main/webapp/vue-apps/general-settings/components/registration/HubAccess.vue b/webapp/portlet/src/main/webapp/vue-apps/general-settings/components/registration/HubAccess.vue
index 547af643eea..6f2eae2ff61 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/general-settings/components/registration/HubAccess.vue
+++ b/webapp/portlet/src/main/webapp/vue-apps/general-settings/components/registration/HubAccess.vue
@@ -344,21 +344,13 @@ export default {
if (newVal !== oldVal) {
if (this.accessType === 'OPEN') {
this.$root.$emit('alert-message-html', `
-
- ${this.$t('generalSettings.access.openChangeInformation1')}
-
-
- ${this.$t('generalSettings.access.openChangeInformation2')}
-
+
${this.$t('generalSettings.access.openChangeInformation1')}
+
${this.$t('generalSettings.access.openChangeInformation2')}
`, 'info');
} else if (this.accessType === 'RESTRICTED') {
this.$root.$emit('alert-message-html', `
-
- ${this.$t('generalSettings.access.restrictedChangeInformation1')}
-
-
- ${this.$t('generalSettings.access.restrictedChangeInformation2')}
-
+
${this.$t('generalSettings.access.restrictedChangeInformation1')}
+
${this.$t('generalSettings.access.restrictedChangeInformation2')}
`, 'info');
}
}
diff --git a/webapp/portlet/src/main/webapp/vue-apps/idm-groups-management/components/GroupsManagement.vue b/webapp/portlet/src/main/webapp/vue-apps/idm-groups-management/components/GroupsManagement.vue
index bf01ea4cea2..215cc635e16 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/idm-groups-management/components/GroupsManagement.vue
+++ b/webapp/portlet/src/main/webapp/vue-apps/idm-groups-management/components/GroupsManagement.vue
@@ -1,10 +1,5 @@
-
-
- {{ error }}
-
-
@@ -20,14 +15,3 @@
-
-
\ No newline at end of file
diff --git a/webapp/portlet/src/main/webapp/vue-apps/idm-groups-management/components/GroupsManagementFormDrawer.vue b/webapp/portlet/src/main/webapp/vue-apps/idm-groups-management/components/GroupsManagementFormDrawer.vue
index d899cf322ab..e5dcb0d4f97 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/idm-groups-management/components/GroupsManagementFormDrawer.vue
+++ b/webapp/portlet/src/main/webapp/vue-apps/idm-groups-management/components/GroupsManagementFormDrawer.vue
@@ -13,12 +13,6 @@
class="form-horizontal pt-0 pb-4"
flat
@submit="saveGroup">
-
-
- {{ error }}
-
-
-
{{ $t('GroupsManagement.name') }}*
@@ -89,7 +83,6 @@
\ No newline at end of file
diff --git a/webapp/portlet/src/main/webapp/vue-apps/popover/components/Popover.vue b/webapp/portlet/src/main/webapp/vue-apps/popover/components/Popover.vue
index 580152a1835..59c57551bb0 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/popover/components/Popover.vue
+++ b/webapp/portlet/src/main/webapp/vue-apps/popover/components/Popover.vue
@@ -21,7 +21,6 @@
diff --git a/webapp/portlet/src/main/webapp/vue-apps/popover/initComponents.js b/webapp/portlet/src/main/webapp/vue-apps/popover/initComponents.js
index 7dcf5adf5ef..5fd351a976e 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/popover/initComponents.js
+++ b/webapp/portlet/src/main/webapp/vue-apps/popover/initComponents.js
@@ -4,7 +4,6 @@ import UserPopoverContent from './components/UserPopoverContent.vue';
import SpacePopoverContent from './components/SpacePopoverContent.vue';
import SpaceMuteNotificationButton from './components/SpaceMuteNotificationButton.vue';
import UsersListDrawer from './components/UsersListDrawer.vue';
-import NotificationAlerts from './components/NotificationAlerts.vue';
import ExoSpaceFavoriteAction from '../spaces-list/components/ExoSpaceFavoriteAction.vue';
const components = {
@@ -13,7 +12,6 @@ const components = {
'user-popover-content': UserPopoverContent,
'space-popover-content': SpacePopoverContent,
'space-mute-notification-button': SpaceMuteNotificationButton,
- 'notification-alerts': NotificationAlerts,
'users-list-drawer': UsersListDrawer
};
components['exo-space-favorite-action'] = ExoSpaceFavoriteAction;
diff --git a/webapp/portlet/src/main/webapp/vue-apps/profile-about-me/components/ProfileAboutMe.vue b/webapp/portlet/src/main/webapp/vue-apps/profile-about-me/components/ProfileAboutMe.vue
index 642c5904a08..20a8d2be9ad 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/profile-about-me/components/ProfileAboutMe.vue
+++ b/webapp/portlet/src/main/webapp/vue-apps/profile-about-me/components/ProfileAboutMe.vue
@@ -61,11 +61,6 @@
{{ $t('profileAboutMe.save') }}
-
-
- {{ error }}
-
-
@@ -76,7 +71,6 @@ export default {
data: () => ({
owner: eXo.env.portal.profileOwner === eXo.env.portal.userName,
aboutMe: null,
- error: null,
saving: null,
modifyingAboutMe: null,
aboutMeTextLength: 2000,
@@ -119,12 +113,11 @@ export default {
this.$refs.aboutMeDrawer.open();
},
saveAboutMe() {
- this.error = null;
this.saving = true;
this.$refs.aboutMeDrawer.startLoading();
return this.$userService.updateProfileField(eXo.env.portal.profileOwner, 'aboutMe', this.modifyingAboutMe)
.then(() => this.refresh(this.modifyingAboutMe))
- .catch(() => this.error = this.$t('profileAboutMe.savingError'))
+ .catch(() => this.$root.$emit('alert-message', this.$t('profileAboutMe.savingError'), 'error'))
.finally(() => {
this.saving = false;
this.$refs.aboutMeDrawer.endLoading();
diff --git a/webapp/portlet/src/main/webapp/vue-apps/profile-contact-information/components/ProfileContactInformationDrawer.vue b/webapp/portlet/src/main/webapp/vue-apps/profile-contact-information/components/ProfileContactInformationDrawer.vue
index 5238e4ac8e3..58165154db5 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/profile-contact-information/components/ProfileContactInformationDrawer.vue
+++ b/webapp/portlet/src/main/webapp/vue-apps/profile-contact-information/components/ProfileContactInformationDrawer.vue
@@ -12,11 +12,6 @@
ref="profileContactForm"
class="form-horizontal"
flat>
-
-
- {{ error }}
-
-
({
propertiesToSave: [],
properties: [],
- error: null,
saving: null,
fieldError: false,
disabled: true,
@@ -92,7 +86,6 @@ export default {
},
save() {
- this.error = null;
this.fieldError = false;
this.resetCustomValidity();
@@ -166,7 +159,7 @@ export default {
if (error) {
if (String(error).indexOf(this.$uploadService.avatarExcceedsLimitError) >= 0) {
- this.error = this.$t('profileHeader.label.avatarExcceededAllowedSize', {0: this.uploadLimit});
+ this.$root.$emit('alert-message', this.$t('profileHeader.label.avatarExcceededAllowedSize', {0: this.uploadLimit}), 'error');
} else if (this.fieldError && this.fieldError.indexOf('FIRSTNAME:') === 0) {
const firstNameError = this.fieldError.replace('FIRSTNAME:', '');
if (this.$refs.firstNameInput) { this.$refs.firstNameInput[0].setCustomValidity(firstNameError);}
@@ -187,10 +180,7 @@ export default {
if (errorI18N !== errorI18NKey) {
error = errorI18N;
}
- this.error = error;
- window.setTimeout(() => {
- this.error = null;
- }, 5000);
+ this.$root.$emit('alert-message', error, 'error');
}
window.setTimeout(() => {
@@ -200,7 +190,7 @@ export default {
}
}, 200);
} else {
- this.error = null;
+ this.$root.$emit('close-alert-message');
}
},
refresh() {
diff --git a/webapp/portlet/src/main/webapp/vue-apps/profile-settings/components/ProfileSettings.vue b/webapp/portlet/src/main/webapp/vue-apps/profile-settings/components/ProfileSettings.vue
index 9d86240b75f..7d0213afd76 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/profile-settings/components/ProfileSettings.vue
+++ b/webapp/portlet/src/main/webapp/vue-apps/profile-settings/components/ProfileSettings.vue
@@ -28,13 +28,6 @@
-
- {{ message }}
-
@@ -50,9 +43,6 @@ export default {
},
data: () => ({
- alert: false,
- type: '',
- message: '',
settings: [],
filter: 'Active'
}),
@@ -87,10 +77,7 @@ export default {
},
methods: {
displayMessage(alert) {
- this.message = alert.message;
- this.type = alert.type;
- this.alert = true;
- window.setTimeout(() => this.alert = false, 5000);
+ this.$root.$emit('alert-message', alert.message, alert.type);
},
getSettings() {
return this.$profileSettingsService.getSettings()
diff --git a/webapp/portlet/src/main/webapp/vue-apps/profile-settings/components/drawers/ProfileSettingFormDrawer.vue b/webapp/portlet/src/main/webapp/vue-apps/profile-settings/components/drawers/ProfileSettingFormDrawer.vue
index b15e3d11383..e5d755b4669 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/profile-settings/components/drawers/ProfileSettingFormDrawer.vue
+++ b/webapp/portlet/src/main/webapp/vue-apps/profile-settings/components/drawers/ProfileSettingFormDrawer.vue
@@ -33,12 +33,6 @@
ref="settingForm"
class="form-horizontal pt-0 pb-4"
flat>
-
-
- {{ error }}
-
-
-
{{ $t('profileSettings.label.name') }}*
@@ -227,7 +221,6 @@ export default {
},
},
data: () => ({
- error: null,
fieldError: false,
drawer: false,
newSetting: false,
@@ -338,7 +331,6 @@ export default {
event.stopPropagation();
}
- this.error = null;
this.fieldError = false;
this.resetCustomValidity();
diff --git a/webapp/portlet/src/main/webapp/vue-apps/search-space/main.js b/webapp/portlet/src/main/webapp/vue-apps/search-space/main.js
index 73dc607646e..fd03319e332 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/search-space/main.js
+++ b/webapp/portlet/src/main/webapp/vue-apps/search-space/main.js
@@ -12,9 +12,9 @@ const lang = typeof eXo !== 'undefined' ? eXo.env.portal.language : 'en';
const urls = [`${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.portlet.Portlets-${lang}.json`];
exoi18n.loadLanguageAsync(lang, urls).then(i18n => {
- new Vue({
+ Vue.createApp({
template: '',
vuetify: Vue.prototype.vuetifyOptions,
i18n,
- }).$mount(`#${appId}`);
+ }, `#${appId}`, 'Search Space Drawers');
});
\ No newline at end of file
diff --git a/webapp/portlet/src/main/webapp/vue-apps/space-members/components/AlertSpaceMembers.vue b/webapp/portlet/src/main/webapp/vue-apps/space-members/components/AlertSpaceMembers.vue
index 6a161401a4a..d33e604dd06 100644
--- a/webapp/portlet/src/main/webapp/vue-apps/space-members/components/AlertSpaceMembers.vue
+++ b/webapp/portlet/src/main/webapp/vue-apps/space-members/components/AlertSpaceMembers.vue
@@ -1,13 +1,3 @@
-
-
-
-
-
-