Skip to content

Commit

Permalink
Don't lose group networks when archiving.
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Nov 25, 2024
1 parent 5222a4c commit cf15de2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions resources/js/components/GroupActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ export default {
group.id = this.idgroups
group.archived_at = (new Date()).toISOString()
group.description = group.free_text
// Make sure we don't stomp on the networks.
delete group.networks
await this.$store.dispatch('groups/edit', group)
await this.$store.dispatch('groups/fetch', {
Expand Down
16 changes: 15 additions & 1 deletion resources/js/components/GroupHeading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="pl-md-4 d-flex w-xs-100 w-md-50 maybeborder pt-3 p-md-0 d-flex flex-column justify-content-center">
<div class="d-flex justify-content-between w-100">
<div class="flex-wrap">
<b>{{ group.location }}</b> <br/>
<b>{{ location }}</b> <br/>
<ExternalLink v-if="group.website" :href="group.website">{{ __('groups.website') }}</ExternalLink>
</div>
<GroupActions :idgroups="idgroups" :can-see-delete="canSeeDelete" :can-perform-delete="canPerformDelete"
Expand Down Expand Up @@ -63,6 +63,20 @@ export default {
groupImage() {
return this.group && this.group.group_image && this.group.group_image.image ? ('/uploads/mid_' + this.group.group_image.image.path) : DEFAULT_PROFILE
},
location() {
// This is a bit of finagling to deal with us not yet having full use of APIs in the client.
let ret = null
if (this.group) {
if (typeof this.group.location === 'string') {
ret = this.group.location
} else {
ret = this.group.location.name
}
}
return ret
}
},
methods: {
brokenGroupImage(event) {
Expand Down

0 comments on commit cf15de2

Please sign in to comment.