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: View templates from WebUI #9304

Merged
merged 4 commits into from
May 8, 2024
Merged

feat: View templates from WebUI #9304

merged 4 commits into from
May 8, 2024

Conversation

gt2345
Copy link
Contributor

@gt2345 gt2345 commented May 3, 2024

Ticket

MD-382

Description

View templates table at templates page, and workspace detail template tab.

Test Plan

With Manage Templates feature flag on.
Navigate to Templates page from sidebar to see a list of templates
Sort, filter, search should work as expected.
Click on action dots to view the content of templates.

Navigate to workspace details page -> template tab
Workspace is no longer filterable, sort and filter by name should work as expected

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

@gt2345 gt2345 added the feature-flagged The changes in this PR are behind a feature flag label May 3, 2024
@gt2345 gt2345 requested review from a team as code owners May 3, 2024 17:22
@gt2345 gt2345 requested review from hkang1 and ioga May 3, 2024 17:22
@cla-bot cla-bot bot added the cla-signed label May 3, 2024
Copy link

netlify bot commented May 3, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit f64c8db
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/663a508bd0f1cd0008251173
😎 Deploy Preview https://deploy-preview-9304--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@gt2345 gt2345 requested review from kkunapuli and removed request for ioga May 3, 2024 17:22
Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 0.69606% with 428 lines in your changes are missing coverage. Please review.

Project coverage is 44.51%. Comparing base (b0a008e) to head (f64c8db).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9304      +/-   ##
==========================================
+ Coverage   44.24%   44.51%   +0.26%     
==========================================
  Files        1275     1278       +3     
  Lines      156260   156655     +395     
  Branches     2450     2453       +3     
==========================================
+ Hits        69145    69734     +589     
+ Misses      86875    86678     -197     
- Partials      240      243       +3     
Flag Coverage Δ
backend 41.82% <100.00%> (-0.01%) ⬇️
harness 64.08% <ø> (+1.48%) ⬆️
web 34.84% <0.23%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
harness/determined/common/api/bindings.py 40.19% <ø> (ø)
master/internal/templates/api.go 71.65% <100.00%> (ø)
webui/react/src/types.ts 99.68% <100.00%> (+<0.01%) ⬆️
webui/react/src/components/Table/Table.tsx 82.80% <0.00%> (ø)
webui/react/src/services/apiConfig.ts 72.64% <0.00%> (-0.04%) ⬇️
webui/react/src/services/decoder.ts 20.46% <0.00%> (ø)
webui/react/src/services/types.ts 0.00% <0.00%> (ø)
webui/react/src/pages/WorkspaceDetails.tsx 0.00% <0.00%> (ø)
.../react/src/pages/Templates/TemplateCreateModal.tsx 0.00% <0.00%> (ø)
webui/react/src/pages/Templates/TemplatesPage.tsx 0.00% <0.00%> (ø)
... and 3 more

... and 13 files with indirect coverage changes

Copy link
Contributor

@kkunapuli kkunapuli left a comment

Choose a reason for hiding this comment

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

Backend changes look good to me! Could add another test case for a little more coverage but that's not a show stopper.

@@ -150,7 +150,7 @@ func TestGetTemplates(t *testing.T) {

t.Run("GetTemplates filter by workspace", func(t *testing.T) {
resp, err := api.GetTemplates(ctx, &apiv1.GetTemplatesRequest{
WorkspaceId: workspaceIDs[0],
WorkspaceIds: []int32{workspaceIDs[0]},
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth unit testing with multiple workspace IDs? Is it possible one workspace ID could be invalid? (I wouldn't think so ...)

Copy link
Contributor

@hkang1 hkang1 left a comment

Choose a reason for hiding this comment

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

Web code looks solid. Put some nit items. One added suggestion of adding a searchable field for workspace filter since workspaces could be a large list.

Screenshot 2024-05-06 at 4 20 31 PM

title: '',
width: DEFAULT_COLUMN_WIDTHS['action'],
},
] as ColumnDef<Template>[];
Copy link
Contributor

Choose a reason for hiding this comment

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

question: would it work to have const columns: ColumnDef<Template>[]?

Copy link
Contributor Author

@gt2345 gt2345 May 7, 2024

Choose a reason for hiding this comment

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

The isFiltered fields are not compatible because we only take (s: unknown) => boolean, but want to pass (s: Settings) => boolean. I'm not sure why we only accept unknown as parameter though...

if (!template || !workspaces) return null;

return (
<Modal size="small" title={`Template ${template.name}`}>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit style: seems pretty narrow for the code editor, but might just be me.
Screenshot 2024-05-06 at 4 18 47 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, changed the modal size to medium and it does look better
Screenshot 2024-05-07 at 11 02 51 AM

@hkang1 hkang1 assigned gt2345 and unassigned hkang1 May 7, 2024
@gt2345 gt2345 merged commit 349d2a5 into main May 8, 2024
83 of 96 checks passed
@gt2345 gt2345 deleted the gt/382-templates-view branch May 8, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed feature-flagged The changes in this PR are behind a feature flag
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants