66 lines
2.0 KiB
TypeScript
66 lines
2.0 KiB
TypeScript
import { FeatureKey } from '../constants/featureKeys';
|
|
|
|
/**
|
|
* The features the shipped admin switchboard may touch.
|
|
*
|
|
* The dev screen lists all 182 keys; this list is deliberately much shorter,
|
|
* because the two screens answer different questions. The dev screen is for
|
|
* "does gating work at all", and every key belongs there. This one is for a
|
|
* member of staff shutting a product down in the field, so it holds only the
|
|
* switches that make sense as an operational decision — product areas and the
|
|
* transactional actions inside them.
|
|
*
|
|
* Two kinds of key are kept off it on purpose:
|
|
*
|
|
* - **Anything under `auth`.** Turning off sign-in or registration from inside
|
|
* the app locks the handset out of the app, including out of this screen. That
|
|
* belongs to remote config, where it can be undone from the server.
|
|
* - **`profile.featureFlags` itself**, for the same reason: a switchboard that
|
|
* can switch itself off is a one-way door.
|
|
*
|
|
* Every entry is a real product decision, and each is grouped as it should
|
|
* appear in the UI.
|
|
*/
|
|
export const ADMIN_TOGGLEABLE_FEATURES: ReadonlyArray<{
|
|
title: string;
|
|
keys: readonly FeatureKey[];
|
|
}> = [
|
|
{
|
|
title: 'Payments',
|
|
keys: [
|
|
FeatureKey.PAYMENTS,
|
|
FeatureKey.PAYMENTS_TRANSFER,
|
|
FeatureKey.PAYMENTS_BENEFICIARIES_ADD,
|
|
],
|
|
},
|
|
{
|
|
title: 'Cards',
|
|
keys: [FeatureKey.CARDS, FeatureKey.CARDS_CONTROLS_FREEZE, FeatureKey.CARDS_APPLY_CREDIT],
|
|
},
|
|
{
|
|
title: 'Lending & cover',
|
|
keys: [FeatureKey.LOANS, FeatureKey.LOANS_APPLY, FeatureKey.INSURANCE, FeatureKey.INSURANCE_BUY],
|
|
},
|
|
{
|
|
title: 'Deposits & services',
|
|
keys: [
|
|
FeatureKey.SERVICES,
|
|
FeatureKey.SERVICES_DEPOSITS,
|
|
FeatureKey.SERVICES_DEPOSITS_OPEN_FD,
|
|
FeatureKey.SERVICES_DEPOSITS_OPEN_RD,
|
|
],
|
|
},
|
|
{
|
|
title: 'Home & discovery',
|
|
keys: [
|
|
FeatureKey.HOME_ACCOUNTS_MMID,
|
|
FeatureKey.SEARCH_GLOBAL,
|
|
FeatureKey.NOTIFICATIONS_LIST,
|
|
],
|
|
},
|
|
{
|
|
title: 'Field agent app',
|
|
keys: [FeatureKey.AGENT, FeatureKey.AGENT_COLLECTIONS],
|
|
},
|
|
];
|