Skip to content

feat(coderd): add ability to mark workspaces as favorite #11673

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

Closed
wants to merge 27 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
46ca00d
feat(coderd): add user_pinned_workspaces table
johnstcn Jan 16, 2024
015aabb
add unique index
johnstcn Jan 17, 2024
0b0dce6
rename migration
johnstcn Jan 17, 2024
9878da7
add queries to pin/unpin workspace
johnstcn Jan 17, 2024
4fba238
add pinned status to GetWorkspaces/GetAuthorizedWorkspaces queries
johnstcn Jan 17, 2024
83b03d9
add API endpoints and test (currently fails)
johnstcn Jan 18, 2024
0961298
rename to favorite workspace
johnstcn Jan 18, 2024
a814b65
move to top-level test
johnstcn Jan 22, 2024
89d618d
s/favored/favorite/g
johnstcn Jan 22, 2024
7238b95
move favorite status to workspaces table to avoid sqlc join sadness
johnstcn Jan 22, 2024
4eef59a
more wiring
johnstcn Jan 22, 2024
0f8904d
improve test to include sort order of favorites
johnstcn Jan 22, 2024
d921aa0
fix swagger summary
johnstcn Jan 22, 2024
b68c18e
make gen
johnstcn Jan 22, 2024
3d0545a
use dbfake for testing sort order
johnstcn Jan 22, 2024
46103a4
reduce scope of TestWorkspaceFavoriteUnfavorite to not include sortin…
johnstcn Jan 22, 2024
f6c0361
beef up sort order test
johnstcn Jan 22, 2024
89f0f50
rm unnecessary fixture
johnstcn Jan 22, 2024
c9ed43c
fix sort ordering, dbfake still TODO
johnstcn Jan 22, 2024
ff3cde2
remove unnecessary change to CreateFirstUser
johnstcn Jan 23, 2024
f735b69
best-effort fix but testing dbmem sort order is a waste of time
johnstcn Jan 23, 2024
f6e9531
requestor->requester
johnstcn Jan 23, 2024
34f2902
fixup! remove unnecessary change to CreateFirstUser
johnstcn Jan 23, 2024
99c7f96
remove unused resource
johnstcn Jan 23, 2024
d530546
fix sort ordering bug in dmem
johnstcn Jan 23, 2024
6392db9
add test case
johnstcn Jan 23, 2024
9979c53
remove need for conditional ordering
johnstcn Jan 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix swagger summary
  • Loading branch information
johnstcn committed Jan 23, 2024
commit d921aa0ef86b01924fcd3e7fa3692cec526b1903
6 changes: 2 additions & 4 deletions coderd/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -1028,10 +1028,9 @@ func (api *API) putExtendWorkspace(rw http.ResponseWriter, r *http.Request) {
httpapi.Write(ctx, rw, code, resp)
}

// @Summary Favor workspace by ID.
// @Summary Favorite workspace by ID.
// @ID favorite-workspace-by-id
// @Security CoderSessionToken
// @Accept json
// @Tags Workspaces
// @Param workspace path string true "Workspace ID" format(uuid)
// @Success 204
Expand Down Expand Up @@ -1067,10 +1066,9 @@ func (api *API) putFavoriteWorkspace(rw http.ResponseWriter, r *http.Request) {
rw.WriteHeader(http.StatusNoContent)
}

// @Summary Unfavor workspace by ID.
// @Summary Unfavorite workspace by ID.
// @ID unfavorite-workspace-by-id
// @Security CoderSessionToken
// @Accept json
// @Tags Workspaces
// @Param workspace path string true "Workspace ID" format(uuid)
// @Success 204
Expand Down