Skip to content

Commit

Permalink
PR snags
Browse files Browse the repository at this point in the history
  • Loading branch information
damoodamoo committed Sep 1, 2022
1 parent bf8d301 commit 23ad038
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 394 deletions.
1 change: 0 additions & 1 deletion ui/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"@azure/msal-browser": "^2.24.0",
"@azure/msal-react": "^1.4.0",
"@fluentui/react": "^8.68.2",
"@fluentui/react-northstar": "^0.64.0",
"@rjsf/core": "^4.2.0",
"@rjsf/fluent-ui": "^4.2.0",
"@testing-library/jest-dom": "^5.16.1",
Expand Down
4 changes: 4 additions & 0 deletions ui/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ApiEndpoint } from './models/apiEndpoints';
import { CreateUpdateResource } from './components/shared/create-update-resource/CreateUpdateResource';
import { CreateUpdateResourceContext } from './contexts/CreateUpdateResourceContext';
import { CreateFormResource, ResourceType } from './models/resourceType';
import { Footer } from './components/shared/Footer';

export const App: React.FunctionComponent = () => {
const [appRoles, setAppRoles] = useState([] as Array<string>);
Expand Down Expand Up @@ -110,6 +111,9 @@ export const App: React.FunctionComponent = () => {
</Routes>
</GenericErrorBoundary>
</Stack.Item>
<Stack.Item grow>
<Footer />
</Stack.Item>
</Stack>
</AppRolesContext.Provider>
</OperationsContext.Provider>
Expand Down
25 changes: 25 additions & 0 deletions ui/app/src/components/shared/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import { AnimationClassNames, getTheme, mergeStyles } from '@fluentui/react';

// TODO:
// - change text to link
// - include any small print

export const Footer: React.FunctionComponent = () => {
return (
<div className={contentClass}>
Azure Trusted Research Environment
</div>
);
};

const theme = getTheme();
const contentClass = mergeStyles([
{
backgroundColor: theme.palette.themeDark,
color: theme.palette.white,
lineHeight: '30px',
padding: '0 20px',
},
AnimationClassNames.scaleUpIn100,
]);
2 changes: 1 addition & 1 deletion ui/app/src/components/shared/TopNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const TopNav: React.FunctionComponent = () => {
<Stack.Item grow={100}>
<Link to='/' className='tre-home-link'>
<Icon iconName="TestBeakerSolid" style={{ marginLeft: '10px', marginRight: '10px', verticalAlign: 'middle' }} />
<h5 style={{display: 'inline'}}>Azure TRE</h5>
<h5 style={{display: 'inline'}}>Azure Trusted Research Environment</h5>
</Link>
</Stack.Item>
<Stack.Item>
Expand Down
11 changes: 6 additions & 5 deletions ui/app/src/components/shared/airlock/Airlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import { AirlockRequest } from '../../../models/airlock';
import moment from 'moment';
import { Route, Routes, useNavigate } from 'react-router-dom';
import { AirlockViewRequest } from './AirlockViewRequest';
import { LoadingState } from '../../../models/loadingState';

interface AirlockProps {
}

export const Airlock: React.FunctionComponent<AirlockProps> = (props: AirlockProps) => {
const [airlockRequests, setAirlockRequests] = useState([] as AirlockRequest[]);
const [requestColumns, setRequestColumns] = useState([] as IColumn[]);
const [loadingState, setLoadingState] = useState('loading');
const [loadingState, setLoadingState] = useState(LoadingState.Loading);
const workspaceCtx = useContext(WorkspaceContext);
const apiCall = useAuthApiCall();
const theme = getTheme();
Expand All @@ -39,9 +40,9 @@ export const Airlock: React.FunctionComponent<AirlockProps> = (props: AirlockPro
// Order by updatedWhen for initial view
requests.sort((a, b) => a.updatedWhen < b.updatedWhen ? 1 : -1);
setAirlockRequests(requests);
setLoadingState('ok');
setLoadingState(LoadingState.Ok);
} catch (error) {
setLoadingState('error');
setLoadingState(LoadingState.Error);
}
}
getAirlockRequests();
Expand Down Expand Up @@ -149,7 +150,7 @@ export const Airlock: React.FunctionComponent<AirlockProps> = (props: AirlockPro

let requestsList;
switch (loadingState) {
case 'ok':
case LoadingState.Ok:
if (airlockRequests.length > 0) {
requestsList = (
<DetailsList
Expand All @@ -170,7 +171,7 @@ export const Airlock: React.FunctionComponent<AirlockProps> = (props: AirlockPro
)
}
break;
case 'error':
case LoadingState.Error:
requestsList = (
<MessageBar
messageBarType={MessageBarType.error}
Expand Down
11 changes: 6 additions & 5 deletions ui/app/src/components/shared/airlock/AirlockViewRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const AirlockViewRequest: React.FunctionComponent<AirlockViewRequestProps
}
<div style={{textAlign: 'end'}}>
{
request.status !== AirlockRequestStatus.Cancelled && <DefaultButton onClick={() => setHideCancelDialog(false)} styles={cancelButtonStyles}>Cancel</DefaultButton>
request.status !== AirlockRequestStatus.Cancelled && <DefaultButton onClick={() => setHideCancelDialog(false)} styles={cancelButtonStyles}>Cancel Request</DefaultButton>
}
{
request.status === AirlockRequestStatus.Draft && <PrimaryButton onClick={() => setHideSubmitDialog(false)}>Submit</PrimaryButton>
Expand All @@ -143,8 +143,9 @@ export const AirlockViewRequest: React.FunctionComponent<AirlockViewRequestProps
return (
<>
<Panel
headerText="View request"
headerText="View Airlock Request"
isOpen={true}
isLightDismiss={true}
onDismiss={dismissPanel}
onRenderFooterContent={renderFooter}
isFooterAtBottom={true}
Expand Down Expand Up @@ -275,8 +276,8 @@ export const AirlockViewRequest: React.FunctionComponent<AirlockViewRequestProps
hidden={hideCancelDialog}
onDismiss={() => setHideCancelDialog(true)}
dialogContentProps={{
title: 'Cancel request?',
subText: 'Are you sure you want to cancel this request?',
title: 'Cancel Airlock Request?',
subText: 'Are you sure you want to cancel this airlock request?',
}}
>
{
Expand All @@ -286,7 +287,7 @@ export const AirlockViewRequest: React.FunctionComponent<AirlockViewRequestProps
cancelling
? <Spinner label="Cancelling..." ariaLive="assertive" labelPosition="top" size={SpinnerSize.large} />
: <DialogFooter>
<PrimaryButton onClick={cancelRequest} text="Cancel" styles={cancelButtonStyles} />
<PrimaryButton onClick={cancelRequest} text="Cancel Request" styles={cancelButtonStyles} />
<DefaultButton onClick={() => setHideCancelDialog(true)} text="Back" />
</DialogFooter>
}
Expand Down
Loading

0 comments on commit 23ad038

Please sign in to comment.