Skip to content
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

App Form Refinements #287

Merged
merged 3 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jhub_apps/static/css/index.css

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions jhub_apps/static/js/index.js

Large diffs are not rendered by default.

20 changes: 2 additions & 18 deletions ui/src/components/app-form/app-form.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,9 @@
max-width: 600px;
}

.form-section {
margin: 16px 0;
padding: 12px 0;
}

.form-heading {
font-size: 24px;
font-weight: 700;
padding: 0 0 16px 0;
}

.form > .form-section > h2 {
font-size: 16px;
font-weight: 600;
margin: 0 0 16px 0;
}

.form > .button-section {
width: 100%;
margin: 24px 0;
margin: 16px 0;
}

.form > .button-section > .prev {
Expand Down Expand Up @@ -180,6 +163,7 @@

.form-control.outer-div {
height: 125px !important;
margin-bottom: 0;
}

.description_text-field,
Expand Down
30 changes: 15 additions & 15 deletions ui/src/components/app-form/app-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import {
currentServerName as defaultServerName,
currentUser as defaultUser,
} from '../../store';
import { StyledFormSection } from '../../styles/styled-form-section';
import { StyledFormSectionHeading } from '../../styles/styled-form-section-heading';
import './app-form.css';

export interface AppFormProps {
Expand Down Expand Up @@ -383,8 +385,8 @@ export const AppForm = ({ id }: AppFormProps): React.ReactElement => {
className="form"
noValidate
>
<div className="form-section">
<h2>App Info</h2>
<StyledFormSection>
<StyledFormSectionHeading>App Info</StyledFormSectionHeading>
<Controller
name="display_name"
control={control}
Expand Down Expand Up @@ -476,10 +478,10 @@ export const AppForm = ({ id }: AppFormProps): React.ReactElement => {
</FormControl>
)}
/>
</div>
</StyledFormSection>

<div className="form-section">
<h2>Configuration</h2>
<StyledFormSection>
<StyledFormSectionHeading>Configuration</StyledFormSectionHeading>
<Controller
name="framework"
control={control}
Expand Down Expand Up @@ -637,10 +639,9 @@ export const AppForm = ({ id }: AppFormProps): React.ReactElement => {
)}
/>
</Box>
</div>

<div className="form-section">
<h2>Sharing</h2>
</StyledFormSection>
<StyledFormSection>
<StyledFormSectionHeading>Sharing</StyledFormSectionHeading>
<AppSharing
url={formData?.url}
permissions={formData?.user_options?.share_with}
Expand All @@ -649,16 +650,15 @@ export const AppForm = ({ id }: AppFormProps): React.ReactElement => {
setCurrentGroupPermissions={setCurrentGroupPermissions}
setIsPublic={setIsPublic}
/>
</div>

<div className="form-section">
<h2>App Thumbnail</h2>
</StyledFormSection>
<StyledFormSection sx={{ pb: '36px' }}>
<StyledFormSectionHeading>App Thumbnail</StyledFormSectionHeading>
<Controller
name="thumbnail"
control={control}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
render={({ field: { ref: _, value, onChange, ...field } }) => (
<FormControl>
<FormControl sx={{ pb: 0 }}>
<Thumbnail
{...field}
id="thumbnail"
Expand All @@ -670,7 +670,7 @@ export const AppForm = ({ id }: AppFormProps): React.ReactElement => {
</FormControl>
)}
/>
</div>
</StyledFormSection>
<hr />
<div className="button-section">
<div className="prev">
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/app-sharing/app-sharing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export const AppSharing = ({
) : (
<></>
)}
<Item sx={{ pb: '16px' }}>
<Item>
<Box>
<Paper elevation={0}>
<Stack direction="column">
Expand Down
5 changes: 3 additions & 2 deletions ui/src/components/thumbnail/thumbnail.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
flex-direction: row;
width: 500px;
height: 180px;
padding: 10px 0;
border: none;
}

Expand All @@ -13,10 +12,11 @@
width: 100%;
height: 100%;
background-color: #90969c;
border-radius: 4px;
}

.thumbnail-body.selected {
background-color: var(--white);
background-color: transparent;
}

.thumbnail-body.dragging {
Expand All @@ -29,6 +29,7 @@

.thumbnail-img {
max-height: 150px;
border-radius: 4px;
}

.thumbnail-icon-container {
Expand Down
8 changes: 5 additions & 3 deletions ui/src/pages/create-app/create-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { AppForm } from '@src/components';
import { APP_BASE_URL } from '@src/utils/constants';
import { navigateToUrl } from '@src/utils/jupyterhub';
import React from 'react';
import { StyledFormHeading } from '../../styles/styled-form-heading';
import { StyledFormParagraph } from '../../styles/styled-form-paragraph';
import { Item } from '../../styles/styled-item';

export const CreateApp = (): React.ReactElement => {
Expand All @@ -25,8 +27,8 @@ export const CreateApp = (): React.ReactElement => {
</div>
</Item>
<Item>
<h1 className="form-heading">Create a new app</h1>
<p className="form-paragraph">
<StyledFormHeading>Create a new app</StyledFormHeading>
<StyledFormParagraph>
Begin your project by entering the details below. For more
information about creating an app,{' '}
<a
Expand All @@ -38,7 +40,7 @@ export const CreateApp = (): React.ReactElement => {
visit our docs
</a>
.
</p>
</StyledFormParagraph>
</Item>
<Item>
<AppForm />
Expand Down
10 changes: 7 additions & 3 deletions ui/src/pages/edit-app/edit-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { APP_BASE_URL } from '@src/utils/constants';
import { navigateToUrl } from '@src/utils/jupyterhub';
import React from 'react';
import { useSearchParams } from 'react-router-dom';
import { StyledFormHeading } from '../../styles/styled-form-heading';
import { StyledFormParagraph } from '../../styles/styled-form-paragraph';
import { Item } from '../../styles/styled-item';

export const EditApp = (): React.ReactElement => {
Expand All @@ -29,8 +31,10 @@ export const EditApp = (): React.ReactElement => {
</div>
</Item>
<Item>
<h1 className="form-heading">Edit app</h1>
<p className="form-paragraph">
<StyledFormHeading className="form-heading">
Edit app
</StyledFormHeading>
<StyledFormParagraph>
Edit your app details here. For more information on editing your
app,{' '}
<a
Expand All @@ -42,7 +46,7 @@ export const EditApp = (): React.ReactElement => {
visit our docs
</a>
.
</p>
</StyledFormParagraph>
</Item>
<Item>
<>{id ? <AppForm id={id} /> : <>No app found.</>}</>
Expand Down
Loading
Loading