-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[full-ci] Rename groups + refactoring (#8715)
- Loading branch information
Jan
authored
Apr 3, 2023
1 parent
e4a07f2
commit 2a2d196
Showing
21 changed files
with
460 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
packages/web-app-admin-settings/src/components/Groups/SideBar/GroupInfoBox.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template> | ||
<div class="oc-flex group-info oc-mb-l"> | ||
<avatar-image class="oc-mb-m" :width="80" :userid="_group.id" :user-name="_group.displayName" /> | ||
<span class="oc-text-muted group-info-display-name" v-text="_group.displayName"></span> | ||
<span class="oc-text-muted" v-text="groupMembersText"></span> | ||
</div> | ||
</template> | ||
<script lang="ts"> | ||
import { computed, defineComponent, PropType, unref } from 'vue' | ||
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() | ||
const groupMembersText = computed(() => { | ||
return $ngettext( | ||
'%{groupCount} member', | ||
'%{groupCount} members', | ||
unref(_group).members.length, | ||
{ | ||
groupCount: unref(_group).members.length.toString() | ||
} | ||
) | ||
}) | ||
return { | ||
groupMembersText, | ||
_group | ||
} | ||
} | ||
}) | ||
</script> | ||
<style lang="scss"> | ||
.gr-info { | ||
align-items: center; | ||
flex-direction: column; | ||
} | ||
.group-info-display-name { | ||
font-size: 1.5rem; | ||
} | ||
</style> |
1 change: 1 addition & 0 deletions
1
packages/web-app-admin-settings/src/composables/actions/groups/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './useGroupActionsDelete' | ||
export * from './useGroupActionsEdit' |
27 changes: 27 additions & 0 deletions
27
packages/web-app-admin-settings/src/composables/actions/groups/useGroupActionsEdit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { eventBus } from 'web-pkg' | ||
import { SideBarEventTopics } from 'web-pkg/src/composables/sideBar' | ||
import { useGettext } from 'vue3-gettext' | ||
import { computed } from 'vue' | ||
import { GroupAction } from 'web-pkg/src/composables/actions' | ||
|
||
export const useGroupActionsEdit = () => { | ||
const { $gettext } = useGettext() | ||
|
||
const actions = computed((): GroupAction[] => [ | ||
{ | ||
name: 'edit', | ||
icon: 'pencil', | ||
label: () => $gettext('Edit'), | ||
handler: () => eventBus.publish(SideBarEventTopics.openWithPanel, 'EditPanel'), | ||
isEnabled: ({ resources }) => { | ||
return resources.length > 0 | ||
}, | ||
componentType: 'button', | ||
class: 'oc-groups-actions-edit-trigger' | ||
} | ||
]) | ||
|
||
return { | ||
actions | ||
} | ||
} |
Oops, something went wrong.