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

Austenem/CAT-898 R template updates #3540

Merged
merged 11 commits into from
Sep 17, 2024
Merged

Conversation

austenem
Copy link
Collaborator

Summary

Updates the Launch Workspace and Edit Templates dialogs to account for new blank R template. Includes the following changes:

  1. Add "Jupyter Lab (Python + R)" tag to R templates and append to titles.
  2. Add "Jupyter Lab (Python + R)" tag to recommended tags.
  3. Order templates with both blank templates (Python, then Python + R) first.
  4. Show incompatibility tooltip for R templates if "Jupyter Lab (Python + R)" job type is not selected.
  5. Select blank R notebook automatically if "Jupyter Lab (Python + R)" job type is selected.

Design Documentation/Original Tickets

CAT-898 Jira ticket

Figma mockups

Testing

Tested by manually going through both workspace dialogs and checking the listed changes.

Screenshots/Video

Screenshot 2024-09-16 at 1 17 57 PM

Checklist

  • Code follows the project's coding standards
    • Lint checks pass locally
    • New CHANGELOG-your-feature-name-here.md is present in the root directory, describing the change(s) in full sentences.
  • Unit tests covering the new feature have been added
  • All existing tests pass
  • Any relevant documentation in JIRA/Confluence has been updated to reflect the new feature
  • Any new functionalities have appropriate analytics functionalities added

Copy link
Collaborator

@john-conroy john-conroy left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just two minor comments.

selectItem={selectItem}
selectedTemplates={selectedTemplates}
disabledTemplates={disabledTemplates}
trackingInfo={{ category: WorkspacesEventCategories.WorkspaceDialog }}
jobType={jobType.value as string}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this assertion necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without this, jobType.value could potentially be a string array - however I believe the workspaceJobTypeIdField defines the field value as a string.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like workspaceJobTypeId isn't defined in FormType, which only contains templates: string[] since it extends FormWithTemplates:

image

Since there's no property name that matches workspaceJobTypeIdField in the form type, TS treats this as either a string or string-array by default.

I believe that extending FormType to include workspace ID should work, e.g.:

interface FormWithWorkspaceJobId extends FormWithTemplates {
  workspaceJobTypeId: string;
}

...

interface ControllerProps<FormType extends FormWithWorkspaceJobId> {

...

function SelectableTemplateGrid<FormType extends FormWithWorkspaceJobId>({

I tested this approach out to see if it would work, but it doesn't seem to do the trick, oddly enough.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we file a ticket to resolve this later?

Copy link
Collaborator

@NickAkhmetov NickAkhmetov left a comment

Choose a reason for hiding this comment

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

Seconding John's feedback, but no further ideas for improvement on my end 👍

Copy link
Collaborator

@john-conroy john-conroy left a comment

Choose a reason for hiding this comment

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

@austenem let's file a ticket to figure out the type issues.

@austenem austenem merged commit 8c0df6b into main Sep 17, 2024
8 checks passed
@austenem austenem deleted the austenem/cat-898-r-template-updates branch September 17, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants