forked from rancher/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rancher#11276 from rak-phillip/feature/user-retent…
…ion-settings Add user retention admin interface
- Loading branch information
Showing
18 changed files
with
695 additions
and
19 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
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,7 @@ | ||
import ComponentPo from '@/cypress/e2e/po/components/component.po'; | ||
|
||
export default class LinkPo extends ComponentPo { | ||
click(force = false): Cypress.Chainable { | ||
return this.self().click({ force }); | ||
} | ||
} |
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,52 @@ | ||
|
||
import PagePo from '@/cypress/e2e/po/pages/page.po'; | ||
import CheckboxInputPo from '@/cypress/e2e/po/components/checkbox-input.po'; | ||
import AsyncButtonPo from '@/cypress/e2e/po/components/async-button.po'; | ||
import LabeledInputPo from '@/cypress/e2e/po/components/labeled-input.po'; | ||
import ToggleSwitchPo from '@/cypress/e2e/po/components/toggle-switch.po'; | ||
|
||
export default class UserRetentionPo extends PagePo { | ||
constructor(private clusterId = '_') { | ||
super(UserRetentionPo.createPath(clusterId)); | ||
} | ||
|
||
private static createPath(clusterId: string) { | ||
return `/c/${ clusterId }/auth/user.retention`; | ||
} | ||
|
||
saveButton() { | ||
return new AsyncButtonPo('[data-testid="action-button-async-button"]'); | ||
} | ||
|
||
enableRegistryCheckbox(): CheckboxInputPo { | ||
return new CheckboxInputPo('[data-testid="registries-enable-checkbox"]'); | ||
} | ||
|
||
disableAfterPeriodCheckbox(): CheckboxInputPo { | ||
return new CheckboxInputPo('[data-testid="disableAfterPeriod"]'); | ||
} | ||
|
||
disableAfterPeriodInput() { | ||
return new LabeledInputPo('[data-testid="disableAfterPeriodInput"]'); | ||
} | ||
|
||
deleteAfterPeriodCheckbox(): CheckboxInputPo { | ||
return new CheckboxInputPo('[data-testid="deleteAfterPeriod"]'); | ||
} | ||
|
||
deleteAfterPeriodInput() { | ||
return new LabeledInputPo('[data-testid="deleteAfterPeriodInput"]'); | ||
} | ||
|
||
userRetentionCron() { | ||
return new LabeledInputPo('[data-testid="userRetentionCron"]'); | ||
} | ||
|
||
userRetentionDryRun() { | ||
return new ToggleSwitchPo('[data-testid="userRetentionDryRun"]'); | ||
} | ||
|
||
userLastLoginDefault() { | ||
return new LabeledInputPo('[data-testid="userLastLoginDefault"]'); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,4 +215,4 @@ | |
"merge": ">=2.1.1", | ||
"semver": ">=7.5.2" | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script lang="ts" setup> | ||
import TabTitle from '@shell/components/TabTitle'; | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<header> | ||
<div class="title"> | ||
<h1 | ||
data-testid="charts-header-title" | ||
class="m-0" | ||
> | ||
<TabTitle :show-child="false"> | ||
{{ t('user.retention.edit.title.header') }} | ||
</TabTitle> | ||
<router-link | ||
:to="{ | ||
name: 'c-cluster-product-resource', | ||
params: { | ||
cluster: '_', | ||
product: 'auth', | ||
resource: 'management.cattle.io.user', | ||
} | ||
}" | ||
> | ||
{{ t('user.retention.edit.title.pre') }} | ||
</router-link> | ||
{{ t('user.retention.edit.title.post') }} | ||
</h1> | ||
</div> | ||
</header> | ||
<h2>{{ t('user.retention.edit.title.subTitle') }}</h2> | ||
</div> | ||
</template> |
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,26 @@ | ||
import { Store } from 'vuex'; | ||
|
||
import { stringFor } from '@shell/plugins/i18n'; | ||
|
||
let store: Store<any> | null = null; | ||
|
||
export const useI18n = (vuexStore: Store<any>): { t: typeof t } => { | ||
store = vuexStore; | ||
|
||
if (!store) { | ||
throw new Error('usI18n() must be called from setup()'); | ||
} | ||
|
||
return { t }; | ||
}; | ||
|
||
/** | ||
* Allows for consuming i18n strings with the Vue composition API. | ||
* @param key - The key for the i18n string to translate. | ||
* @param args - An object or array containing arguments for the translation function. | ||
* @param raw - A boolean determining if the string returned is a raw representation. | ||
* @returns A translated string or the raw value if the raw parameter is set to true. | ||
*/ | ||
const t = (key: string, args?: unknown, raw?: boolean): unknown => { | ||
return stringFor(store, key, args, raw); | ||
}; |
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
Oops, something went wrong.