From 0ae7a9eebbd1c569e3108957d4d26c09d2e80df5 Mon Sep 17 00:00:00 2001 From: Andrew Nicolaou Date: Fri, 30 Aug 2019 22:15:13 +0200 Subject: [PATCH] Display Access Token tab depending on UI_ACCESS_TOKEN_ENABLED feature flag (#1149) --- .env.example | 1 + client/modules/User/pages/AccountView.jsx | 4 +++- server/views/index.js | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 0385cf26..17b6fe5a 100644 --- a/.env.example +++ b/.env.example @@ -23,3 +23,4 @@ PORT=8000 S3_BUCKET= S3_BUCKET_URL_BASE= SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production +UI_ACCESS_TOKEN_ENABLED=false diff --git a/client/modules/User/pages/AccountView.jsx b/client/modules/User/pages/AccountView.jsx index 5648cee2..0cda4898 100644 --- a/client/modules/User/pages/AccountView.jsx +++ b/client/modules/User/pages/AccountView.jsx @@ -33,6 +33,8 @@ class AccountView extends React.Component { } render() { + const accessTokensUIEnabled = window.process.env.UI_ACCESS_TOKEN_ENABLED; + return (
@@ -50,7 +52,7 @@ class AccountView extends React.Component {

Account

-

Access Tokens

+ {accessTokensUIEnabled &&

Access Tokens

}
diff --git a/server/views/index.js b/server/views/index.js index d4062061..0539b927 100644 --- a/server/views/index.js +++ b/server/views/index.js @@ -30,6 +30,8 @@ export function renderIndex() { window.process.env.CLIENT = true; window.process.env.LOGIN_ENABLED = ${process.env.LOGIN_ENABLED === 'false' ? false : true}; window.process.env.EXAMPLES_ENABLED = ${process.env.EXAMPLES_ENABLED === 'false' ? false : true}; + window.process.env.EXAMPLES_ENABLED = ${process.env.EXAMPLES_ENABLED === 'false' ? false : true}; + window.process.env.UI_ACCESS_TOKEN_ENABLED = ${process.env.UI_ACCESS_TOKEN_ENABLED === 'false' ? false : true};