Skip to content

Commit

Permalink
Merge branch 'main' into feat-web/remove-multiple-user-members-from-w…
Browse files Browse the repository at this point in the history
…orkspace
  • Loading branch information
nourbalaha authored Oct 24, 2024
2 parents 64e5ae4 + 935ca4d commit e270acc
Show file tree
Hide file tree
Showing 39 changed files with 1,802 additions and 1,425 deletions.
4 changes: 3 additions & 1 deletion server/e2e/gql_workspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"strings"
"testing"

"github.com/reearth/reearth-cms/server/internal/app"
Expand Down Expand Up @@ -270,7 +271,8 @@ func TestRemoveUserFromWorkspace(t *testing.T) {
assert.Nil(t, err)
assert.True(t, w.Members().HasUser(uId3))

query := fmt.Sprintf(`mutation { removeUserFromWorkspace(input: {workspaceId: "%s", userId: "%s"}){ workspace{ id } }}`, wId2, uId3)
uIds := accountdomain.UserIDList{uId2, uId3}
query := fmt.Sprintf(`mutation { removeMultipleMembersFromWorkspace(input: {workspaceId: "%s", userIds: ["%s"]}){ workspace{ id } }}`, wId2, strings.Join(uIds.Strings(), "\", \""))
request := GraphQLRequest{
Query: query,
}
Expand Down
35 changes: 31 additions & 4 deletions server/e2e/publicapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,42 @@ func TestPublicAPI(t *testing.T) {
"error": "not found",
})

e.GET("/api/p/{project}/assets", publicAPIProjectAlias).
Expect().
Status(http.StatusOK).
JSON().
IsEqual(map[string]any{
"hasMore": false,
"limit": 50,
"offset": 0,
"page": 1,
"results": []map[string]any{
map[string]any{
"id": publicAPIAsset1ID.String(),
"type": "asset",
"url": fmt.Sprintf("https://example.com/assets/%s/%s/aaa.zip", publicAPIAssetUUID[:2], publicAPIAssetUUID[2:]),
"contentType": "application/zip",
"files": []string{
fmt.Sprintf("https://example.com/assets/%s/%s/aaa/bbb.txt", publicAPIAssetUUID[:2], publicAPIAssetUUID[2:]),
fmt.Sprintf("https://example.com/assets/%s/%s/aaa/ccc.txt", publicAPIAssetUUID[:2], publicAPIAssetUUID[2:]),
},
},
},
"totalCount": 1,
})

e.GET("/api/p/{project}/assets/{assetid}", publicAPIProjectAlias, publicAPIAsset1ID).
Expect().
Status(http.StatusOK).
JSON().
IsEqual(map[string]any{
"type": "asset",
"id": publicAPIAsset1ID.String(),
"url": fmt.Sprintf("https://example.com/assets/%s/%s/aaa.zip", publicAPIAssetUUID[:2], publicAPIAssetUUID[2:]),
"type": "asset",
"id": publicAPIAsset1ID.String(),
"url": fmt.Sprintf("https://example.com/assets/%s/%s/aaa.zip", publicAPIAssetUUID[:2], publicAPIAssetUUID[2:]),
"contentType": "application/zip",
"files": []string{
fmt.Sprintf("https://example.com/assets/%s/%s/aaa/bbb.txt", publicAPIAssetUUID[:2], publicAPIAssetUUID[2:]),
fmt.Sprintf("https://example.com/assets/%s/%s/aaa/ccc.txt", publicAPIAssetUUID[:2], publicAPIAssetUUID[2:]),
},
})

Expand Down Expand Up @@ -354,7 +380,8 @@ func publicAPISeeder(ctx context.Context, r *repo.Container) error {

a := asset.New().ID(publicAPIAsset1ID).Project(p1.ID()).CreatedByUser(uid).Size(1).Thread(id.NewThreadID()).
FileName("aaa.zip").UUID(publicAPIAssetUUID).MustBuild()
af := asset.NewFile().Name("bbb.txt").Path("aaa/bbb.txt").Build()
c := []*asset.File{asset.NewFile().Name("bbb.txt").Path("aaa/bbb.txt").Build(), asset.NewFile().Name("ccc.txt").Path("aaa/ccc.txt").Build()}
af := asset.NewFile().Name("aaa.zip").Path("aaa.zip").ContentType("application/zip").Size(10).Children(c).Build()

fid := id.NewFieldID()
gst := schema.GeometryObjectSupportedTypeList{schema.GeometryObjectSupportedTypePoint, schema.GeometryObjectSupportedTypeLineString}
Expand Down
2 changes: 1 addition & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/oapi-codegen/runtime v1.1.1
github.com/paulmach/go.geojson v1.5.0
github.com/ravilushqa/otelgqlgen v0.17.0
github.com/reearth/reearthx v0.0.0-20240308140749-72a08570c19b
github.com/reearth/reearthx v0.0.0-20241023075926-e29bdd6c4ae3
github.com/robbiet480/go.sns v0.0.0-20230523235941-e8d832c79d68
github.com/samber/lo v1.47.0
github.com/sendgrid/sendgrid-go v3.16.0+incompatible
Expand Down
4 changes: 2 additions & 2 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSg
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/ravilushqa/otelgqlgen v0.17.0 h1:bLwQfKqtj9P24QpjM2sc1ipBm5Fqv2u7DKN5LIpj3g8=
github.com/ravilushqa/otelgqlgen v0.17.0/go.mod h1:orOIikuYsay1y3CmLgd5gsHcT9EsnXwNKmkAplzzYXQ=
github.com/reearth/reearthx v0.0.0-20240308140749-72a08570c19b h1:wfTQ4SazfN9hYe13PqwnwB/E3Tw9+f99Y97iQRqOjso=
github.com/reearth/reearthx v0.0.0-20240308140749-72a08570c19b/go.mod h1:d1WXkdCVzSoc8pl3vW9/9yKfk4fdoZQZhX8Ot8jqgnc=
github.com/reearth/reearthx v0.0.0-20241023075926-e29bdd6c4ae3 h1:aFm6QNDFs08EKlrWJN9IBqdxlDUuCBIIgBIcPkLHOZY=
github.com/reearth/reearthx v0.0.0-20241023075926-e29bdd6c4ae3/go.mod h1:d1WXkdCVzSoc8pl3vW9/9yKfk4fdoZQZhX8Ot8jqgnc=
github.com/robbiet480/go.sns v0.0.0-20230523235941-e8d832c79d68 h1:Jknsfy5cqCH6qAuoU1qNZ51hfBJfMSJYwsH9j9mdVnw=
github.com/robbiet480/go.sns v0.0.0-20230523235941-e8d832c79d68/go.mod h1:9CDhL7uDVy8vEVDNPJzxq89dPaPBWP6hxQcC8woBHus=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
Expand Down
Loading

0 comments on commit e270acc

Please sign in to comment.