Skip to content

Commit 0ae7a9e

Browse files
committed
Display Access Token tab depending on UI_ACCESS_TOKEN_ENABLED feature flag (processing#1149)
1 parent 210e8b6 commit 0ae7a9e

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
@@ -33,6 +33,8 @@ class AccountView extends React.Component {
3333
}
3434

3535
render() {
36+
const accessTokensUIEnabled = window.process.env.UI_ACCESS_TOKEN_ENABLED;
37+
3638
return (
3739
<div className="user">
3840
<Helmet>
@@ -50,7 +52,7 @@ class AccountView extends React.Component {
5052
<TabList>
5153
<div className="tabs__titles">
5254
<Tab><h4 className="tabs__title">Account</h4></Tab>
53-
<Tab><h4 className="tabs__title">Access Tokens</h4></Tab>
55+
{accessTokensUIEnabled && <Tab><h4 className="tabs__title">Access Tokens</h4></Tab>}
5456
</div>
5557
</TabList>
5658
<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)