aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers/tokens.ts
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2022-11-02 11:08:39 +0100
committersonartech <sonartech@sonarsource.com>2022-11-02 20:03:01 +0000
commit2ab6fc273ecbf405f7c126fab11ddc0b9bf516da (patch)
treea6e005b4f57fb488d3e551b7df52399e69b0674c /server/sonar-web/src/main/js/helpers/tokens.ts
parent60e4b88e4567c1af3051b6cdc4c8858f8b0fca21 (diff)
downloadsonarqube-2ab6fc273ecbf405f7c126fab11ddc0b9bf516da.tar.gz
sonarqube-2ab6fc273ecbf405f7c126fab11ddc0b9bf516da.zip
SONAR-13368 Bump to prettier@2.7.1
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/tokens.ts')
-rw-r--r--server/sonar-web/src/main/js/helpers/tokens.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/helpers/tokens.ts b/server/sonar-web/src/main/js/helpers/tokens.ts
index 4c1f981b13d..83ac35d10b6 100644
--- a/server/sonar-web/src/main/js/helpers/tokens.ts
+++ b/server/sonar-web/src/main/js/helpers/tokens.ts
@@ -28,11 +28,11 @@ export const EXPIRATION_OPTIONS = [
TokenExpiration.OneMonth,
TokenExpiration.ThreeMonths,
TokenExpiration.OneYear,
- TokenExpiration.NoExpiration
-].map(value => {
+ TokenExpiration.NoExpiration,
+].map((value) => {
return {
value,
- label: translate('users.tokens.expiration', value.toString())
+ label: translate('users.tokens.expiration', value.toString()),
};
});
@@ -40,7 +40,7 @@ const SETTINGS_EXPIRATION_MAP: { [key: string]: TokenExpiration } = {
'30 days': TokenExpiration.OneMonth,
'90 days': TokenExpiration.ThreeMonths,
'1 year': TokenExpiration.OneYear,
- 'No expiration': TokenExpiration.NoExpiration
+ 'No expiration': TokenExpiration.NoExpiration,
};
export async function getAvailableExpirationOptions() {
@@ -48,7 +48,7 @@ export async function getAvailableExpirationOptions() {
* We intentionally fetch all settings, because fetching a specific setting will
* return it from the DB as a fallback, even if the setting is not defined at startup.
*/
- const setting = (await getAllValues()).find(v => v.key === SettingsKey.TokenMaxAllowedLifetime);
+ const setting = (await getAllValues()).find((v) => v.key === SettingsKey.TokenMaxAllowedLifetime);
if (setting === undefined || setting.value === undefined) {
return EXPIRATION_OPTIONS;
}
@@ -56,7 +56,7 @@ export async function getAvailableExpirationOptions() {
const maxTokenLifetime = setting.value;
if (SETTINGS_EXPIRATION_MAP[maxTokenLifetime] !== TokenExpiration.NoExpiration) {
return EXPIRATION_OPTIONS.filter(
- option =>
+ (option) =>
option.value <= SETTINGS_EXPIRATION_MAP[maxTokenLifetime] &&
option.value !== TokenExpiration.NoExpiration
);