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

feat(ws): Notebooks 2.0 // Frontend // Workspaces details // Pod template tab #173 #197

Open
wants to merge 2 commits into
base: notebooks-v2
Choose a base branch
from

Conversation

liavweiss
Copy link

As requested I added a code editor for the Pod Template section under the workspace details.
image

The editor will display the all yaml (mocked in the code) as read-only and will utilize the full height of its parent.

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

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 PR, @liavweiss !

isLineNumbersVisible
isFullHeight
isReadOnly
code={podTemplateYaml || '# No podTemplate data available'}
Copy link

Choose a reason for hiding this comment

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

Suggested change
code={podTemplateYaml || '# No podTemplate data available'}
code={podTemplateYaml || '# No pod template data available'}

@@ -72,7 +73,9 @@ export const WorkspaceDetails: React.FunctionComponent<WorkspaceDetailsProps> =
aria-label="Pod template"
>
<TabContent id="podTemplateBodyPadding">
<TabContentBody hasPadding>Pod template</TabContentBody>
<TabContentBody hasPadding style={{ height: '500px' }}>
Copy link

Choose a reason for hiding this comment

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

Ideally, the tab content body should fill the remaining height of the drawer until the bottom of the drawer, while keeping the scroll in the code editor.

Copy link
Member

@jenny-s51 jenny-s51 left a comment

Choose a reason for hiding this comment

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

@liavweiss great work on this! I've added a suggested workaround below to fix the issue you were running into with the drawer height.

Liav Weiss (EXT-Nokia) added 2 commits February 12, 2025 09:48
@liavweiss
Copy link
Author

liavweiss commented Feb 12, 2025

After help from Jenny, and fixed all comments
image

I ran manually in my local branch

  • npm run test:fix
  • npm run test

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.

Hi @liavweiss @jenny-s51 , thanks for the PR and changes. I tried it locally, and I get the behavior below. Was the code editor supposed to adjust its height to align with the bottom of the screen?

codeeditorheight.webm

@@ -94,10 +94,13 @@
"webpack-merge": "^5.10.0"
},
"dependencies": {
"@patternfly/react-code-editor": "^6.1.0",

Choose a reason for hiding this comment

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

Probably best to keep it at 6.0.0 atm to align with the other PatternFly dependencies.

Suggested change
"@patternfly/react-code-editor": "^6.1.0",
"@patternfly/react-code-editor": "^6.0.0",

Comment on lines +76 to +78
<TabContentBody hasPadding>
<WorkspaceDetailsPodTemplate />
</TabContentBody>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<TabContentBody hasPadding>
<WorkspaceDetailsPodTemplate />
</TabContentBody>
<TabContentBody className="pf-v6-u-h-100" hasPadding>
<WorkspaceDetailsPodTemplate codeEditorHeight="100%" />
</TabContentBody>

@@ -72,7 +73,9 @@ export const WorkspaceDetails: React.FunctionComponent<WorkspaceDetailsProps> =
aria-label="Pod template"
>
<TabContent id="podTemplateBodyPadding">
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<TabContent id="podTemplateBodyPadding">
<TabContent style={{ flex: 1 }} className="pf-v6-u-h-100" id="podTemplateBodyPadding">

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

Successfully merging this pull request may close these issues.

3 participants