Skip to content

Commit

Permalink
feat: Retrieve and Filter on displayed Sites of type PORTAL only - ME…
Browse files Browse the repository at this point in the history
…ED-7682 - Meeds-io/MIPs#165

This change will filter the list of sites to retrieve sites of type 'PORTAL' only and to display sites which isn't attached to Spaces as public sites.
  • Loading branch information
boubaker committed Oct 29, 2024
1 parent 4b66e2d commit 5baf51c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default {
data() {
return {
sites: [],
loading: 0,
siteToDelete: null,
deleteConfirmMessage: '',
};
Expand All @@ -55,23 +56,22 @@ export default {
},
methods: {
getSites() {
this.loading = true;
return this.$siteService.getSites(null, 'USER', null, true, true, false, false, false, null, true)
.then(sites => {
this.sites = sites || [];
})
.finally(() => this.loading = false);
this.loading++;
return this.$siteService.getSites('PORTAL', null, 'public', true, true, false, false, false, null, true)
.then(sites => this.sites = sites?.filter(s => !s?.properties?.IS_SPACE_PUBLIC_SITE) || [])
.finally(() => this.loading--);
},
confirmDelete(siteToDelete) {
this.siteToDelete = siteToDelete;
this.deleteConfirmMessage = this.$t('siteManagement.label.confirmDelete.message', {0: this.siteToDelete.name});
this.$refs.deleteSiteConfirmDialog.open();
},
deleteSite() {
this.loading++;
return this.$siteLayoutService.deleteSite(this.siteToDelete.siteType, this.siteToDelete.name)
.then(() => {
this.$root.$emit('refresh-sites');
});}
.then(() => this.$root.$emit('refresh-sites'))
.finally(() => this.loading--);
},
}
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
</v-row>
</v-layout>
</template>

<script>
export default {
props: {
Expand Down

0 comments on commit 5baf51c

Please sign in to comment.