From 2129736ca6b4e7077405e324af7ec4aef9b7faf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Mon, 24 Apr 2023 12:37:13 +0100 Subject: [PATCH] chore: make login history GA (remove flag) (#3604) https://linear.app/unleash/issue/2-956/remove-loginhistory-feature-flag Promotes [login history](https://docs.getunleash.io/reference/login-history) to GA by removing the `loginHistory` feature flag. --- frontend/src/component/menu/routes.ts | 1 - .../hooks/api/getters/useLoginHistory/useLoginHistory.ts | 6 ++---- frontend/src/interfaces/uiConfig.ts | 1 - src/lib/__snapshots__/create-config.test.ts.snap | 2 -- src/lib/types/experimental.ts | 1 - 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/frontend/src/component/menu/routes.ts b/frontend/src/component/menu/routes.ts index 9c1af1e7e7..409618e1a5 100644 --- a/frontend/src/component/menu/routes.ts +++ b/frontend/src/component/menu/routes.ts @@ -451,7 +451,6 @@ export const adminMenuRoutes: INavigationMenuItem[] = [ path: '/admin/logins', title: 'Login history', menu: { adminSettings: true, mode: ['enterprise'] }, - flag: 'loginHistory', }, { path: '/admin/users', diff --git a/frontend/src/hooks/api/getters/useLoginHistory/useLoginHistory.ts b/frontend/src/hooks/api/getters/useLoginHistory/useLoginHistory.ts index ab66c8060e..b7f6b0a63c 100644 --- a/frontend/src/hooks/api/getters/useLoginHistory/useLoginHistory.ts +++ b/frontend/src/hooks/api/getters/useLoginHistory/useLoginHistory.ts @@ -6,12 +6,10 @@ import { useConditionalSWR } from '../useConditionalSWR/useConditionalSWR'; import useUiConfig from '../useUiConfig/useUiConfig'; export const useLoginHistory = () => { - const { uiConfig, isEnterprise } = useUiConfig(); - - const { loginHistory } = uiConfig.flags; + const { isEnterprise } = useUiConfig(); const { data, error, mutate } = useConditionalSWR( - loginHistory && isEnterprise(), + isEnterprise(), { events: [] }, formatApiPath(`api/admin/logins`), fetcher diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index 74fb296975..2737e9a3c4 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -46,7 +46,6 @@ export interface IFlags { crOnVariants?: boolean; proPlanAutoCharge?: boolean; notifications?: boolean; - loginHistory?: boolean; bulkOperations?: boolean; projectScopedStickiness?: boolean; personalAccessTokensKillSwitch?: boolean; diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index 6851542913..0a82da0ecf 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -77,7 +77,6 @@ exports[`should create default config 1`] = ` "embedProxyFrontend": true, "featuresExportImport": true, "groupRootRoles": false, - "loginHistory": false, "maintenanceMode": false, "messageBanner": false, "migrationLock": false, @@ -105,7 +104,6 @@ exports[`should create default config 1`] = ` "embedProxyFrontend": true, "featuresExportImport": true, "groupRootRoles": false, - "loginHistory": false, "maintenanceMode": false, "messageBanner": false, "migrationLock": false, diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 4d626af0cc..d51ba1a204 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -50,7 +50,6 @@ const flags = { process.env.UNLEASH_PRO_PLAN_AUTO_CHARGE, false, ), - loginHistory: parseEnvVarBoolean(process.env.UNLEASH_LOGIN_HISTORY, false), bulkOperations: parseEnvVarBoolean( process.env.UNLEASH_BULK_OPERATIONS, false,