Skip to content

feat(ws): Add properties tile to new workspace creation #262

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 2 commits into
base: notebooks-v2
Choose a base branch
from

Conversation

henschwartz
Copy link

this PR resolve issue #225

Signed-off-by: Hen Schwartz (EXT-Nokia) <hen.schwartz@nokia.com>
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ederign for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jenny-s51
Copy link
Member

jenny-s51 commented Apr 22, 2025

Great work here @henschwartz! I’ve PR‑ed your branch with a several tweaks, which includes:

  • Fix for the modal title so it’s now rendering correctly
  • Investigated the compact table issue - it is applying the correct pf-m-compact modifier and styling 🎉:
Screenshot 2025-04-22 at 5 00 48 PM

Copy link

@paulovmr paulovmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @henschwartz ! I like the updates proposed by @jenny-s51 in her PR to your branch. I left a few more comments below.

import { WorkspaceCreationPropertiesTable } from '~/app/pages/Workspaces/Creation/properties/WorkspaceCreationPropertiesTable';
import { WorkspaceImage } from '~/shared/types';

interface Volume {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a part of the Workspace type that has the volumes inside it. Please consider extracting two types there (WorkspaceVolumes containing what is inside the volumes field and WorkspaceVolume containing what is inside the data field). Then this interface would not be needed, and the WorkspaceVolume type created could be used instead of it.

FormGroup,
} from '@patternfly/react-core';

interface Volume {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

readOnly: boolean;
}

interface WorkspaceCreationPropertiesTableProps {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interface WorkspaceCreationPropertiesTableProps {
interface WorkspaceCreationPropertiesVolumesProps {

setVolumes: React.Dispatch<React.SetStateAction<Volume[]>>;
}

export const WorkspaceCreationPropertiesTable: React.FC<WorkspaceCreationPropertiesTableProps> = ({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const WorkspaceCreationPropertiesTable: React.FC<WorkspaceCreationPropertiesTableProps> = ({
export const WorkspaceCreationPropertiesVolumes: React.FC<WorkspaceCreationPropertiesVolumesProps> = ({

const [deleteIndex, setDeleteIndex] = useState<number | null>(null);
const [dropdownOpen, setDropdownOpen] = useState<number | null>(null);

const handleAddOrEdit = () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider using useCallback here.

resetForm();
};

const handleEdit = (index: number) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider using useCallback here.

setIsModalOpen(true);
};

const openDetachModal = (index: number) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider using useCallback here.

setIsDeleteModalOpen(true);
};

const handleDelete = () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider using useCallback here.

}
};

const resetForm = () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider using useCallback here.

Signed-off-by: Hen Schwartz (EXT-Nokia) <hen.schwartz@nokia.com>
Copy link

@paulovmr paulovmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @henschwartz ! I left two more comments, and also there are a few linting errors, you can check and automatically fix some of them with npm run test:fix.

@@ -0,0 +1,205 @@
import React, { useCallback, useState } from 'react';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be called WorkspaceCreationPropertiesVolumes.tsx.

/>
<ModalBody>
<Form>
<FormGroup label="PVC Name" isRequired fieldId="pvc-name">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the volume creation modal should allow the user to set the volume as read-only with the slider component, like in the table.

@paulovmr
Copy link

/ok-to-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

3 participants