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

feat: Workspaces filtering#1972

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
f0ssel merged 23 commits intomainfromf0ssel/workspace-filter
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
23 commits
Select commitHold shift + click to select a range
d7c1318
feat: Workspaces filtering
f0sselJun 1, 2022
5cb62d5
Remove error handling
f0sselJun 1, 2022
09011d9
styling
f0sselJun 1, 2022
11836ea
Apply suggestions from code review
f0sselJun 2, 2022
568e3a6
pr fixes
f0sselJun 2, 2022
f1409b2
language
f0sselJun 2, 2022
f8e09e6
push up what I have
f0sselJun 2, 2022
424e933
Add name filter to backend
f0sselJun 2, 2022
5dbf5b4
Add name filter
f0sselJun 2, 2022
2912d03
add backend
f0sselJun 2, 2022
9ea5c14
fix
f0sselJun 2, 2022
93a7d3c
Apply suggestions from code review
f0sselJun 2, 2022
79e71f1
fmt
f0sselJun 2, 2022
5f1ae06
Merge branch 'f0ssel/workspace-filter' of github.com:coder/coder into…
f0sselJun 2, 2022
6b2999d
trim query
f0sselJun 2, 2022
57fe5db
skip invalid key pairs
f0sselJun 2, 2022
0a5d972
fix pq type
f0sselJun 2, 2022
4aea7a0
fix tests
f0sselJun 2, 2022
0dd5552
make gen
f0sselJun 2, 2022
5d0d9bb
fix test
f0sselJun 2, 2022
59e7d5e
flicker less
f0sselJun 2, 2022
912b65c
some styling ideas (#2010)
Kira-PilotJun 3, 2022
30a17e9
fix lower comparison
f0sselJun 3, 2022
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
PrevPrevious commit
NextNext commit
add backend
  • Loading branch information
@f0ssel
f0ssel committedJun 2, 2022
commit2912d038889ca09d6783b37183ec5d463f399ec8
19 changes: 6 additions & 13 deletionscoderd/workspaces.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -142,13 +142,9 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) {
filter := database.GetWorkspacesWithFilterParams{Deleted: false}
if orgFilter != "" {
orgID, err := uuid.Parse(orgFilter)
if err != nil {
httpapi.Write(rw, http.StatusBadRequest, httpapi.Response{
Message: fmt.Sprintf("organization_id must be a uuid: %s", err.Error()),
})
return
if err == nil {
filter.OrganizationID = orgID
}
filter.OrganizationID = orgID
}
if ownerFilter == "me" {
filter.OwnerID = apiKey.UserID
Expand All@@ -161,15 +157,12 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) {
Username: ownerFilter,
Email: ownerFilter,
})
if err != nil {
httpapi.Write(rw, http.StatusBadRequest, httpapi.Response{
Message: "owner must be a uuid or username",
})
return
if err == nil {
filter.OwnerID = user.ID
}
userID = user.ID
} else {
filter.OwnerID = userID
}
filter.OwnerID = userID
}
if nameFilter != "" {
filter.Name = nameFilter
Expand Down
11 changes: 3 additions & 8 deletionscodersdk/workspaces.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"net/http"
"strconv"
"time"

"github.com/google/uuid"
Expand DownExpand Up@@ -199,11 +198,10 @@ func (c *Client) PutExtendWorkspace(ctx context.Context, id uuid.UUID, req PutEx
}

type WorkspaceFilter struct {
OrganizationID uuid.UUID
OrganizationID uuid.UUID `json:"organization_id,omitempty"`
// Owner can be a user_id (uuid), "me", or a username
Owner string
Name string
Deleted bool
Owner string `json:"owner,omitempty"`
Name string `json:"name,omitempty"`
}

// asRequestOption returns a function that can be used in (*Client).Request.
Expand All@@ -220,9 +218,6 @@ func (f WorkspaceFilter) asRequestOption() requestOption {
if f.Name != "" {
q.Set("name", f.Name)
}
if f.Deleted {
q.Set("deleted", strconv.FormatBool(f.Deleted))
}
r.URL.RawQuery = q.Encode()
}
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp