From fc19a07a400fb3fc8456a32eb8ccf5d54af3c70c Mon Sep 17 00:00:00 2001 From: zak39 Date: Wed, 13 Nov 2024 16:03:15 +0100 Subject: [PATCH] style(js,vue): Fix linter errors --- src/AlertRemoveGroup.vue | 102 ++++++------ src/GroupDetails.vue | 64 ++++---- src/GroupMenuItem.vue | 23 ++- src/LoadingUsers.vue | 64 ++++---- src/RemoveSpace.vue | 84 +++++----- src/SelectConnectedGroups.vue | 137 ++++++++-------- src/SelectUsers.vue | 173 ++++++++++----------- src/SpaceDetails.vue | 2 - src/SpaceMenuItem.vue | 3 +- src/SpaceTable.vue | 1 - src/services/groupfoldersService.js | 2 +- src/services/spaceService.js | 16 +- src/store/actions.js | 56 ++++--- src/store/getters.js | 16 +- src/store/index.js | 4 +- src/store/mutations.js | 26 ++-- src/tests/unit/groupfoldersService.test.js | 3 +- 17 files changed, 381 insertions(+), 395 deletions(-) diff --git a/src/AlertRemoveGroup.vue b/src/AlertRemoveGroup.vue index 2dd32fbe..6c582cb5 100644 --- a/src/AlertRemoveGroup.vue +++ b/src/AlertRemoveGroup.vue @@ -1,30 +1,30 @@ diff --git a/src/GroupDetails.vue b/src/GroupDetails.vue index 1c73dfbe..a1c13a1b 100644 --- a/src/GroupDetails.vue +++ b/src/GroupDetails.vue @@ -67,15 +67,15 @@ - - - + + + @@ -85,7 +85,6 @@ import AlertRemoveGroup from './AlertRemoveGroup.vue' import NcActions from '@nextcloud/vue/dist/Components/NcActions.js' import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' import NcActionInput from '@nextcloud/vue/dist/Components/NcActionInput.js' -import NcModal from '@nextcloud/vue/dist/Components/NcModal.js' import SelectUsers from './SelectUsers.vue' import UserGroup from './services/Groups/UserGroup.js' import UserTable from './UserTable.vue' @@ -93,11 +92,10 @@ import UserTable from './UserTable.vue' export default { name: 'GroupDetails', components: { - AlertRemoveGroup, + AlertRemoveGroup, NcActions, NcActionButton, NcActionInput, - NcModal, SelectUsers, UserTable, }, @@ -115,10 +113,10 @@ export default { return this.$store.getters.isSpaceAddedGroup(this.$route.params.space, decodeURIComponent(this.$route.params.slug)) }, }, - mounted() { - const space = this.$store.state.spaces[this.$route.params.space] - this.$store.dispatch('loadUsers', { space }) - }, + mounted() { + const space = this.$store.state.spaces[this.$route.params.space] + this.$store.dispatch('loadUsers', { space }) + }, methods: { deleteGroup() { // Prevents deleting GE- and U- groups @@ -136,30 +134,30 @@ export default { toggleRemoveConnectedGroupModal() { this.showRemoveConnectedGroupModal = !this.showRemoveConnectedGroupModal }, - toggleRemoveGroupModal() { + toggleRemoveGroupModal() { this.showRemoveGroupModal = !this.showRemoveGroupModal - }, + }, closeConnectedGroupModal() { this.showRemoveConnectedGroupModal = false }, - closeRemoveGroupModal() { - this.showRemoveGroupModal = false - }, + closeRemoveGroupModal() { + this.showRemoveGroupModal = false + }, removeConnectedGroup() { const space = this.$store.state.spaces[this.$route.params.space] const gid = decodeURIComponent(decodeURIComponent(this.$route.params.slug)) - this.$store.dispatch('substractionSpaceUserCount', { - spaceName: space.name, - usersCount: space.added_groups[gid].usersCount - }) - - this.$store.dispatch('substractionGroupUserCount', { - spaceName: space.name, - gid: UserGroup.getGid(space), - usersCount: space.added_groups[gid].usersCount - }) - + this.$store.dispatch('substractionSpaceUserCount', { + spaceName: space.name, + usersCount: space.added_groups[gid].usersCount + }) + + this.$store.dispatch('substractionGroupUserCount', { + spaceName: space.name, + gid: UserGroup.getGid(space), + usersCount: space.added_groups[gid].usersCount + }) + this.$store.dispatch('removeConnectedGroup', { spaceId: space.id, gid, @@ -168,7 +166,7 @@ export default { Object.keys(space.users).forEach(key => { if (space.users[key].groups.includes(gid)) { - this.$store.commit('removeUserFromWorkspace', { name: space.name, user: space.users[key] }) + this.$store.commit('removeUserFromWorkspace', { name: space.name, user: space.users[key] }) } }) diff --git a/src/GroupMenuItem.vue b/src/GroupMenuItem.vue index 071b3b37..78ff58cc 100644 --- a/src/GroupMenuItem.vue +++ b/src/GroupMenuItem.vue @@ -4,7 +4,7 @@ :to="{path: `/group/${spaceName}/${group.slug}`}" :name="group.displayName"> - {{ count }} + {{ count }} @@ -19,9 +19,9 @@ export default { NcAppNavigationItem, NcCounterBubble, }, - beforeMount() { - console.debug('Voici le groupe', this.group) - }, + beforeMount() { + console.debug('Voici le groupe', this.group) + }, props: { group: { type: Object, @@ -36,16 +36,11 @@ export default { required: false, default: false, }, - addedGroup: { - type: Boolean, - required: false, - default: false, - }, - count: { - type: Number, - required: true, - default: 0, - } + count: { + type: Number, + required: true, + default: 0, + } }, } diff --git a/src/LoadingUsers.vue b/src/LoadingUsers.vue index 842eacdb..ae7e54bf 100644 --- a/src/LoadingUsers.vue +++ b/src/LoadingUsers.vue @@ -1,14 +1,14 @@ diff --git a/src/RemoveSpace.vue b/src/RemoveSpace.vue index 2f20510a..d23a00c1 100644 --- a/src/RemoveSpace.vue +++ b/src/RemoveSpace.vue @@ -1,46 +1,46 @@ @@ -80,13 +80,13 @@ export default { flex-direction: column; align-items: center; justify-content: center; - width: 600px; - height: 100%; + width: 600px; + height: 100%; } .remove-modal :deep(.modal-wrapper .modal-container) { - height: 200px; - min-width: 600px; + height: 200px; + min-width: 600px; } .remove-modal :deep(.modal-wrapper .modal-container .modal__content h2) { @@ -96,7 +96,7 @@ export default { } .remove-modal { - min-height: 8rem; + min-height: 8rem; } .remove-space-actions { margin-top: 1.5rem; diff --git a/src/SelectConnectedGroups.vue b/src/SelectConnectedGroups.vue index 84daf852..083c9851 100644 --- a/src/SelectConnectedGroups.vue +++ b/src/SelectConnectedGroups.vue @@ -1,61 +1,62 @@ @@ -154,7 +155,7 @@ export default {