Skip to content

Commit

Permalink
style(js,vue): Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zak39 committed Nov 13, 2024
1 parent b878a14 commit fc19a07
Show file tree
Hide file tree
Showing 17 changed files with 381 additions and 395 deletions.
102 changes: 51 additions & 51 deletions src/AlertRemoveGroup.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
<template>
<NcModal
size="small">
<div class="container-modal-remove">
<NcNoteCard type="warning">
<p>{{ message }}</p>
</NcNoteCard>
<div class="container-buttons-remove">
<NcButton
aria-label="cancel"
type="secondary"
@click="cancel()" >
<template>
{{ t('workspace', 'Cancel') }}
</template>
</NcButton>
<NcButton
aria-label="confirm"
type="primary"
@click="removeGroup()" >
<template>
{{ t('workspace', 'Confirm') }}
</template>
</NcButton>
</div>
</div>
</NcModal>
<NcModal
size="small">
<div class="container-modal-remove">
<NcNoteCard type="warning">
<p>{{ message }}</p>
</NcNoteCard>
<div class="container-buttons-remove">
<NcButton
aria-label="cancel"
type="secondary"
@click="cancel()" >

Check warning on line 12 in src/AlertRemoveGroup.vue

View workflow job for this annotation

GitHub Actions / lint

Expected no space before '>', but found
<template>

Check warning on line 13 in src/AlertRemoveGroup.vue

View workflow job for this annotation

GitHub Actions / lint

`<template>` require directive
{{ t('workspace', 'Cancel') }}
</template>
</NcButton>
<NcButton
aria-label="confirm"
type="primary"
@click="removeGroup()" >

Check warning on line 20 in src/AlertRemoveGroup.vue

View workflow job for this annotation

GitHub Actions / lint

Expected no space before '>', but found
<template>

Check warning on line 21 in src/AlertRemoveGroup.vue

View workflow job for this annotation

GitHub Actions / lint

`<template>` require directive
{{ t('workspace', 'Confirm') }}
</template>
</NcButton>
</div>
</div>
</NcModal>
</template>

<script>
Expand All @@ -33,39 +33,39 @@ import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
export default {
name: 'AlertRemoveGroup',
components: {
NcButton,
NcNoteCard,
NcModal
},
props: {
message: {
type: String,
required: true,
},
},
methods: {
cancel() {
this.$emit('cancel')
},
removeGroup() {
this.$emit('remove-group')
}
}
name: 'AlertRemoveGroup',
components: {
NcButton,
NcNoteCard,
NcModal

Check warning on line 40 in src/AlertRemoveGroup.vue

View workflow job for this annotation

GitHub Actions / lint

Missing trailing comma
},
props: {
message: {
type: String,
required: true,
},
},
methods: {
cancel() {
this.$emit('cancel')
},
removeGroup() {
this.$emit('remove-group')
}

Check warning on line 54 in src/AlertRemoveGroup.vue

View workflow job for this annotation

GitHub Actions / lint

Missing trailing comma
}

Check warning on line 55 in src/AlertRemoveGroup.vue

View workflow job for this annotation

GitHub Actions / lint

Missing trailing comma
}
</script>

<style scoped>
.container-buttons-remove {
display: flex;
justify-content: space-between;
margin-top: 24px;
display: flex;
justify-content: space-between;
margin-top: 24px;
}
.container-modal-remove {
padding: 24px;
margin-top: 20px;
padding: 24px;
margin-top: 20px;
}
</style>
64 changes: 31 additions & 33 deletions src/GroupDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
</div>
</div>
<UserTable :space-name="decodeURIComponent(decodeURIComponent($route.params.slug))" :editable="!isAddedGroup" />
<SelectUsers v-if="showSelectUsersModal" :space-name="decodeURIComponent(decodeURIComponent($route.params.slug))" @close="toggleShowSelectUsersModal" />
<AlertRemoveGroup v-if="showRemoveConnectedGroupModal"
:message="t('workspace', 'Please, note that once {groupname} group has been removed, its users will lose access to the {spacename} workspace', { groupname: decodeURIComponent(decodeURIComponent($route.params.slug)), spacename: this.$route.params.space })"
@cancel="closeConnectedGroupModal"
@remove-group="removeConnectedGroup" />
<AlertRemoveGroup v-if="showRemoveGroupModal"
:message="t('workspace', 'Attention, après la suppression du groupe {groupname}, ses utilisateurs conserveront l\'accès à l\'espace de travail {spacename}', { groupname: decodeURIComponent(decodeURIComponent($route.params.slug)), spacename: this.$route.params.space })"
@cancel="closeRemoveGroupModal"
@remove-group="deleteGroup" />
<SelectUsers v-if="showSelectUsersModal" :space-name="decodeURIComponent(decodeURIComponent($route.params.slug))" @close="toggleShowSelectUsersModal" />
<AlertRemoveGroup v-if="showRemoveConnectedGroupModal"
:message="t('workspace', 'Please, note that once {groupname} group has been removed, its users will lose access to the {spacename} workspace', { groupname: decodeURIComponent(decodeURIComponent($route.params.slug)), spacename: this.$route.params.space })"

Check warning on line 72 in src/GroupDetails.vue

View workflow job for this annotation

GitHub Actions / lint

Unexpected usage of 'this'
@cancel="closeConnectedGroupModal"
@remove-group="removeConnectedGroup" />
<AlertRemoveGroup v-if="showRemoveGroupModal"
:message="t('workspace', 'Attention, après la suppression du groupe {groupname}, ses utilisateurs conserveront l\'accès à l\'espace de travail {spacename}', { groupname: decodeURIComponent(decodeURIComponent($route.params.slug)), spacename: this.$route.params.space })"

Check warning on line 76 in src/GroupDetails.vue

View workflow job for this annotation

GitHub Actions / lint

Unexpected usage of 'this'
@cancel="closeRemoveGroupModal"
@remove-group="deleteGroup" />
</div>
</template>

Expand All @@ -85,19 +85,17 @@ 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'

export default {
name: 'GroupDetails',
components: {
AlertRemoveGroup,
AlertRemoveGroup,
NcActions,
NcActionButton,
NcActionInput,
NcModal,
SelectUsers,
UserTable,
},
Expand All @@ -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
Expand All @@ -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

Check warning on line 152 in src/GroupDetails.vue

View workflow job for this annotation

GitHub Actions / lint

Missing trailing comma
})

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,
Expand All @@ -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] })
}
})

Expand Down
23 changes: 9 additions & 14 deletions src/GroupMenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:to="{path: `/group/${spaceName}/${group.slug}`}"
:name="group.displayName">
<NcCounterBubble slot="counter" class="user-counter">
{{ count }}
{{ count }}
</NcCounterBubble>
</NcAppNavigationItem>
</template>
Expand All @@ -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,
Expand All @@ -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,
}
},
}
</script>
Expand Down
64 changes: 32 additions & 32 deletions src/LoadingUsers.vue
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
<template>
<div>
<NcEmptyContent>
<template #icon>
<NcLoadingIcon :size="64" appearance="dark" name="Loading on light background" />
</template>
<template #description v-if="isLoadingUsers" >
<p>{{ message }}</p>
</template>
</NcEmptyContent>
</div>
<div>
<NcEmptyContent>
<template #icon>
<NcLoadingIcon :size="64" appearance="dark" name="Loading on light background" />
</template>
<template #description v-if="isLoadingUsers" >
<p>{{ message }}</p>
</template>
</NcEmptyContent>
</div>
</template>

<script>
import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
export default {
name: 'LoadingUsers',
components: {
NcEmptyContent,
NcLoadingIcon,
},
props: {
loadUsers: {
type: Boolean,
required: false,
default: false
},
message: {
type: String,
required: false,
default: 'En attente'
}
},
computed: {
isLoadingUsers() {
return this.loadUsers
}
}
name: 'LoadingUsers',
components: {
NcEmptyContent,
NcLoadingIcon,
},
props: {
loadUsers: {
type: Boolean,
required: false,
default: false
},
message: {
type: String,
required: false,
default: 'En attente'
}
},
computed: {
isLoadingUsers() {
return this.loadUsers
}
}
}
</script>

Expand Down
Loading

0 comments on commit fc19a07

Please sign in to comment.