From ab57d74a312f325b9d889752aa92c00c395de20f Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 8 Nov 2020 19:18:44 +0100 Subject: deal with the previous changes --- api/graphql/models/lazy_identity.go | 49 +++---------------------------------- 1 file changed, 4 insertions(+), 45 deletions(-) (limited to 'api/graphql/models') diff --git a/api/graphql/models/lazy_identity.go b/api/graphql/models/lazy_identity.go index 344bb5f0..002c38e4 100644 --- a/api/graphql/models/lazy_identity.go +++ b/api/graphql/models/lazy_identity.go @@ -7,8 +7,6 @@ import ( "github.com/MichaelMure/git-bug/cache" "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/identity" - "github.com/MichaelMure/git-bug/util/lamport" - "github.com/MichaelMure/git-bug/util/timestamp" ) // IdentityWrapper is an interface used by the GraphQL resolvers to handle an identity. @@ -21,11 +19,8 @@ type IdentityWrapper interface { Login() (string, error) AvatarUrl() (string, error) Keys() ([]*identity.Key, error) - ValidKeysAtTime(time lamport.Time) ([]*identity.Key, error) DisplayName() string IsProtected() (bool, error) - LastModificationLamport() (lamport.Time, error) - LastModification() (timestamp.Timestamp, error) } var _ IdentityWrapper = &lazyIdentity{} @@ -69,6 +64,10 @@ func (li *lazyIdentity) Name() string { return li.excerpt.Name } +func (li *lazyIdentity) DisplayName() string { + return li.excerpt.DisplayName() +} + func (li *lazyIdentity) Email() (string, error) { id, err := li.load() if err != nil { @@ -101,18 +100,6 @@ func (li *lazyIdentity) Keys() ([]*identity.Key, error) { return id.Keys(), nil } -func (li *lazyIdentity) ValidKeysAtTime(time lamport.Time) ([]*identity.Key, error) { - id, err := li.load() - if err != nil { - return nil, err - } - return id.ValidKeysAtTime(time), nil -} - -func (li *lazyIdentity) DisplayName() string { - return li.excerpt.DisplayName() -} - func (li *lazyIdentity) IsProtected() (bool, error) { id, err := li.load() if err != nil { @@ -121,22 +108,6 @@ func (li *lazyIdentity) IsProtected() (bool, error) { return id.IsProtected(), nil } -func (li *lazyIdentity) LastModificationLamport() (lamport.Time, error) { - id, err := li.load() - if err != nil { - return 0, err - } - return id.LastModificationLamport(), nil -} - -func (li *lazyIdentity) LastModification() (timestamp.Timestamp, error) { - id, err := li.load() - if err != nil { - return 0, err - } - return id.LastModification(), nil -} - var _ IdentityWrapper = &loadedIdentity{} type loadedIdentity struct { @@ -163,18 +134,6 @@ func (l loadedIdentity) Keys() ([]*identity.Key, error) { return l.Interface.Keys(), nil } -func (l loadedIdentity) ValidKeysAtTime(time lamport.Time) ([]*identity.Key, error) { - return l.Interface.ValidKeysAtTime(time), nil -} - func (l loadedIdentity) IsProtected() (bool, error) { return l.Interface.IsProtected(), nil } - -func (l loadedIdentity) LastModificationLamport() (lamport.Time, error) { - return l.Interface.LastModificationLamport(), nil -} - -func (l loadedIdentity) LastModification() (timestamp.Timestamp, error) { - return l.Interface.LastModification(), nil -} -- cgit From 50cd1a9c177120a78e0c7f4e2f4238d2debfbfc6 Mon Sep 17 00:00:00 2001 From: Sascha Date: Tue, 16 Mar 2021 14:31:28 +0100 Subject: GraphQL: Add EditComment input/payload to gen_models --- api/graphql/models/gen_models.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'api/graphql/models') diff --git a/api/graphql/models/gen_models.go b/api/graphql/models/gen_models.go index 675c4b6b..5bf8ea9e 100644 --- a/api/graphql/models/gen_models.go +++ b/api/graphql/models/gen_models.go @@ -38,6 +38,28 @@ type AddCommentPayload struct { Operation *bug.AddCommentOperation `json:"operation"` } +type EditCommentInput struct { + // A unique identifier for the client performing the mutation. + ClientMutationID *string `json:"clientMutationId"` + // "The name of the repository. If not set, the default repository is used. + RepoRef *string `json:"repoRef"` + // The bug ID's prefix. + Prefix string `json:"prefix"` + // The first message of the new bug. + Message string `json:"message"` + // The collection of file's hash required for the first message. + Files []repository.Hash `json:"files"` +} + +type EditCommentPayload struct { + // A unique identifier for the client performing the mutation. + ClientMutationID *string `json:"clientMutationId"` + // The affected bug. + Bug BugWrapper `json:"bug"` + // The resulting operation. + Operation *bug.EditCommentOperation `json:"operation"` +} + // The connection type for Bug. type BugConnection struct { // A list of edges. -- cgit From c6d15bd52b415b6fbc7a63e6072472402a1491d6 Mon Sep 17 00:00:00 2001 From: Sascha Date: Tue, 16 Mar 2021 15:16:24 +0100 Subject: Fix compilation errors --- api/graphql/models/gen_models.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'api/graphql/models') diff --git a/api/graphql/models/gen_models.go b/api/graphql/models/gen_models.go index 5bf8ea9e..5a120f57 100644 --- a/api/graphql/models/gen_models.go +++ b/api/graphql/models/gen_models.go @@ -8,6 +8,7 @@ import ( "strconv" "github.com/MichaelMure/git-bug/bug" + "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/repository" ) @@ -45,7 +46,9 @@ type EditCommentInput struct { RepoRef *string `json:"repoRef"` // The bug ID's prefix. Prefix string `json:"prefix"` - // The first message of the new bug. + // Target + Target entity.Id `json:"target"` + // The new message to be set. Message string `json:"message"` // The collection of file's hash required for the first message. Files []repository.Hash `json:"files"` -- cgit From 2a1c77236c1c601971ab71f076c85529d1d60a72 Mon Sep 17 00:00:00 2001 From: Sascha Date: Tue, 16 Mar 2021 17:41:25 +0100 Subject: GrapQL: Regenerate the GraphQL-Server --- api/graphql/models/gen_models.go | 49 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'api/graphql/models') diff --git a/api/graphql/models/gen_models.go b/api/graphql/models/gen_models.go index 5a120f57..1046d11a 100644 --- a/api/graphql/models/gen_models.go +++ b/api/graphql/models/gen_models.go @@ -8,7 +8,6 @@ import ( "strconv" "github.com/MichaelMure/git-bug/bug" - "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/repository" ) @@ -39,30 +38,6 @@ type AddCommentPayload struct { Operation *bug.AddCommentOperation `json:"operation"` } -type EditCommentInput struct { - // A unique identifier for the client performing the mutation. - ClientMutationID *string `json:"clientMutationId"` - // "The name of the repository. If not set, the default repository is used. - RepoRef *string `json:"repoRef"` - // The bug ID's prefix. - Prefix string `json:"prefix"` - // Target - Target entity.Id `json:"target"` - // The new message to be set. - Message string `json:"message"` - // The collection of file's hash required for the first message. - Files []repository.Hash `json:"files"` -} - -type EditCommentPayload struct { - // A unique identifier for the client performing the mutation. - ClientMutationID *string `json:"clientMutationId"` - // The affected bug. - Bug BugWrapper `json:"bug"` - // The resulting operation. - Operation *bug.EditCommentOperation `json:"operation"` -} - // The connection type for Bug. type BugConnection struct { // A list of edges. @@ -136,6 +111,30 @@ type CommentEdge struct { Node *bug.Comment `json:"node"` } +type EditCommentInput struct { + // A unique identifier for the client performing the mutation. + ClientMutationID *string `json:"clientMutationId"` + // "The name of the repository. If not set, the default repository is used. + RepoRef *string `json:"repoRef"` + // The bug ID's prefix. + Prefix string `json:"prefix"` + // The target. + Target string `json:"target"` + // The new message to be set. + Message string `json:"message"` + // The collection of file's hash required for the first message. + Files []repository.Hash `json:"files"` +} + +type EditCommentPayload struct { + // A unique identifier for the client performing the mutation. + ClientMutationID *string `json:"clientMutationId"` + // The affected bug. + Bug BugWrapper `json:"bug"` + // The resulting operation. + Operation *bug.EditCommentOperation `json:"operation"` +} + type IdentityConnection struct { Edges []*IdentityEdge `json:"edges"` Nodes []IdentityWrapper `json:"nodes"` -- cgit