Skip to content
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

feat: add nests (a.k.a namespaces) #4112

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f23c0e3
feat(nest): update proto definitions
andresmanelli Nov 8, 2024
37b805f
feat(nest): update sql migrations
andresmanelli Nov 8, 2024
b4a4c82
feat(nest): update store
andresmanelli Nov 8, 2024
94f9ed2
feat(nest): update router
andresmanelli Nov 8, 2024
388d66b
feat(nest): add global nest selection
andresmanelli Nov 8, 2024
803888f
feat(nest): add nest banner
andresmanelli Nov 8, 2024
9a62aa9
feat(nest): filter requests with selected nest
andresmanelli Nov 8, 2024
0cfd2fc
feat(nest): fix eslint
andresmanelli Nov 8, 2024
5a5f7eb
feat(nest): fix migrations
andresmanelli Nov 8, 2024
57bdf76
feat(nest): update metadata on nest change
andresmanelli Nov 10, 2024
c5b1939
feat(nest): update proto to use nest name as input
andresmanelli Nov 11, 2024
76c6451
feat(nest): add nest_service.go
andresmanelli Nov 11, 2024
7e5e73e
feat(nest): use nest type to list nests and filter metadata
andresmanelli Nov 11, 2024
22e4432
fix buf lint
andresmanelli Nov 11, 2024
37b640e
feat(nest): add default nest user setting
andresmanelli Nov 12, 2024
8a75c56
feat(nest): add create nest popover
andresmanelli Nov 13, 2024
754e766
feat(nest): fix swagger docs
andresmanelli Nov 13, 2024
7d6832a
feat(nest): fix eslint
andresmanelli Nov 13, 2024
63991de
feat(nest): rewrite function as static
andresmanelli Nov 13, 2024
6dacec3
feat(nest): add missing nest entry in create and update memo for mysq…
andresmanelli Nov 13, 2024
a3a1f0f
feat(nest): update migration scripts
andresmanelli Nov 13, 2024
e8057c3
feat(nest): change uid to name
andresmanelli Nov 13, 2024
92cf6c0
feat(nest): remove pagination for nests
andresmanelli Nov 13, 2024
076bd71
feat(nest): remove and clean update timestamp logic
andresmanelli Nov 13, 2024
7b1a198
feat(nest): fix fetch nests on sign in
andresmanelli Nov 13, 2024
1a97d16
feat(nest): fix tags in explore view
andresmanelli Nov 13, 2024
d2b9bd8
feat(nest): set default nest for all existing memos
andresmanelli Nov 14, 2024
96c6e18
feat(nest): fix create table for migrations
andresmanelli Nov 14, 2024
44297d4
feat(nest): fix hide nest banner if no user is logged in
andresmanelli Nov 14, 2024
7429a00
feat(nest): add default nest user setting
andresmanelli Nov 14, 2024
5d802ca
feat(nest): fix eslint
andresmanelli Nov 14, 2024
5f3226c
feat(nest): fix golangci
andresmanelli Nov 14, 2024
3ae5603
feat(nest): put migration in 0.23 directory
andresmanelli Nov 15, 2024
6a46326
feat(nest): add first revision of delete nest functionality
andresmanelli Nov 16, 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
5 changes: 5 additions & 0 deletions proto/api/v1/memo_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ message Memo {

// The location of the memo.
optional Location location = 20;

// The nest of the memo.
string nest = 21;
}

message MemoProperty {
Expand All @@ -202,6 +205,8 @@ message CreateMemoRequest {
repeated MemoRelation relations = 4;

optional Location location = 5;

string nest = 6;
}

enum MemoView {
Expand Down
99 changes: 99 additions & 0 deletions proto/api/v1/nest_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
syntax = "proto3";

package memos.api.v1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";

option go_package = "gen/api/v1";

service NestService {
// CreateNest creates a new nest.
rpc CreateNest(CreateNestRequest) returns (Nest) {
option (google.api.http) = {
post: "/api/v1/nests"
body: "name"
};
}
// ListNests lists all nests.
rpc ListNests(ListNestsRequest) returns (ListNestsResponse) {
option (google.api.http) = {get: "/api/v1/nests"};
}
// GetNest returns a nest by id.
rpc GetNest(GetNestRequest) returns (Nest) {
option (google.api.http) = {get: "/api/v1/{id=nests/*}"};
option (google.api.method_signature) = "id";
}
// GetNestByName returns a nest by name.
rpc GetNestByName(GetNestByNameRequest) returns (Nest) {
option (google.api.http) = {get: "/api/v1/nests:by-name/{name}"};
option (google.api.method_signature) = "name";
}
// UpdateNest updates a nest.
rpc UpdateNest(UpdateNestRequest) returns (Nest) {
option (google.api.http) = {
patch: "/api/v1/{nest.id=nests/*}"
body: "nest"
};
option (google.api.method_signature) = "nest,update_mask";
}
// DeleteNest deletes a nest by id.
rpc DeleteNest(DeleteNestRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/api/v1/{id=nests/*}/moveto/{move_to=nests/*}"};
option (google.api.method_signature) = "id,moveto";
}
}

message Nest {
// The id of the nest.
// Format: nests/{id}
// id is the system generated unique identifier.
string id = 1;

// The user defined name of the nest.
string name = 2;

google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

message CreateNestRequest {
string name = 1;
}

message ListNestsRequest {}

message ListNestsResponse {
repeated Nest nests = 1;
}

message GetNestRequest {
// The id of the nest.
// Format: nest/{id}
// id is the system generated unique identifier.
string id = 1;
}

message GetNestByNameRequest {
// The name of the nest.
string name = 1;
}

message UpdateNestRequest {
Nest nest = 1;

google.protobuf.FieldMask update_mask = 2;
}

message DeleteNestRequest {
// The id of the nest.
// Format: nests/{id}
// id is the system generated unique identifier.
string id = 1;

// The nest id where to move the memos of the nest being deleted.
string move_to = 2;
}
2 changes: 2 additions & 0 deletions proto/api/v1/user_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ message UserSetting {
string appearance = 3;
// The default visibility of the memo.
string memo_visibility = 4;
// The default nest of the user.
string nest = 5;
}

message GetUserSettingRequest {
Expand Down
613 changes: 316 additions & 297 deletions proto/gen/api/v1/memo_service.pb.go

Large diffs are not rendered by default.

Loading
Loading