-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Space Template Menu Item Extension - MEED-7669 - Meeds-io/M…
…IPs#165 (#241) This change will allow to edit Space Template Navigation through the Site Navigation Editor.
- Loading branch information
Showing
8 changed files
with
161 additions
and
11 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
1 change: 1 addition & 0 deletions
1
layout-webapp/src/main/resources/locale/portlet/SiteManagement_en.properties
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
81 changes: 81 additions & 0 deletions
81
...c/main/webapp/vue-app/site-navigation/components/SpaceTemplateEditLayoutSpaceMenuItem.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,81 @@ | ||
<!-- | ||
This file is part of the Meeds project (https://meeds.io/). | ||
Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
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-tooltip v-if="spaceTemplate.layout" :disabled="!spaceTemplate.system" bottom> | ||
<template #activator="{ on, attrs }"> | ||
<div | ||
v-on="on" | ||
v-bind="attrs"> | ||
<v-list-item | ||
:disabled="spaceTemplate.system" | ||
dense | ||
@click="openSiteNavigationDrawer"> | ||
<v-icon | ||
:class="spaceTemplate.system && 'disabled--text'" | ||
size="13"> | ||
fa-columns | ||
</v-icon> | ||
<v-list-item-title class="ps-2"> | ||
<span :class="spaceTemplate.system && 'disabled--text'">{{ $t('spaceTemplate.label.editLayout') }}</span> | ||
</v-list-item-title> | ||
</v-list-item> | ||
</div> | ||
</template> | ||
<span>{{ $t('spaceTemplate.label.system.noEditLayout') }}</span> | ||
</v-tooltip> | ||
</template> | ||
<script> | ||
export default { | ||
props: { | ||
spaceTemplate: { | ||
type: Object, | ||
default: null, | ||
}, | ||
}, | ||
data: () => ({ | ||
site: null, | ||
}), | ||
beforeDestroy() { | ||
this.$emit('loading', false); | ||
}, | ||
methods: { | ||
async openSiteNavigationDrawer() { | ||
this.$emit('loading', true); | ||
try { | ||
if (!this.site) { | ||
this.site = await this.$siteService.getSite('group_template', this.spaceTemplate?.layout, { | ||
expandNavigations: false, | ||
}); | ||
} | ||
document.dispatchEvent(new CustomEvent('open-site-navigation-drawer',{detail: { | ||
siteName: this.site.name, | ||
siteType: this.site.siteType, | ||
siteId: this.site.siteId, | ||
siteLabel: this.spaceTemplate?.name, | ||
includeGlobal: false, | ||
}})); | ||
} finally { | ||
this.$emit('loading', false); | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> |
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