From 64c3ff8d6b81d976ca62b687dd908157a834b29f Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 19 Jun 2020 19:11:02 -0700 Subject: [PATCH] chore: Remove 'DEPLOYMENT' env option Add 'Installation' section --- .env.sample | 1 - app.json | 7 +-- app/components/Sidebar/Settings.js | 32 ++++++----- .../Sidebar/components/SidebarLink.js | 5 +- app/components/Sidebar/components/Version.js | 53 +++++++++++++++++++ app/components/Sidebar/icons/Slack.js | 8 ++- app/components/Sidebar/icons/Zapier.js | 8 ++- server/app.js | 1 + 8 files changed, 91 insertions(+), 24 deletions(-) create mode 100644 app/components/Sidebar/components/Version.js diff --git a/.env.sample b/.env.sample index 517b164f..379c02fd 100644 --- a/.env.sample +++ b/.env.sample @@ -17,7 +17,6 @@ PORT=3000 # set to false if your SSL is terminated at a loadbalancer, for example FORCE_HTTPS=true -DEPLOYMENT=self ENABLE_UPDATES=true WEBSOCKETS_ENABLED=true DEBUG=cache,presenters,events diff --git a/app.json b/app.json index 66ce6a04..5670a107 100644 --- a/app.json +++ b/app.json @@ -35,11 +35,6 @@ "generator": "secret", "required": true }, - "DEPLOYMENT": { - "description": "Should be 'self' for self hosted installations, turns off things like pricing pages", - "value": "self", - "required": true - }, "ENABLE_UPDATES": { "value": "true", "required": true @@ -149,4 +144,4 @@ "required": false } } -} +} \ No newline at end of file diff --git a/app/components/Sidebar/Settings.js b/app/components/Sidebar/Settings.js index 866922d4..c4c0731a 100644 --- a/app/components/Sidebar/Settings.js +++ b/app/components/Sidebar/Settings.js @@ -26,6 +26,7 @@ import Section from './components/Section'; import Header from './components/Header'; import SidebarLink from './components/SidebarLink'; import HeaderBlock from './components/HeaderBlock'; +import Version from './components/Version'; import PoliciesStore from 'stores/PoliciesStore'; import AuthStore from 'stores/AuthStore'; @@ -67,17 +68,17 @@ class SettingsSidebar extends React.Component {
Account
} + icon={} label="Profile" /> } + icon={} label="Notifications" /> } + icon={} label="API Tokens" /> @@ -86,45 +87,45 @@ class SettingsSidebar extends React.Component { {can.update && ( } + icon={} label="Details" /> )} {can.update && ( } + icon={} label="Security" /> )} } + icon={} exact={false} label="People" /> } + icon={} exact={false} label="Groups" /> } + icon={} label="Share Links" /> {can.auditLog && ( } + icon={} label="Audit Log" /> )} {can.export && ( } + icon={} label="Export Data" /> )} @@ -134,16 +135,23 @@ class SettingsSidebar extends React.Component {
Integrations
} + icon={} label="Slack" /> } + icon={} label="Zapier" /> )} + {can.update && + process.env.DEPLOYMENT !== 'hosted' && ( +
+
Installation
+ +
+ )} diff --git a/app/components/Sidebar/components/SidebarLink.js b/app/components/Sidebar/components/SidebarLink.js index a70d9f03..80dd6ade 100644 --- a/app/components/Sidebar/components/SidebarLink.js +++ b/app/components/Sidebar/components/SidebarLink.js @@ -9,6 +9,7 @@ import Flex from 'shared/components/Flex'; type Props = { to?: string | Object, + href?: string | Object, onClick?: (SyntheticEvent<>) => void, children?: React.Node, icon?: React.Node, @@ -63,6 +64,7 @@ class SidebarLink extends React.Component { menuOpen, hideDisclosure, exact, + href, } = this.props; const showDisclosure = !!children && !hideDisclosure; const activeStyle = { @@ -80,7 +82,8 @@ class SidebarLink extends React.Component { onClick={onClick} exact={exact !== false} to={to} - as={to ? undefined : 'div'} + as={to ? undefined : href ? 'a' : 'div'} + href={href} > {icon && {icon}}