Skip to content

Commit

Permalink
Merge pull request #24 from overture-stack/ego-ui-enum-changes
Browse files Browse the repository at this point in the history
Ego ui enum changes
  • Loading branch information
andricDu authored Mar 14, 2019
2 parents b1f6d5a + 65c9230 commit 01f34e4
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 114 deletions.
6 changes: 3 additions & 3 deletions src/common/RESOURCE_MAP.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const RESOURCE_MAP: { [key in TResourceType]: IResource } = {
},
{ key: 'email', fieldName: 'Email', sortable: true, required: true },
{
key: 'userType',
key: 'type',
fieldName: 'User Type',
sortable: true,
required: true,
Expand All @@ -66,7 +66,7 @@ const RESOURCE_MAP: { [key in TResourceType]: IResource } = {
key: 'preferredLanguage',
fieldName: 'Preferred Language',
fieldType: 'dropdown',
options: ['English', 'Spanish'],
options: ['ENGLISH', 'FRENCH', 'SPANISH'],
},
],
noDelete: true,
Expand Down Expand Up @@ -162,7 +162,7 @@ const RESOURCE_MAP: { [key in TResourceType]: IResource } = {
options: STATUSES,
},
{
key: 'applicationType',
key: 'type',
fieldName: 'Application Type',
sortable: true,
fieldType: 'dropdown',
Expand Down
2 changes: 1 addition & 1 deletion src/common/injectGlobals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ localStorage.setItem('debug', process.env.REACT_APP_DEBUG || ''); // manually se
const debug = require('debug') as Function;
global.log = debug('app');

export const STATUSES = ['Disabled', 'Approved', 'Pending'];
export const STATUSES = ['DISABLED', 'APPROVED', 'PENDING', 'REJECTED'];
export const apiRoot = process.env.REACT_APP_API;
export const egoClientId = process.env.REACT_APP_EGO_CLIENT_ID;
export const useDummyData = process.env.REACT_APP_DUMMY;
2 changes: 1 addition & 1 deletion src/common/typedefs/Application.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface Application {
name: string;
description: string;
status: string;
applicationType: string;
type: string;
clientId?: string;
redirectUri?: string;
}
2 changes: 1 addition & 1 deletion src/common/typedefs/User.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export interface User {
id: string;
userName: string;
email: string;
userType: string;
type: string;
status: string;
firstName: string;
lastName: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ export const ApplicationListItem = ({ item, sortField, className = '', style, ..
};

export const UserListItem = ({ item, sortField, className = '', style, ...props }) => {
const { firstName, lastName, userType } = item;
const { firstName, lastName, type } = item;
const secondaryField = sortField === 'lastName' ? 'email' : sortField;
return (
<Ripple
className={`UserListItem ${className}`}
style={{ ...styles.container, ...style }}
{...props}
>
<UserDisplayName firstName={firstName} lastName={lastName} userType={userType} />
<UserDisplayName firstName={firstName} lastName={lastName} type={type} />
<div className={`secondary-field ${css(styles.secondaryField)}`}>{item[secondaryField]}</div>
</Ripple>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Component extends React.Component<any, any> {
await this.props.effects.setUser(user);
await this.props.effects.setToken(jwt);

if (user.userType === 'ADMIN') {
if (user.type === 'ADMIN') {
if (this.props.location.pathname === '/') {
this.props.history.push('/users');
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/NoAccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const styles = {

export default () => (
<div className={`${css(styles.container)}`}>
Your account does not have an administrator userType.
Your account does not have an administrator user type.
<Logout />
</div>
);
4 changes: 2 additions & 2 deletions src/components/UserDisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const FormatName = ({ firstName = '', lastName = '' }) => (
</span>
);

export default ({ firstName, lastName, userType, style }: any) => (
export default ({ firstName, lastName, type, style }: any) => (
<div className={`DisplayName ${css(styles.container, style)}`}>
<FormatName firstName={firstName} lastName={lastName} />
{userType === 'ADMIN' && <div className={`${css(styles.userAdmin)}`}>ADMIN</div>}
{type === 'ADMIN' && <div className={`${css(styles.userAdmin)}`}>ADMIN</div>}
</div>
);
Loading

0 comments on commit 01f34e4

Please sign in to comment.