Skip to content

Commit

Permalink
Fix unit tests for group panels
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Apr 3, 2023
1 parent bdefcca commit 2637685
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
2 changes: 2 additions & 0 deletions changelog/unreleased/enhancement-enable-rename-groups
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Enhancement: Enable rename groups

Groups can now be renamed via the admin-settings.

https://github.com/owncloud/web/pull/8715
https://github.com/owncloud/web/issues/8714
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,28 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { defineComponent, ref } from 'vue'
import { Group } from 'web-client/src/generated'
import { useClientService } from 'web-pkg'
import { MaybeRef, useClientService } from 'web-pkg'
export default defineComponent({
name: 'CreateGroupModal',
emits: ['cancel', 'confirm'],
setup() {
const clientService = useClientService()
const group: MaybeRef<Group> = ref({ displayName: '' })
const formData = ref({
displayName: {
errorMessage: '',
valid: false
}
})
return {
clientService
}
},
data: function () {
return {
formData: {
displayName: {
errorMessage: '',
valid: false
}
},
group: {
displayName: ''
} as Group
clientService,
group,
formData
}
},
computed: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div id="group-edit-panel" class="oc-mt-xl">
<GroupInfoBox :group="group" />
<group-info-box :group="group" />
<form id="group-edit-form" class="oc-background-highlight oc-p-m" autocomplete="off">
<oc-text-input
v-model="editGroup.displayName"
id="displayName-input"
v-model="editGroup.displayName"
class="oc-mb-s"
:label="$gettext('Group name')"
:error-message="formData.displayName.errorMessage"
Expand All @@ -23,10 +23,10 @@
</div>
</template>
<script lang="ts">
import { defineComponent, PropType } from 'vue'
import { defineComponent, PropType, ref } from 'vue'
import { Group } from 'web-client/src/generated'
import CompareSaveDialog from 'web-pkg/src/components/sideBar/CompareSaveDialog.vue'
import { useClientService } from 'web-pkg'
import { MaybeRef, useClientService } from 'web-pkg'
import GroupInfoBox from './GroupInfoBox.vue'
export default defineComponent({
Expand All @@ -45,19 +45,19 @@ export default defineComponent({
emits: ['confirm'],
setup() {
const clientService = useClientService()
return {
clientService
}
},
data() {
return {
editGroup: {} as Group,
formData: {
displayName: {
errorMessage: '',
valid: true
}
const editGroup: MaybeRef<Group> = ref({})
const formData = ref({
displayName: {
errorMessage: '',
valid: true
}
})
return {
clientService,
editGroup,
formData
}
},
computed: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import { Group } from 'web-client/src/generated'
import { useGettext } from 'vue3-gettext'
export default defineComponent({
name: 'GroupInfoBox',
props: {
group: {
type: Object as PropType<Group>,
required: true
}
},
setup(props) {
const _group = computed<Group>(() => props.group)
const { $ngettext } = useGettext()
Expand All @@ -29,12 +35,6 @@ export default defineComponent({
groupMembersText,
_group
}
},
props: {
group: {
type: Object as PropType<Group>,
required: true
}
}
})
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { eventBus } from 'web-pkg'
import { SideBarEventTopics } from 'web-pkg/src/composables/sideBar'
import { useGettext } from 'vue3-gettext'
import { computed } from 'vue'
import { UserAction } from 'web-pkg/src/composables/actions'
import { GroupAction } from 'web-pkg/src/composables/actions'

export const useGroupActionsEdit = () => {
const { $gettext } = useGettext()
Expand Down

0 comments on commit 2637685

Please sign in to comment.