Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: create and read workspace page#1294

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
presleyp merged 13 commits intomainfromworkspace-api/presleyp
May 6, 2022
Merged

Conversation

presleyp
Copy link
Contributor

@presleyppresleyp commentedMay 4, 2022
edited
Loading

This lays groundwork for#1032

  • rename an api call to make room for another one
  • swap swr for xservice
  • add test
  • edit the paths used to read a template and create a workspace because the API has changed since that code was written and they were broken - I did this in the fastest way possible to unblock myself without bloating this PR; I'll change the create workspace flow to use XState when I work on workspace CRUD
  • editrenderWithAuth to work with parameterized routes

@presleyppresleyp self-assigned thisMay 4, 2022
@codecov
Copy link

codecovbot commentedMay 4, 2022
edited
Loading

Codecov Report

Merging#1294 (78f1708) intomain (f911c8a) willincrease coverage by0.34%.
The diff coverage is71.42%.

@@            Coverage Diff             @@##             main    #1294      +/-   ##==========================================+ Coverage   66.08%   66.43%   +0.34%==========================================  Files         281      282       +1       Lines       18424    18466      +42       Branches      220      231      +11     ==========================================+ Hits        12176    12268      +92+ Misses       4984     4940      -44+ Partials     1264     1258       -6
FlagCoverage Δ
unittest-go-macos-latest53.63% <ø> (+0.14%)⬆️
unittest-go-postgres-65.00% <ø> (+0.06%)⬆️
unittest-go-ubuntu-latest55.98% <ø> (+0.01%)⬆️
unittest-go-windows-202251.88% <ø> (-0.02%)⬇️
unittest-js73.14% <71.42%> (+1.53%)⬆️
Impacted FilesCoverage Δ
site/src/AppRouter.tsx0.00% <ø> (ø)
...anizationPage/TemplatePage/CreateWorkspacePage.tsx0.00% <0.00%> (ø)
...ges/OrganizationPage/TemplatePage/TemplatePage.tsx0.00% <0.00%> (ø)
site/src/xServices/workspace/workspaceXService.ts59.09% <59.09%> (ø)
site/src/api/index.ts71.83% <90.90%> (+4.08%)⬆️
site/src/pages/WorkspacePage/WorkspacePage.tsx91.66% <91.66%> (ø)
site/src/forms/CreateWorkspaceForm.tsx91.30% <100.00%> (+1.83%)⬆️
site/src/testHelpers/index.tsx100.00% <100.00%> (+5.55%)⬆️
site/src/xServices/StateContext.tsx92.85% <100.00%> (+0.54%)⬆️
site/src/xServices/terminal/terminalXService.ts68.42% <100.00%> (ø)
... and11 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatef911c8a...78f1708. Read thecomment docs.

@presleyppresleyp marked this pull request as ready for reviewMay 5, 2022 04:40
@presleyppresleyp requested a review froma team as acode ownerMay 5, 2022 04:40
Copy link
Member

@kylecarbskylecarbs left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -15,13 +15,19 @@ export interface CreateWorkspaceForm {
template: Template
onSubmit: (request: CreateWorkspaceRequest) => Promise<Workspace>
onCancel: () => void
organization_id: string
Copy link
Member

Choose a reason for hiding this comment

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

Should this beorganizationID to match othercamelCase fields in this type?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I left it snakecased because it gets piped directly out of and into api calls, but I agree the inconsistency isn't good. I guess I'll ask about this at FE V, we have some other spots like this.

kylecarbs reacted with thumbs up emoji
const workspaceId = firstOrItem(workspaceQueryParam, null)

const xServices = useContext(XServiceContext)
const [workspaceState, workspaceSend] = useActor(xServices.workspaceXService)
Copy link
Member

Choose a reason for hiding this comment

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

If I understand correctly, this uses a global XState service. WoulduseMachine be more appropriate here since the machine should only be active for the lifecycle of this page?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I was thinking it would be active for longer but maybe that's not actually desired since it's for a specific workspace. I can make it local for now anduseMachine and we can hoist it later if needed.

Copy link
Member

Choose a reason for hiding this comment

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

Neato neato

Copy link
ContributorAuthor

@presleyppresleypMay 5, 2022
edited
Loading

Choose a reason for hiding this comment

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

@kylecarbs Actually I think we'll want it to outlive the component because we're using separate pages for things like the create/edit form and the parts of the timeline. Does that sound right?

@presleyppresleyp changed the titleWorkspace api/presleypfix: create and read workspace pageMay 5, 2022
Copy link
Member

@code-ashercode-asher left a comment

Choose a reason for hiding this comment

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

Looks great!

I wonder if we could tweak the workspace endpoint in the future to include more info so we can avoid three calls on the FE but I might be overthinking it 😂

presleyp reacted with thumbs up emoji
@presleyppresleyp merged commita2be7c0 intomainMay 6, 2022
@presleyppresleyp deleted the workspace-api/presleyp branchMay 6, 2022 14:02
@missknissmisskniss added this to theV2 Beta milestoneMay 15, 2022
kylecarbs pushed a commit that referenced this pull requestJun 10, 2022
* Change name of existing workspace call* Add new api call (has handler already)* WorkspacesPage -> WorkspacePage* starting to replace swr* Add other api calls* Fix api call* Replace swr with xstate* Format* Test - wip* Fix route in template page* Fix endpoint in create workspace* Fix tests* Lint
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@kylecarbskylecarbskylecarbs approved these changes

@code-ashercode-ashercode-asher approved these changes

Assignees

@presleyppresleyp

Labels
None yet
Projects
None yet
Milestone
V2 Beta
Development

Successfully merging this pull request may close these issues.

4 participants
@presleyp@kylecarbs@code-asher@misskniss

[8]ページ先頭

©2009-2025 Movatter.jp