Skip to content

Commit 8d0746f

Browse files
authored
Merge pull request #43804 from nextcloud/fix/a11y/groups-heading
fix(settings): Split group lists
2 parents abfbe67 + 39e8c35 commit 8d0746f

6 files changed

Lines changed: 49 additions & 44 deletions

File tree

apps/settings/src/views/Users.vue

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</template>
3535
</NcAppNavigationNew>
3636

37-
<template #list>
37+
<NcAppNavigationList>
3838
<NcAppNavigationItem id="everyone"
3939
:exact="true"
4040
:name="t('settings', 'Active accounts')"
@@ -79,41 +79,44 @@
7979
</NcCounterBubble>
8080
</template>
8181
</NcAppNavigationItem>
82+
</NcAppNavigationList>
83+
84+
<NcAppNavigationCaption :name="t('settings', 'Groups')"
85+
:disabled="loadingAddGroup"
86+
:aria-label="loadingAddGroup ? t('settings', 'Creating group …') : t('settings', 'Create group')"
87+
force-menu
88+
is-heading
89+
:open.sync="isAddGroupOpen">
90+
<template #actionsTriggerIcon>
91+
<NcLoadingIcon v-if="loadingAddGroup" />
92+
<Plus v-else :size="20" />
93+
</template>
94+
<template #actions>
95+
<NcActionText>
96+
<template #icon>
97+
<AccountGroup :size="20" />
98+
</template>
99+
{{ t('settings', 'Create group') }}
100+
</NcActionText>
101+
<NcActionInput :label="t('settings', 'Group name')"
102+
data-cy-settings-new-group-name
103+
:label-outside="false"
104+
:disabled="loadingAddGroup"
105+
:value.sync="newGroupName"
106+
:error="hasAddGroupError"
107+
:helper-text="hasAddGroupError ? t('settings', 'Please enter a valid group name') : ''"
108+
@submit="createGroup" />
109+
</template>
110+
</NcAppNavigationCaption>
82111

83-
<NcAppNavigationCaption :name="t('settings', 'Groups')"
84-
:disabled="loadingAddGroup"
85-
:aria-label="loadingAddGroup ? t('settings', 'Creating group …') : t('settings', 'Create group')"
86-
force-menu
87-
:open.sync="isAddGroupOpen">
88-
<template #actionsTriggerIcon>
89-
<NcLoadingIcon v-if="loadingAddGroup" />
90-
<Plus v-else :size="20" />
91-
</template>
92-
<template #actions>
93-
<NcActionText>
94-
<template #icon>
95-
<AccountGroup :size="20" />
96-
</template>
97-
{{ t('settings', 'Create group') }}
98-
</NcActionText>
99-
<NcActionInput :label="t('settings', 'Group name')"
100-
data-cy-settings-new-group-name
101-
:label-outside="false"
102-
:disabled="loadingAddGroup"
103-
:value.sync="newGroupName"
104-
:error="hasAddGroupError"
105-
:helper-text="hasAddGroupError ? t('settings', 'Please enter a valid group name') : ''"
106-
@submit="createGroup" />
107-
</template>
108-
</NcAppNavigationCaption>
109-
112+
<NcAppNavigationList>
110113
<GroupListItem v-for="group in groupList"
111114
:id="group.id"
112115
:key="group.id"
113116
:active="selectedGroupDecoded === group.id"
114117
:name="group.title"
115118
:count="group.count" />
116-
</template>
119+
</NcAppNavigationList>
117120

118121
<template #footer>
119122
<ul class="app-navigation-entry__settings">
@@ -150,6 +153,7 @@ import NcAppContent from '@nextcloud/vue/dist/Components/NcAppContent.js'
150153
import NcAppNavigation from '@nextcloud/vue/dist/Components/NcAppNavigation.js'
151154
import NcAppNavigationCaption from '@nextcloud/vue/dist/Components/NcAppNavigationCaption.js'
152155
import NcAppNavigationItem from '@nextcloud/vue/dist/Components/NcAppNavigationItem.js'
156+
import NcAppNavigationList from '@nextcloud/vue/dist/Components/NcAppNavigationList.js'
153157
import NcAppNavigationNew from '@nextcloud/vue/dist/Components/NcAppNavigationNew.js'
154158
import NcContent from '@nextcloud/vue/dist/Components/NcContent.js'
155159
import NcCounterBubble from '@nextcloud/vue/dist/Components/NcCounterBubble.js'
@@ -182,6 +186,7 @@ export default {
182186
NcAppNavigation,
183187
NcAppNavigationCaption,
184188
NcAppNavigationItem,
189+
NcAppNavigationList,
185190
NcAppNavigationNew,
186191
NcContent,
187192
NcCounterBubble,

cypress/e2e/settings/users_groups.cy.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('Settings: Create groups', () => {
5454
handlePasswordConfirmation(admin.password)
5555

5656
// see that the created group is in the list
57-
cy.get('ul.app-navigation__list').within(() => {
57+
cy.get('ul.app-navigation-list').within(() => {
5858
// see that the list of groups contains the group foo
5959
cy.contains(groupName).should('exist')
6060
})
@@ -76,8 +76,8 @@ describe('Settings: Assign user to a group', { testIsolation: false }, () => {
7676
})
7777

7878
it('see that the group is in the list', () => {
79-
cy.get('ul.app-navigation__list').contains('li', groupName).should('exist')
80-
cy.get('ul.app-navigation__list').contains('li', groupName).within(() => {
79+
cy.get('ul.app-navigation-list').contains('li', groupName).should('exist')
80+
cy.get('ul.app-navigation-list').contains('li', groupName).within(() => {
8181
cy.get('.counter-bubble__counter')
8282
.should('not.exist') // is hidden when 0
8383
})
@@ -118,7 +118,7 @@ describe('Settings: Assign user to a group', { testIsolation: false }, () => {
118118

119119
it('see the group was successfully assigned', () => {
120120
// see a new memeber
121-
cy.get('ul.app-navigation__list')
121+
cy.get('ul.app-navigation-list')
122122
.contains('li', groupName)
123123
.find('.counter-bubble__counter')
124124
.should('contain', '1')
@@ -142,7 +142,7 @@ describe('Settings: Delete an empty group', { testIsolation: false }, () => {
142142
})
143143

144144
it('see that the group is in the list', () => {
145-
cy.get('ul.app-navigation__list').within(() => {
145+
cy.get('ul.app-navigation-list').within(() => {
146146
// see that the list of groups contains the group foo
147147
cy.contains(groupName).should('exist').scrollIntoView()
148148
// open the actions menu for the group
@@ -163,7 +163,7 @@ describe('Settings: Delete an empty group', { testIsolation: false }, () => {
163163
})
164164

165165
it('deleted group is not shown anymore', () => {
166-
cy.get('ul.app-navigation__list').within(() => {
166+
cy.get('ul.app-navigation-list').within(() => {
167167
// see that the list of groups does not contain the group
168168
cy.contains(groupName).should('not.exist')
169169
})
@@ -192,12 +192,12 @@ describe('Settings: Delete a non empty group', () => {
192192

193193
it('see that the group is in the list', () => {
194194
// see that the list of groups contains the group
195-
cy.get('ul.app-navigation__list').contains('li', groupName).should('exist').scrollIntoView()
195+
cy.get('ul.app-navigation-list').contains('li', groupName).should('exist').scrollIntoView()
196196
})
197197

198198
it('can delete the group', () => {
199199
// open the menu
200-
cy.get('ul.app-navigation__list')
200+
cy.get('ul.app-navigation-list')
201201
.contains('li', groupName)
202202
.find('button.action-item__menutoggle')
203203
.click({ force: true })
@@ -212,7 +212,7 @@ describe('Settings: Delete a non empty group', () => {
212212
})
213213

214214
it('deleted group is not shown anymore', () => {
215-
cy.get('ul.app-navigation__list').within(() => {
215+
cy.get('ul.app-navigation-list').within(() => {
216216
// see that the list of groups does not contain the group foo
217217
cy.contains(groupName).should('not.exist')
218218
})

dist/settings-users-3239.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-users-3239.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-apps-users-management.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-apps-users-management.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)