-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Add project column picker to issue and pull request sidebar #37037
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
Open
myers
wants to merge
21
commits into
go-gitea:main
Choose a base branch
from
myers:feat/issue-column-picker
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
537174c
Add project column picker to issue and pull request sidebar
myers 0b1b962
Refactor column picker to use generic combo list rerender
myers eb6d19a
Add error toast to sidebar combo list backend updates
myers 9035a92
Add E2E test for project column picker
myers 8f55cca
Use selection dropdown style for column picker
myers 26c8ed0
Add Go integration tests and improve E2E assertions for column picker
myers 4f73bab
fix
wxiaoguang a6811b0
fix get default column
wxiaoguang 02a328a
prepare support multiple projects
wxiaoguang 198d13d
revert frontend change
wxiaoguang 165b6e4
clean up backend
wxiaoguang 36810b8
Merge branch 'main' into feat/issue-column-picker
wxiaoguang 7762325
reload page partially
wxiaoguang 87cfc38
Merge branch 'main' into feat/issue-column-picker
wxiaoguang c576897
clean up
wxiaoguang ea3db23
fine tune
wxiaoguang eb9f4f1
fix combolist
wxiaoguang 11b96d7
revert unnecessary changes
wxiaoguang 0378a6a
fix ui
wxiaoguang 321643c
Merge branch 'main' into feat/issue-column-picker
wxiaoguang 680437f
fix merge
wxiaoguang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| {{$pageMeta := .}} | ||
| {{$data := .ProjectsData}} | ||
| {{if and $pageMeta.Issue $pageMeta.Issue.Project $data.ProjectColumns (gt (len $data.ProjectColumns) 1)}} | ||
| {{if $pageMeta.CanModifyIssueOrPull}} | ||
| <div class="issue-sidebar-combo" id="sidebar-project-column" | ||
| data-selection-mode="single" data-update-algo="all" | ||
| data-update-url="{{$pageMeta.RepoLink}}/issues/projects/column?issue_id={{$pageMeta.Issue.ID}}"> | ||
| <input class="combo-value" name="column_id" type="hidden" value="{{$data.SelectedColumnID}}"> | ||
| <div class="ui dropdown selection fluid"> | ||
| <div class="default text">{{range $data.ProjectColumns}}{{if eq .ID $data.SelectedColumnID}}{{.Title}}{{end}}{{end}}</div> | ||
| {{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
| <div class="menu"> | ||
| {{range $data.ProjectColumns}} | ||
| <div class="item {{if eq .ID $data.SelectedColumnID}}active selected checked{{end}}" data-value="{{.ID}}">{{.Title}}</div> | ||
| {{end}} | ||
| </div> | ||
| </div> | ||
| <div class="ui list tw-hidden"> | ||
| <span class="item empty-list">No column</span> | ||
| </div> | ||
| </div> | ||
| {{else}} | ||
| {{range $data.ProjectColumns}} | ||
| {{if eq .ID $data.SelectedColumnID}} | ||
| <div class="tw-mt-1"> | ||
| <span class="muted">{{svg "octicon-columns" 16 "tw-mr-1"}}{{.Title}}</span> | ||
| </div> | ||
| {{end}} | ||
| {{end}} | ||
| {{end}} | ||
| {{end}} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,3 +49,4 @@ | |
| {{end}} | ||
| </div> | ||
| </div> | ||
| {{template "repo/issue/sidebar/project_column" $pageMeta}} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import {env} from 'node:process'; | ||
| import {test, expect} from '@playwright/test'; | ||
| import {login, apiCreateRepo, apiCreateIssue, apiDeleteRepo} from './utils.ts'; | ||
|
|
||
| test('project column picker', async ({page}) => { | ||
| const repoName = `e2e-colpicker-${Date.now()}`; | ||
| const owner = env.GITEA_TEST_E2E_USER; | ||
| await login(page); | ||
| await apiCreateRepo(page.request, {name: repoName}); | ||
| await apiCreateIssue(page.request, owner, repoName, {title: 'Test Issue'}); | ||
|
|
||
| // Create a project with board type | ||
| await page.goto(`/${owner}/${repoName}/projects/new`); | ||
| await page.getByPlaceholder('Title').fill('Test Board'); | ||
| await page.locator('#project_template').selectOption('Basic Kanban'); | ||
| await page.getByRole('button', {name: 'Create Project'}).click(); | ||
| await expect(page.locator('.project-column')).toHaveCount(3); // Basic Kanban: To Do, In Progress, Done | ||
|
|
||
| // Assign the issue to the project via the issue sidebar | ||
| await page.goto(`/${owner}/${repoName}/issues/1`); | ||
| await page.locator('.issue-sidebar-combo[data-update-url*="/issues/projects?"] .ui.dropdown').click(); | ||
| await page.locator('.issue-sidebar-combo[data-update-url*="/issues/projects?"] .menu .item').filter({hasText: 'Test Board'}).click(); | ||
|
|
||
| // Wait for the column picker to appear | ||
| await expect(page.locator('#sidebar-project-column .ui.dropdown')).toBeVisible(); | ||
|
|
||
| // Verify the column dropdown has items | ||
| await page.locator('#sidebar-project-column .ui.dropdown').click(); | ||
| const columnItems = page.locator('#sidebar-project-column .menu .item'); | ||
| await expect(columnItems).toHaveCount(3); | ||
|
|
||
| // Select a different column | ||
| await columnItems.filter({hasText: 'In Progress'}).click(); | ||
|
|
||
| // Verify the dropdown closed and shows the new selection | ||
| await expect(page.locator('#sidebar-project-column .menu')).toBeHidden(); | ||
| await expect(page.locator('#sidebar-project-column .default.text')).toHaveText('In Progress'); | ||
|
|
||
| // Verify a timeline event appeared for the column move | ||
| await expect(page.locator('.timeline-item').last()).toContainText('moved this to In Progress'); | ||
|
|
||
| // Reload and verify the column persisted | ||
| await page.reload(); | ||
| await expect(page.locator('#sidebar-project-column .default.text')).toHaveText('In Progress'); | ||
|
|
||
| await apiDeleteRepo(page.request, owner, repoName); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment and code was added to wrong place.