Display Access Token tab depending on UI_ACCESS_TOKEN_ENABLED feature flag (#1149)

This commit is contained in:
Andrew Nicolaou 2019-08-30 22:15:13 +02:00 committed by Cassie Tarakajian
parent 1f4bd581a8
commit 162d5276f1
3 changed files with 6 additions and 1 deletions

View file

@ -23,3 +23,4 @@ PORT=8000
S3_BUCKET=<your-s3-bucket> S3_BUCKET=<your-s3-bucket>
S3_BUCKET_URL_BASE=<alt-for-s3-url> S3_BUCKET_URL_BASE=<alt-for-s3-url>
SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production
UI_ACCESS_TOKEN_ENABLED=false

View file

@ -36,6 +36,8 @@ class AccountView extends React.Component {
} }
render() { render() {
const accessTokensUIEnabled = window.process.env.UI_ACCESS_TOKEN_ENABLED;
return ( return (
<div className="user"> <div className="user">
<Helmet> <Helmet>
@ -53,7 +55,7 @@ class AccountView extends React.Component {
<TabList> <TabList>
<div className="tabs__titles"> <div className="tabs__titles">
<Tab><h4 className="tabs__title">Account</h4></Tab> <Tab><h4 className="tabs__title">Account</h4></Tab>
<Tab><h4 className="tabs__title">Access Tokens</h4></Tab> {accessTokensUIEnabled && <Tab><h4 className="tabs__title">Access Tokens</h4></Tab>}
</div> </div>
</TabList> </TabList>
<TabPanel> <TabPanel>

View file

@ -30,6 +30,8 @@ export function renderIndex() {
window.process.env.CLIENT = true; window.process.env.CLIENT = true;
window.process.env.LOGIN_ENABLED = ${process.env.LOGIN_ENABLED === 'false' ? false : 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.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};
</script> </script>
</head> </head>
<body> <body>