mirror of https://github.com/rancher/dashboard.git
Don't display a value for `Disable After` for disabled users
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
This commit is contained in:
parent
a47c7ea7aa
commit
c746601593
|
|
@ -416,7 +416,7 @@ export const USER_LAST_LOGIN = {
|
||||||
export const USER_DISABLED_IN = {
|
export const USER_DISABLED_IN = {
|
||||||
name: 'user-disabled-in',
|
name: 'user-disabled-in',
|
||||||
labelKey: 'tableHeaders.userDisabledIn',
|
labelKey: 'tableHeaders.userDisabledIn',
|
||||||
value: 'userDisabledIn',
|
value: 'userDisabledInDisplay',
|
||||||
formatter: 'LiveDate',
|
formatter: 'LiveDate',
|
||||||
formatterOpts: { isCountdown: true },
|
formatterOpts: { isCountdown: true },
|
||||||
sort: 'userDisabledIn',
|
sort: 'userDisabledIn',
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,14 @@ export default class User extends HybridModel {
|
||||||
return this.metadata?.labels?.['cattle.io/disable-after'] * 1000;
|
return this.metadata?.labels?.['cattle.io/disable-after'] * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides a display value for the userDisabledIn date based on the user
|
||||||
|
* state.
|
||||||
|
*/
|
||||||
|
get userDisabledInDisplay() {
|
||||||
|
return this.state === 'inactive' ? null : this.userDisabledIn;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the delete-after label in milliseconds
|
* Gets the delete-after label in milliseconds
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
|
|
@ -260,7 +268,7 @@ export default class User extends HybridModel {
|
||||||
label: this.t('tableHeaders.userDisabledIn'),
|
label: this.t('tableHeaders.userDisabledIn'),
|
||||||
formatter: 'LiveDate',
|
formatter: 'LiveDate',
|
||||||
formatterOpts: { isCountdown: true },
|
formatterOpts: { isCountdown: true },
|
||||||
content: this.userDisabledIn,
|
content: this.userDisabledInDisplay,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.t('tableHeaders.userDeletedIn'),
|
label: this.t('tableHeaders.userDeletedIn'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue