Skip to content

Commit

Permalink
Task/t UI 411 mixed page headers (#432)
Browse files Browse the repository at this point in the history
* create apps and files help.

* add indexes

* work on headers

* fix headers

* Make apps (create new app) and systems (create new system) buttons uniform

* create layout for jobs, update layout-module for jobs and files.

* npm run prettier

* Remove commented code, fix apps and systems toolbar to reflect create system, create app, accordingly.
  • Loading branch information
carrythemountain authored Nov 11, 2024
1 parent 13d5fc6 commit becdfa9
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 50 deletions.
Empty file.
8 changes: 7 additions & 1 deletion src/app/Apps/_Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ import {
import AppsToolbar from '../_components/AppsToolbar';

import { Router } from '../_Router';
import AppsHelp from 'app/_components/Help/AppsHelp';

const Layout: React.FC = () => {
const header = (
<LayoutHeader>
<div>Apps</div>
<span>
Apps
<span style={{ marginLeft: '16px' }}>
<AppsHelp />
</span>
</span>
<AppsToolbar />
</LayoutHeader>
);
Expand Down
5 changes: 1 addition & 4 deletions src/app/Apps/_components/AppsToolbar/AppsToolbar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
margin: 0;
margin-top: 0.5em;
display: flex !important;
gap: 8px;
}

.toolbar-btn {
height: 2rem;
align-items: center;
margin-left: 0.5em;
font-size: 0.7em !important;
border-radius: 0 !important;
background-color: #f4f4f4 !important;
color: #333333 !important;
}

.toolbar-btn:disabled {
Expand Down
17 changes: 10 additions & 7 deletions src/app/Apps/_components/AppsToolbar/AppsToolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React, { useState } from 'react';
import { Button } from 'reactstrap';
// import { Button } from 'reactstrap';
import { Icon } from '@tapis/tapisui-common';
import styles from './AppsToolbar.module.scss';
import { useLocation } from 'react-router-dom';
import CreateAppModal from './CreateAppModal';
import { Button } from '@mui/material';
import { Add } from '@mui/icons-material';

type ToolbarButtonProps = {
text: string;
icon: string;
icon: any;
onClick: () => void;
disabled: boolean;
};
Expand All @@ -29,10 +31,12 @@ export const ToolbarButton: React.FC<ToolbarButtonProps> = ({
disabled={disabled}
onClick={onClick}
className={styles['toolbar-btn']}
startIcon={icon}
variant="outlined"
size="small"
{...rest}
>
<Icon name={icon}></Icon>
<span> {text}</span>
<span>{text}</span>
</Button>
</div>
);
Expand All @@ -50,13 +54,12 @@ const AppsToolbar: React.FC = () => {
{pathname && (
<div className={styles['toolbar-wrapper']}>
<ToolbarButton
text="Create a New App"
icon="add"
text="Create App"
icon={<Add />}
disabled={false}
onClick={() => setModal('createApp')}
aria-label="createApp"
/>

{modal === 'createApp' && <CreateAppModal toggle={toggle} />}
</div>
)}
Expand Down
12 changes: 12 additions & 0 deletions src/app/Files/_Layout/Layout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,15 @@
font-size: 0.8em;
line-height: 1.8em;
}

.Files {
margin: 9px;
// margin-top: 1cqi;
position: relative;
top: 10px;
right: 08px;
}

.Files-Help {
padding-left: 1cap;
}
8 changes: 7 additions & 1 deletion src/app/Files/_Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useLocation } from 'react-router-dom';
import { breadcrumbsFromPathname } from '@tapis/tapisui-common';
import styles from './Layout.module.scss';
import { FilesProvider } from '../_components/FilesContext';
import FilesHelp from 'app/_components/Help/FilesHelp';

const Layout: React.FC = () => {
const { pathname } = useLocation();
Expand All @@ -21,7 +22,12 @@ const Layout: React.FC = () => {
const crumbs = breadcrumbsFromPathname(pathname).splice(1);
const header = (
<LayoutHeader>
Files
<span className={`${styles['Files']}`}>
Files
<span className={`${styles['Files-Help']}`}>
<FilesHelp />
</span>
</span>
{/* <div className={styles.breadcrumbs}>
<Breadcrumbs breadcrumbs={[{ text: 'Files' }, ...crumbs]} />
Expand Down
11 changes: 11 additions & 0 deletions src/app/Jobs/_Layout/Layout.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.Jobs {
margin: 9px;
// margin-top: 1cqi;
position: relative;
top: 10px;
right: 10px;
}

.Jobs-Help {
padding-left: 1cap;
}
5 changes: 3 additions & 2 deletions src/app/Jobs/_Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ import {
SectionHeader,
} from '@tapis/tapisui-common';
import { Link } from 'react-router-dom';
import styles from './Layout.module.scss';
import { JobsHelp } from 'app/_components/Help';

const Layout: React.FC = () => {
const header = (
<SectionHeader>
<span>
<span className={`${styles['Jobs']}`}>
<span>
<Link to="/jobs" style={{ color: '#444444' }}>
Jobs
</Link>
</span>
<span style={{ marginLeft: '16px', marginTop: '-1px' }}>
<span className={`${styles['Jobs-Help']}`}>
<JobsHelp />
</span>
</span>
Expand Down
36 changes: 1 addition & 35 deletions src/app/Systems/_components/SystemToolbar/SystemToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,47 +59,13 @@ const SystemToolbar: React.FC = () => {
{pathname && (
<div className={styles['toolbar-wrapper']}>
<ToolbarButton
text="Create"
text="Create System"
icon={<Add />}
disabled={false}
onClick={() => setModal('createsystem')}
aria-label="createSystem"
/>
{/* <ToolbarButton
text="Undelete"
icon={<Add />}
disabled={false}
onClick={() => setModal('undeletesystem')}
aria-label="undeleteSystem"
/>
<ToolbarButton
color="error"
text="Delete"
icon={<Delete />}
disabled={false}
onClick={() => setModal('deletesystem')}
aria-label="deleteSystem"
/> */}
{/* New button for creating user credentials */}
{/* <ToolbarButton
text="Create User Credential"
icon="add" // Assuming 'add' is the icon for user credentials
disabled={false}
onClick={() => setModal('createusercredential')}
aria-label="createUserCredential"
/> */}
{/* Conditionally rendered modals */}
{modal === 'createsystem' && <CreateSystemModal toggle={toggle} />}
{/* {modal === 'deletesystem' && <DeleteSystemModal toggle={toggle} />}
{modal === 'undeletesystem' && (
<UndeleteSystemModal toggle={toggle} />
)} */}
{/* {modal === 'createusercredential' && (
<CreateUserCredentialModal
toggle={toggle}
isOpen={modal === 'createusercredential'}
/>
)} */}
</div>
)}
</div>
Expand Down
13 changes: 13 additions & 0 deletions src/app/_components/Help/AppsHelp/AppsHelp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import { Help } from '@tapis/tapisui-common';

const AppsHelp: React.FC = () => {
return (
<Help
title="Tapis Apps"
iframeUrl="https://tapis.readthedocs.io/en/latest/technical/apps.html"
/>
);
};

export default AppsHelp;
1 change: 1 addition & 0 deletions src/app/_components/Help/AppsHelp/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './AppsHelp';
13 changes: 13 additions & 0 deletions src/app/_components/Help/FilesHelp/FilesHelp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import { Help } from '@tapis/tapisui-common';

const FilesHelp: React.FC = () => {
return (
<Help
title="Tapis Files"
iframeUrl="https://tapis.readthedocs.io/en/latest/technical/files.html"
/>
);
};

export default FilesHelp;
1 change: 1 addition & 0 deletions src/app/_components/Help/FilesHelp/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './FilesHelp';

0 comments on commit becdfa9

Please sign in to comment.