Skip to content

WIP: feat: crud workspaces #72

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

Merged
merged 10 commits into from
Apr 3, 2023
Merged

WIP: feat: crud workspaces #72

merged 10 commits into from
Apr 3, 2023

Conversation

rodrimaia
Copy link
Contributor

@rodrimaia rodrimaia commented Mar 28, 2023

#64

https://www.loom.com/share/269af08124544e81a5e58471ffe2a67c

  • View Workspaces:
    • we are displaying two views: My Workspaces and All Workspaces (the user can still use the quickPick command to filter and open all workspaces)
    • We have also a context menu showing a link to the workspace dashboard page
  • Create Workspaces:
    • A button pointing to the dashboard/create extension page

image

@rodrimaia rodrimaia requested a review from kylecarbs March 28, 2023 14:28
@rodrimaia rodrimaia self-assigned this Mar 28, 2023
@BrunoQuaresma BrunoQuaresma requested review from a team and BrunoQuaresma and removed request for a team March 28, 2023 14:39
@BrunoQuaresma
Copy link
Contributor

I see some plugins asking to confirm the "name" of the thing you want to delete. Probably we want to do the same. What do you think?

Copy link
Member

@bpmct bpmct left a comment

Choose a reason for hiding this comment

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

Any plans to add support for an "edit' button which goes to the workspace settings?

@rodrimaia
Copy link
Contributor Author

Any plans to add support for an "edit' button which goes to the workspace settings?

image
Implementing it now! :)

@rodrimaia rodrimaia marked this pull request as ready for review March 29, 2023 13:03
Comment on lines +12 to +14
if (agents.length === 1) {
folderPath = agents[0].expanded_directory
}
Copy link
Member

Choose a reason for hiding this comment

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

If there is more than 1 agent, does everything fail? Should we randomly choose one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a good question. I am not changing the actual behavior, just extracted it to a new function. the current version also does this agents[0] choice =/ . I am not sure what is the best way to handle multiple agents...

Comment on lines +84 to +86
if (user.roles.find((role) => role.name === "owner")) {
await vscode.commands.executeCommand("setContext", "coder.isOwner", true)
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to check for the owner role? We prefer to do capability checks. You can send a payload to https://dev.coder.com/api/v2/authcheck to see if you can do something. Eg:

{
   "checks":{
      "readAllUsers":{
         "object":{
            "resource_type":"user"
         },
         "action":"read"
      },
   },
}

Is this just to see if we have arbitrary execution of all workspaces?

Copy link
Member

Choose a reason for hiding this comment

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

I think this is ok for now, we but we might want to change this soon, especially with coder/coder#6875

Copy link
Contributor Author

@rodrimaia rodrimaia Mar 31, 2023

Choose a reason for hiding this comment

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

We decided to only show the "all Workspaces" view for users who have the owner role. sure we can revisit this after the owner connections PR

Copy link
Contributor

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

FE code LGTM

@rodrimaia rodrimaia merged commit 93d6de6 into main Apr 3, 2023
@rodrimaia rodrimaia deleted the crud-workspaces branch April 3, 2023 13:59
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.

4 participants