Skip to content

feat: expansion of gitea api to handle columns #31768

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

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
20fde31
feat: add projects/ endpoint for initiating extension of api
eyad-hussein Jul 9, 2024
5814b6d
refactor: refactor logic of adding project to user, update endpoint
eyad-hussein Jul 10, 2024
773bd91
api: create endpoint for changing project status
eyad-hussein Jul 10, 2024
5877fab
api: create endpoint to get standalone projects created by user
eyad-hussein Jul 10, 2024
f8ae9f7
api: implement logic for all project/user related endpoints
eyad-hussein Jul 10, 2024
0bd9d5b
api: implement endpoints for all org-project logic
eyad-hussein Jul 11, 2024
b299237
api: implement logic for all (user and org)/reponame/projects endpoin…
eyad-hussein Jul 12, 2024
49a1961
api(refactor): refactor middlware assignments to each group
eyad-hussein Jul 12, 2024
7bfa546
api: implement logic and endpoint for moving issues between projects …
eyad-hussein Jul 12, 2024
bc0fca4
api: create model to api format convertor for project
eyad-hussein Jul 12, 2024
d5a1ce1
api(refactor): minimize number of endpoints to 2 by refactoring curre…
eyad-hussein Jul 14, 2024
3a5911a
api(refactor): remove unnessesary condition from orgAssignment
eyad-hussein Jul 14, 2024
10c0766
api(refactor): create a common handler for org and repo projects
eyad-hussein Jul 14, 2024
9ca2cdf
docs: set up project files for swagger documentation
eyad-hussein Jul 14, 2024
1b47d91
docs: create swagger api documentation for endpoints
eyad-hussein Jul 15, 2024
d41dc95
refactor: refactor endpoints to comply with github api
eyad-hussein Jul 31, 2024
f3f6908
refactor: remove unnessary condition in reqSelfOrAdmin middleware
eyad-hussein Jul 31, 2024
42c54d0
feat: add pagination support and update swagger documentation
eyad-hussein Aug 1, 2024
0c514b3
Merge branch 'main' into development
techknowlogick Sep 6, 2024
a825ba0
Merge branch 'main' into development
eyad-hussein Sep 18, 2024
cc57d51
tests(api): create tests for project and column handlers
eyad-hussein Sep 20, 2024
0150d09
Merge branch 'main' into development
eyad-hussein Sep 20, 2024
6bd6adb
docs(api): update swagger documentation for projects
eyad-hussein Sep 20, 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
44 changes: 44 additions & 0 deletions models/fixtures/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,47 @@
type: 2
created_unix: 1688973000
updated_unix: 1688973000

- id: 7
title: project in archived repository
owner_id: 0
repo_id: 51
is_closed: false
creator_id: 30
board_type: 1
type: 2
created_unix: 1688973000
updated_unix: 1688973000

- id: 8
title: project1 belongs to org3
owner_id: 3
repo_id: 0
is_closed: true
creator_id: 3
board_type: 1
type: 2
created_unix: 1688973000
updated_unix: 1688973000

- id: 9
title: project2 belongs to org3
owner_id: 3
repo_id: 0
is_closed: false
creator_id: 3
board_type: 1
type: 2
created_unix: 1688973000
updated_unix: 1688973000

- id: 10
title: project2 on repo1
owner_id: 0
repo_id: 1
is_closed: false
creator_id: 2
board_type: 1
type: 2
created_unix: 1688973010
updated_unix: 1688973010

Check failure on line 115 in models/fixtures/project.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

115:27 [new-line-at-end-of-file] no new line character at the end of file
6 changes: 6 additions & 0 deletions models/fixtures/project_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@
issue_id: 5
project_id: 1
project_board_id: 3

-
id: 5
issue_id: 5
project_id: 1
project_board_id: 1

Check failure on line 29 in models/fixtures/project_issue.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

29:22 [new-line-at-end-of-file] no new line character at the end of file
14 changes: 14 additions & 0 deletions modules/structs/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ type EditIssueOption struct {
RemoveDeadline *bool `json:"unset_due_date"`
}

// MoveIssuesOption options for moving issues
type MovedIssuesOption struct {
Issues []struct {
IssueID int64 `json:"issueID"`
Sorting int64 `json:"sorting"`
} `json:"issues"`
}

// UpdateIssuesOption options for updating issues
type UpdateIssuesOption struct {
ProjectID int64 `json:"project_id"`
Issues []int64 `json:"issues"`
}

// EditDeadlineOption options for creating a deadline
type EditDeadlineOption struct {
// required:true
Expand Down
46 changes: 46 additions & 0 deletions modules/structs/project.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright 2015 The Gogs Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package structs

// Project represents a project
type Project struct {
ID int64 `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
TemplateType uint8 `json:"template_type"`
CardType uint8 `json:"card_type"`
OwnerID int64 `json:"owner_id"`
RepoID int64 `json:"repo_id"`
CreatorID int64 `json:"creator_id"`
IsClosed bool `json:"is_closed"`
Type uint8 `json:"type"`

CreatedUnix int64 `json:"created_unix"`
UpdatedUnix int64 `json:"updated_unix"`
ClosedDateUnix int64 `json:"closed_date_unix"`
}

// CreateProjectOption options for creating a project
type CreateProjectOption struct {
// required:true
Title string `json:"title" binding:"Required;MaxSize(100)"`
Content string `json:"content"`
TemplateType uint8 `json:"template_type"`
CardType uint8 `json:"card_type"`
}

// EditProjectOption options for editing a project
type EditProjectOption struct {
Title string `json:"title" binding:"MaxSize(100)"`
Content string `json:"content"`
CardType uint8 `json:"card_type"`
}

// MoveColumnsOption options for moving columns
type MovedColumnsOption struct {
Columns []struct {
ColumnID int64 `json:"columnID"`
Sorting int64 `json:"sorting"`
} `json:"columns"`
}
26 changes: 26 additions & 0 deletions modules/structs/project_column.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2015 The Gogs Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package structs

// Column represents a project column
type Column struct {
ID int64 `json:"id"`
Title string `json:"title"`
Color string `json:"color"`
}

// EditProjectColumnOption options for editing a project column
type EditProjectColumnOption struct {
Title string `json:"title" binding:"MaxSize(100)"`
Sorting int8 `json:"sorting"`
Color string `json:"color" binding:"MaxSize(7)"`
}

// CreateProjectColumnOption options for creating a project column
type CreateProjectColumnOption struct {
// required:true
Title string `json:"title" binding:"Required;MaxSize(100)"`
Sorting int8 `json:"sorting"`
Color string `json:"color" binding:"MaxSize(7)"`
}
Loading
Loading