Skip to content

Commit 162d527

Browse files
andrewncatarak
authored andcommitted
Display Access Token tab depending on UI_ACCESS_TOKEN_ENABLED feature flag (#1149)
1 parent 1f4bd58 commit 162d527

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ PORT=8000
2323
S3_BUCKET=<your-s3-bucket>
2424
S3_BUCKET_URL_BASE=<alt-for-s3-url>
2525
SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production
26+
UI_ACCESS_TOKEN_ENABLED=false

client/modules/User/pages/AccountView.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class AccountView extends React.Component {
3636
}
3737

3838
render() {
39+
const accessTokensUIEnabled = window.process.env.UI_ACCESS_TOKEN_ENABLED;
40+
3941
return (
4042
<div className="user">
4143
<Helmet>
@@ -53,7 +55,7 @@ class AccountView extends React.Component {
5355
<TabList>
5456
<div className="tabs__titles">
5557
<Tab><h4 className="tabs__title">Account</h4></Tab>
56-
<Tab><h4 className="tabs__title">Access Tokens</h4></Tab>
58+
{accessTokensUIEnabled && <Tab><h4 className="tabs__title">Access Tokens</h4></Tab>}
5759
</div>
5860
</TabList>
5961
<TabPanel>

server/views/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export function renderIndex() {
3030
window.process.env.CLIENT = true;
3131
window.process.env.LOGIN_ENABLED = ${process.env.LOGIN_ENABLED === 'false' ? false : true};
3232
window.process.env.EXAMPLES_ENABLED = ${process.env.EXAMPLES_ENABLED === 'false' ? false : true};
33+
window.process.env.EXAMPLES_ENABLED = ${process.env.EXAMPLES_ENABLED === 'false' ? false : true};
34+
window.process.env.UI_ACCESS_TOKEN_ENABLED = ${process.env.UI_ACCESS_TOKEN_ENABLED === 'false' ? false : true};
3335
</script>
3436
</head>
3537
<body>

0 commit comments

Comments
 (0)