-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow to apply Space Template in Bulk - MEED-7768 - Meeds-io/MI…
…Ps#160 This change will prepare the Bulk operations UX in Spaces Administration UI by adding the first bulk operation in order to apply a Space template on a set of spaces.
- Loading branch information
Showing
15 changed files
with
519 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...ps/spaces-administration/components/bulk-action/SpacesAdministrationBulkApplyTemplate.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!-- | ||
|
||
This file is part of the Meeds project (https://meeds.io/). | ||
|
||
Copyright (C) 2020 - 2024 Meeds Association contact@meeds.io | ||
|
||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
|
||
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. | ||
|
||
--> | ||
<template> | ||
<v-btn | ||
:disabled="$root.isBulkProcessing" | ||
color="primary" | ||
elevation="0" | ||
outlined | ||
@click="$root.$emit('space-administration-apply-template-drawer-open', $root.selectedSpaces, $root.allSpacesSelected ? $root.spacesSize : $root.selectedSpaces.length, applyTemplate)"> | ||
<v-icon size="16" class="me-2">fa-sitemap</v-icon> | ||
{{ $t('social.spaces.administration.manageSpaces.applyTemplate') }} | ||
</v-btn> | ||
</template> | ||
<script> | ||
export default { | ||
data: () => ({ | ||
successMessage: null, | ||
}), | ||
methods: { | ||
applyTemplate(params) { | ||
// Workaround for context change, compute success message on processing start | ||
this.successMessage = this.$t('social.spaces.administration.manageSpaces.spaceTemplateAppliedOnSpaces'); | ||
this.$root.applyOperationInBulk( | ||
(space, options) => this.$spaceAdministrationService.applySpaceTemplate(space.id, options), | ||
params, | ||
() => { | ||
this.$root.$emit('alert-message', this.successMessage, 'success'); | ||
this.$root.$emit('spaces-administration-list-refresh'); | ||
}); | ||
}, | ||
}, | ||
}; | ||
</script> |
45 changes: 45 additions & 0 deletions
45
...apps/spaces-administration/components/bulk-action/SpacesAdministrationProcessingAlert.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!-- | ||
|
||
This file is part of the Meeds project (https://meeds.io/). | ||
|
||
Copyright (C) 2020 - 2024 Meeds Association contact@meeds.io | ||
|
||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
|
||
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. | ||
|
||
--> | ||
<template> | ||
<div class="d-flex"> | ||
<div class="me-2">{{ $t('social.spaces.administration.manageSpaces.processingSpacesBulkOperation') }}</div> | ||
<strong>{{ processedSpaces }} / {{ selectedSpacesCount }}</strong> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
props: { | ||
options: { | ||
type: Object, | ||
default: null, | ||
}, | ||
}, | ||
computed: { | ||
processedSpaces() { | ||
return this.options.processedSpaces; | ||
}, | ||
selectedSpacesCount() { | ||
return this.options.allSpacesSelected ? this.options.spacesSize : this.options.selectedSpaces.length; | ||
}, | ||
}, | ||
}; | ||
</script> |
Oops, something went wrong.