Skip to content

Commit 415ecb1

Browse files
committed
feat: remove password column from user table
Signed-off-by: mykh-hailo <kristianderonta0205@gmail.com>
1 parent 2d91bdd commit 415ecb1

File tree

10 files changed

+16
-126
lines changed

10 files changed

+16
-126
lines changed

apps/settings/src/components/UserList.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
:extra-props="{
3838
users,
3939
settings,
40-
hasObfuscated,
4140
quotaOptions,
4241
languages,
4342
externalActions,
@@ -50,7 +49,7 @@
5049
</template>
5150

5251
<template #header>
53-
<UserListHeader :has-obfuscated="hasObfuscated" />
52+
<UserListHeader />
5453
</template>
5554

5655
<template #footer>
@@ -77,7 +76,7 @@ import UserListHeader from './Users/UserListHeader.vue'
7776
import UserRow from './Users/UserRow.vue'
7877
import VirtualList from './Users/VirtualList.vue'
7978
import logger from '../logger.ts'
80-
import { defaultQuota, isObfuscated, unlimitedQuota } from '../utils/userUtils.ts'
79+
import { defaultQuota, unlimitedQuota } from '../utils/userUtils.ts'
8180
8281
const newUser = Object.freeze({
8382
id: '',
@@ -159,10 +158,6 @@ export default {
159158
}
160159
},
161160
162-
hasObfuscated() {
163-
return this.filteredUsers.some((user) => isObfuscated(user))
164-
},
165-
166161
users() {
167162
return this.$store.getters.getUsers
168163
},

apps/settings/src/components/Users/UserListHeader.vue

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,14 @@
2929
{{ t('settings', 'Account name') }}
3030
</span>
3131
</th>
32-
<th
33-
class="header__cell"
34-
:class="{ 'header__cell--obfuscated': hasObfuscated }"
35-
data-cy-user-list-header-password
36-
scope="col">
37-
<span>{{ passwordLabel }}</span>
38-
</th>
3932
<th
4033
class="header__cell"
4134
data-cy-user-list-header-email
4235
scope="col">
4336
<span>{{ t('settings', 'Email') }}</span>
4437
</th>
4538
<th
46-
class="header__cell header__cell--large"
39+
class="header__cell header__cell--groups"
4740
data-cy-user-list-header-groups
4841
scope="col">
4942
<span>{{ t('settings', 'Groups') }}</span>
@@ -121,13 +114,6 @@ import Vue from 'vue'
121114
export default Vue.extend({
122115
name: 'UserListHeader',
123116
124-
props: {
125-
hasObfuscated: {
126-
type: Boolean,
127-
required: true,
128-
},
129-
},
130-
131117
computed: {
132118
showConfig() {
133119
// @ts-expect-error: allow untyped $store
@@ -138,14 +124,6 @@ export default Vue.extend({
138124
// @ts-expect-error: allow untyped $store
139125
return this.$store.getters.getServerData
140126
},
141-
142-
passwordLabel(): string {
143-
if (this.hasObfuscated) {
144-
// TRANSLATORS This string is for a column header labelling either a password or a message that the current user has insufficient permissions
145-
return t('settings', 'Password or insufficient permissions message')
146-
}
147-
return t('settings', 'Password')
148-
},
149127
},
150128
151129
methods: {

apps/settings/src/components/Users/UserRow.vue

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -49,36 +49,6 @@
4949
<span class="row__subtitle">{{ user.id }}</span>
5050
</td>
5151

52-
<td
53-
data-cy-user-list-cell-password
54-
class="row__cell"
55-
:class="{ 'row__cell--obfuscated': hasObfuscated }">
56-
<template v-if="editing && settings.canChangePassword && user.backendCapabilities.setPassword">
57-
<NcTextField
58-
v-model="editedPassword"
59-
class="user-row-text-field"
60-
data-cy-user-list-input-password
61-
:data-loading="loading.password || undefined"
62-
:trailing-button-label="t('settings', 'Submit')"
63-
:class="{ 'icon-loading-small': loading.password }"
64-
:show-trailing-button="true"
65-
:disabled="loading.password || isLoadingField"
66-
:minlength="minPasswordLength"
67-
maxlength="469"
68-
:label="t('settings', 'Set new password')"
69-
trailing-button-icon="arrowEnd"
70-
autocapitalize="off"
71-
autocomplete="new-password"
72-
required
73-
spellcheck="false"
74-
type="password"
75-
@trailing-button-click="updatePassword" />
76-
</template>
77-
<span v-else-if="isObfuscated">
78-
{{ t('settings', 'You do not have permissions to see the details of this account') }}
79-
</span>
80-
</td>
81-
8252
<td class="row__cell" data-cy-user-list-cell-email>
8353
<template v-if="editing">
8454
<NcTextField
@@ -105,7 +75,7 @@
10575
</span>
10676
</td>
10777

108-
<td class="row__cell row__cell--large row__cell--multiline" data-cy-user-list-cell-groups>
78+
<td class="row__cell row__cell--groups row__cell--multiline" data-cy-user-list-cell-groups>
10979
<template v-if="editing">
11080
<label
11181
class="hidden-visually"
@@ -361,11 +331,6 @@ export default {
361331
required: true,
362332
},
363333
364-
hasObfuscated: {
365-
type: Boolean,
366-
required: true,
367-
},
368-
369334
quotaOptions: {
370335
type: Array,
371336
required: true,
@@ -398,7 +363,6 @@ export default {
398363
loading: {
399364
all: false,
400365
displayName: false,
401-
password: false,
402366
mailAddress: false,
403367
groups: false,
404368
groupsDetails: false,
@@ -413,7 +377,6 @@ export default {
413377
},
414378
415379
editedDisplayName: this.user.displayname,
416-
editedPassword: '',
417380
editedMail: this.user.email ?? '',
418381
// Cancelable promise for search groups request
419382
promise: null,
@@ -768,29 +731,6 @@ export default {
768731
}
769732
},
770733
771-
/**
772-
* Set user password
773-
*/
774-
async updatePassword() {
775-
this.loading.password = true
776-
if (this.editedPassword.length === 0) {
777-
showError(t('settings', "Password can't be empty"))
778-
this.loading.password = false
779-
} else {
780-
try {
781-
await this.$store.dispatch('setUserData', {
782-
userid: this.user.id,
783-
key: 'password',
784-
value: this.editedPassword,
785-
})
786-
this.editedPassword = ''
787-
showSuccess(t('settings', 'Password was successfully changed'))
788-
} finally {
789-
this.loading.password = false
790-
}
791-
}
792-
},
793-
794734
/**
795735
* Set user mailAddress
796736
*/

apps/settings/src/components/Users/VirtualList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export default Vue.extend({
157157
--cell-padding: 7px;
158158
--cell-width: 200px;
159159
--cell-width-large: 300px;
160+
--cell-width-groups: 380px;
160161
--cell-min-width: calc(var(--cell-width) - (2 * var(--cell-padding)));
161162
--sticky-column-z-index: calc(var(--vs-dropdown-z-index) + 1); // Keep the sticky column on top of the select dropdown
162163

apps/settings/src/components/Users/shared/styles.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
width: var(--cell-width-large);
8080
}
8181

82+
&--groups {
83+
min-width: var(--cell-width-groups);
84+
width: var(--cell-width-groups);
85+
}
86+
8287
&--obfuscated {
8388
min-width: 400px;
8489
width: 400px;

cypress/e2e/settings/users_modify.cy.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -46,35 +46,6 @@ describe('Settings: Change user properties', function() {
4646
cy.get('.toastify.toast-success').contains(/Display.+name.+was.+successfully.+changed/i).should('exist')
4747
})
4848

49-
it('Can change the password', function() {
50-
// open the User settings as admin
51-
cy.visit('/settings/users')
52-
53-
// toggle edit button into edit mode
54-
toggleEditButton(user, true)
55-
56-
getUserListRow(user.userId).within(() => {
57-
// see that the password of user is ""
58-
cy.get('[data-cy-user-list-input-password]').should('exist').and('have.value', '')
59-
// set the password for user to 123456
60-
cy.get('[data-cy-user-list-input-password]').type('123456')
61-
// When I set the password for user to 123456
62-
cy.get('[data-cy-user-list-input-password]').should('have.value', '123456')
63-
cy.get('[data-cy-user-list-input-password] ~ button').click()
64-
65-
// Make sure no confirmation modal is shown
66-
handlePasswordConfirmation(admin.password)
67-
68-
// see that the password cell for user is done loading
69-
waitLoading('[data-cy-user-list-input-password]')
70-
// password input is emptied on change
71-
cy.get('[data-cy-user-list-input-password]').should('have.value', '')
72-
})
73-
74-
// Success message is shown
75-
cy.get('.toastify.toast-success').contains(/Password.+successfully.+changed/i).should('exist')
76-
})
77-
7849
it('Can change the email address', function() {
7950
// open the User settings as admin
8051
cy.visit('/settings/users')

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)