Skip to content

chore(ui): UI improvements to workspace properties configuration step #1

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

Open
wants to merge 1 commit into
base: workspace-create-properties
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Divider,
Split,
SplitItem,
Content,
} from '@patternfly/react-core';
import { WorkspaceCreationImageDetails } from '~/app/pages/Workspaces/Creation/image/WorkspaceCreationImageDetails';
import { WorkspaceCreationPropertiesTable } from '~/app/pages/Workspaces/Creation/properties/WorkspaceCreationPropertiesTable';
Expand Down Expand Up @@ -39,6 +40,9 @@ const WorkspaceCreationPropertiesSelection: React.FunctionComponent<
);

return (
<Content style={{ height: '100%' }}>
<p>Configure properties for your workspace.</p>
<Divider />
<Split hasGutter>
<SplitItem style={{ minWidth: '200px' }}>{imageDetailsContent}</SplitItem>
<SplitItem isFilled>
Expand Down Expand Up @@ -69,7 +73,7 @@ const WorkspaceCreationPropertiesSelection: React.FunctionComponent<
<Divider />
<div className="pf-u-mb-0">
<ExpandableSection
toggleText={isVolumesExpanded ? 'Volumes' : 'Add Volumes'}
toggleText="Volumes"
onToggle={() => setIsVolumesExpanded((prev) => !prev)}
isExpanded={isVolumesExpanded}
isIndented
Expand Down Expand Up @@ -97,7 +101,7 @@ const WorkspaceCreationPropertiesSelection: React.FunctionComponent<
</div>
{!isVolumesExpanded && (
<div style={{ paddingLeft: '36px', marginTop: '-10px' }}>
<div>Workspace volume enables your project data to be persist</div>
<div>Workspace volumes enable your project data to persist.</div>
<div className="pf-u-font-size-sm">
<strong>{volumes.length} added</strong>
</div>
Expand All @@ -107,6 +111,7 @@ const WorkspaceCreationPropertiesSelection: React.FunctionComponent<
</div>
</SplitItem>
</Split>
</Content>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
ModalFooter,
Form,
FormGroup,
ModalHeader,
} from '@patternfly/react-core';

interface Volume {
Expand Down Expand Up @@ -140,16 +141,12 @@ export const WorkspaceCreationPropertiesTable: React.FC<WorkspaceCreationPropert
Create Volume
</Button>

<Modal
title={editIndex !== null ? 'Edit Volume' : 'Create Volume'}
isOpen={isModalOpen}
onClose={resetForm}
variant={ModalVariant.small}
>
<Modal isOpen={isModalOpen} onClose={resetForm} variant={ModalVariant.small}>
<ModalHeader
title={editIndex !== null ? 'Edit Volume' : 'Create Volume'}
description="Add a volume and optionally connect it with an existing workspace."
/>
<ModalBody>
<div> Add volume and optionally connect it with an existing workspace.</div>
<div className="pf-u-font-size-sm" />
<div className="pf-c-form">
<Form>
<FormGroup label="PVC Name" isRequired fieldId="pvc-name">
<TextInput
Expand All @@ -163,24 +160,23 @@ export const WorkspaceCreationPropertiesTable: React.FC<WorkspaceCreationPropert
</FormGroup>
<FormGroup label="Mount Path" isRequired fieldId="mount-path">
<TextInput
name="mountPath"
name="mountPath"
isRequired
type="text"
value={formData.mountPath}
onChange={(_, val) => setFormData({ ...formData, mountPath: val })}
value={formData.mountPath}
onChange={(_, val) => setFormData({ ...formData, mountPath: val })}
id="mount-path"
/>
/>
</FormGroup>
</Form>
</div>
</ModalBody>
<ModalFooter>
<Button
key="confirm"
onClick={handleAddOrEdit}
isDisabled={!formData.pvcName || !formData.mountPath}
>
{editIndex !== null ? 'Save' : 'Add'}
{editIndex !== null ? 'Save' : 'Create'}
</Button>
<Button key="cancel" variant="link" onClick={resetForm}>
Cancel
Expand Down
4 changes: 2 additions & 2 deletions workspaces/frontend/src/shared/style/MUI-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,8 @@
}

.mui-theme .pf-v6-c-modal-box {
--pf-v6-c-modal-box--BorderRadius: 0;
border: 2px solid var(--mui-palette-common-black);
--pf-v6-c-modal-box--BorderRadius: var(--mui-shape-borderRadius);
--pf-v6-c-modal-box--BoxShadow: var(--mui-shadows-24);
}

.mui-theme .pf-v6-c-button.pf-m-plain {
Expand Down