From bf60c418054a695c322b4737352c424539503caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 28 Sep 2022 07:22:56 +0200 Subject: [PATCH 01/40] Overtake 'GroupContentMenu' from branch '5344-add-group-members-management' --- .../components/Group/GroupContentMenu.spec.js | 35 +++++++ webapp/components/Group/GroupContentMenu.vue | 99 +++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 webapp/components/Group/GroupContentMenu.spec.js create mode 100644 webapp/components/Group/GroupContentMenu.vue diff --git a/webapp/components/Group/GroupContentMenu.spec.js b/webapp/components/Group/GroupContentMenu.spec.js new file mode 100644 index 000000000..69c13e6f0 --- /dev/null +++ b/webapp/components/Group/GroupContentMenu.spec.js @@ -0,0 +1,35 @@ +import { mount } from '@vue/test-utils' +import GroupContentMenu from './GroupContentMenu.vue' + +const localVue = global.localVue + +const propsData = { + resource: {}, + group: {}, + resourceType: 'group', +} + +describe('GroupContentMenu', () => { + let wrapper + let mocks + + beforeEach(() => { + mocks = { + $t: jest.fn(), + } + }) + + describe('mount', () => { + const Wrapper = () => { + return mount(GroupContentMenu, { propsData, mocks, localVue }) + } + + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders', () => { + expect(wrapper.findAll('.group-menu')).toHaveLength(1) + }) + }) +}) diff --git a/webapp/components/Group/GroupContentMenu.vue b/webapp/components/Group/GroupContentMenu.vue new file mode 100644 index 000000000..cfebe65a4 --- /dev/null +++ b/webapp/components/Group/GroupContentMenu.vue @@ -0,0 +1,99 @@ + + + + + From 6364974b71ef407dc8ddeea5b726e02c796bfccb Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 28 Sep 2022 10:15:39 +0200 Subject: [PATCH 02/40] add editor component for GroupForm.vue --- webapp/components/Group/GroupForm.vue | 28 ++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/webapp/components/Group/GroupForm.vue b/webapp/components/Group/GroupForm.vue index 8a9638b1a..0923d6fc2 100644 --- a/webapp/components/Group/GroupForm.vue +++ b/webapp/components/Group/GroupForm.vue @@ -24,12 +24,16 @@ - + + + {{ `${contentLength} / ${descriptionMin}` }} + + Date: Wed, 28 Sep 2022 10:17:29 +0200 Subject: [PATCH 03/40] delete unused code --- webapp/components/Group/GroupForm.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/webapp/components/Group/GroupForm.vue b/webapp/components/Group/GroupForm.vue index 0923d6fc2..45fd428e1 100644 --- a/webapp/components/Group/GroupForm.vue +++ b/webapp/components/Group/GroupForm.vue @@ -48,8 +48,6 @@ :existingCategoryIds="formData.categoryIds" /> -
{{ formData }}
- Reset form Date: Wed, 28 Sep 2022 12:01:27 +0200 Subject: [PATCH 04/40] Remove 'gost' property from 'ContentMenu' button --- webapp/components/ContentMenu/ContentMenu.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/webapp/components/ContentMenu/ContentMenu.vue b/webapp/components/ContentMenu/ContentMenu.vue index 88d83d059..60bcccf43 100644 --- a/webapp/components/ContentMenu/ContentMenu.vue +++ b/webapp/components/ContentMenu/ContentMenu.vue @@ -7,7 +7,6 @@ icon="ellipsis-v" size="small" circle - ghost @click.prevent="toggleMenu()" /> From 1e01ccfa7184a866fb21cd2f1f19242bfae130b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 28 Sep 2022 12:02:41 +0200 Subject: [PATCH 05/40] Add 'GroupContentMenu' on group profile page --- webapp/components/Group/GroupContentMenu.vue | 9 ++++--- webapp/pages/group/_id/_slug.vue | 28 ++++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/webapp/components/Group/GroupContentMenu.vue b/webapp/components/Group/GroupContentMenu.vue index cfebe65a4..97a884698 100644 --- a/webapp/components/Group/GroupContentMenu.vue +++ b/webapp/components/Group/GroupContentMenu.vue @@ -1,5 +1,5 @@ @@ -167,8 +182,17 @@ export default { categoriesActive: this.$env.CATEGORIES_ACTIVE, disabled: false, descriptionMin: 50, - groupTypeOptions: ['public', 'closed', 'hidden'], - actionRadiusOptions: ['regional', 'national', 'continental', 'global'], + groupTypeOptions: [ + 'public', + 'closed', + 'hidden' + ], + actionRadiusOptions: [ + 'regional', + 'national', + 'continental', + 'global' + ], loadingGeo: false, cities: [], formData: { @@ -317,16 +341,12 @@ export default { From f21796b5e2f681f9e6e3f679205707f6274eef0f Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 28 Sep 2022 15:20:51 +0200 Subject: [PATCH 08/40] delete location entry per button --- webapp/components/Group/GroupForm.vue | 49 ++++++++++++--------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/webapp/components/Group/GroupForm.vue b/webapp/components/Group/GroupForm.vue index 516e0895f..b82b3953c 100644 --- a/webapp/components/Group/GroupForm.vue +++ b/webapp/components/Group/GroupForm.vue @@ -8,11 +8,14 @@ @submit="submit" > @@ -175,17 +173,8 @@ export default { categoriesActive: this.$env.CATEGORIES_ACTIVE, disabled: false, descriptionMin: 50, - groupTypeOptions: [ - 'public', - 'closed', - 'hidden' - ], - actionRadiusOptions: [ - 'regional', - 'national', - 'continental', - 'global' - ], + groupTypeOptions: ['public', 'closed', 'hidden'], + actionRadiusOptions: ['regional', 'national', 'continental', 'global'], loadingGeo: false, cities: [], formData: { @@ -223,7 +212,6 @@ export default { } }, computed: { - contentLength() { return this.$filters.removeHtml(this.formData.description).length }, @@ -334,12 +322,9 @@ export default { From 2eda102a71c2b2465effdea7ccf33c6789f5ac0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 28 Sep 2022 16:37:46 +0200 Subject: [PATCH 10/40] Remove doubled 'GroupButton' --- webapp/layouts/default.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/webapp/layouts/default.vue b/webapp/layouts/default.vue index 9a1e87fe1..6fb3a2f54 100644 --- a/webapp/layouts/default.vue +++ b/webapp/layouts/default.vue @@ -91,9 +91,6 @@ - - - From ac9be9e2a3fd74f5a02fa194273491f8b9ba67db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 28 Sep 2022 16:38:56 +0200 Subject: [PATCH 11/40] Refactor 'GroupContentMenu' component --- webapp/components/Group/GroupContentMenu.vue | 27 ++++++++------------ webapp/components/Group/GroupTeaser.vue | 7 +---- webapp/pages/group/_id/_slug.vue | 4 +-- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/webapp/components/Group/GroupContentMenu.vue b/webapp/components/Group/GroupContentMenu.vue index 929232bfe..7a7737320 100644 --- a/webapp/components/Group/GroupContentMenu.vue +++ b/webapp/components/Group/GroupContentMenu.vue @@ -47,34 +47,27 @@ export default { return value.match(/(groupTeaser|groupProfile)/) }, }, - resource: { type: Object, required: true }, - resourceType: { - type: String, - required: true, - validator: (value) => { - return value.match(/(group)/) - }, - }, + group: { type: Object, required: true }, placement: { type: String, default: 'bottom-end' }, }, computed: { routes() { const routes = [] - if (this.resourceType === 'group') { + if (this.usage !== 'groupProfile') { routes.push({ label: this.$t('group.contentMenu.visitGroupPage'), icon: 'home', name: 'group-id-slug', - params: { id: this.resource.id, slug: this.resource.slug }, + params: { id: this.group.id, slug: this.group.slug }, + }) + } + if (this.group.myRole === 'owner') { + routes.push({ + label: this.$t('admin.settings.name'), + path: `/group/edit/${this.group.id}`, + icon: 'edit', }) - if (this.resource.myRole === 'owner') { - routes.push({ - label: this.$t('admin.settings.name'), - path: `/group/edit/${this.resource.id}`, - icon: 'edit', - }) - } } return routes diff --git a/webapp/components/Group/GroupTeaser.vue b/webapp/components/Group/GroupTeaser.vue index 1b9ede71e..4d50c1181 100644 --- a/webapp/components/Group/GroupTeaser.vue +++ b/webapp/components/Group/GroupTeaser.vue @@ -58,12 +58,7 @@
- +