-
Notifications
You must be signed in to change notification settings - Fork 3
🚩 Visa Tab should be enabled through configuration #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ export const EGO_CLIENT_ID = process.env.REACT_APP_EGO_CLIENT_ID; | |
|
||
export const PUBLIC_PATH = process.env.REACT_APP_PUBLIC_PATH; | ||
|
||
export const PASSPORT_ENABLED = process.env.REACT_APP_PASSPORT_ENABLED === 'true' || false; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Passport flag disabled by default |
||
export const KEYCLOAK_ENABLED = process.env.REACT_APP_KEYCLOAK_ENABLED === 'true' || false; | ||
|
||
export const STATUSES = ['DISABLED', 'APPROVED', 'PENDING', 'REJECTED']; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import { API_ROOT, EGO_CLIENT_ID, KEYCLOAK_ENABLED } from 'common/injectGlobals'; | ||
import { API_ROOT, EGO_CLIENT_ID, KEYCLOAK_ENABLED, PASSPORT_ENABLED } from 'common/injectGlobals'; | ||
import { injectState } from 'freactal'; | ||
import { css } from '@emotion/react'; | ||
import jwtDecode from 'jwt-decode'; | ||
|
@@ -182,7 +182,7 @@ class Component extends React.Component<any, any> { | |
? 'Or login with one of the following services' | ||
: 'Login with one of the following'} | ||
</h3> | ||
{providers.map(({ name, path, Icon }) => { | ||
{providers.filter(provider => PASSPORT_ENABLED || provider.name !== LoginProvider.Passport).map(({ name, path, Icon }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refactored condition as suggested for better readability |
||
return ( | ||
<LoginButton | ||
key={name} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ import { injectState } from 'freactal'; | |
import { compose } from 'recompose'; | ||
import { Icon } from 'semantic-ui-react'; | ||
|
||
import { VISAS } from 'common/enums'; | ||
import { PASSPORT_ENABLED } from 'common/injectGlobals'; | ||
import RESOURCE_MAP from 'common/RESOURCE_MAP'; | ||
import UnstyledButton from 'components/UnstyledButton'; | ||
import CurrentUserNavItem from './CurrentUserNavItem'; | ||
|
@@ -73,6 +75,7 @@ const Nav = ({ effects, state }) => { | |
</div> | ||
<ul css={listStyles}> | ||
{Object.keys(pickBy(RESOURCE_MAP, (r) => r.isParent)).map((key) => { | ||
if(key === VISAS && !PASSPORT_ENABLED) { return null; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refactored condition as suggested |
||
const resource = RESOURCE_MAP[key]; | ||
return ( | ||
<li key={key}> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import ajax from 'services/ajax'; | |
const BLOCKED_KEYS = ['id', 'createdAt', 'lastLogin', 'groups', 'applications']; | ||
|
||
export const createVisa = ({ item }) => { | ||
return ajax.post(`/visa`, _.omit(item, BLOCKED_KEYS)).then(r => { | ||
return ajax.post(`/visas`, _.omit(item, BLOCKED_KEYS)).then(r => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixing a typo.. |
||
return r.data | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schema file defines the basic configuration variables needed to run this app, mentioned in .readme file