-
Notifications
You must be signed in to change notification settings - Fork 122
feat(UI): rebuild new issue page & fix some problems #1172
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
Merged
benjamin-747
merged 1 commit into
gitmono-dev:main
from
liuyangjuncong20202570:feat/newIssue
Jun 30, 2025
Merged
Changes from all commits
Commits
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,20 @@ | ||
| import React from 'react' | ||
|
|
||
| export function extractTextArray(node: React.ReactNode): string[] { | ||
| if (typeof node === 'string' || typeof node === 'number') { | ||
| return [node.toString()] | ||
| } | ||
|
|
||
| if (Array.isArray(node)) { | ||
| // 递归展开所有节点,返回扁平化的字符串数组 | ||
| return node.flatMap(extractTextArray) | ||
| } | ||
|
|
||
| if (React.isValidElement(node)) { | ||
| // 递归提取 React 元素的 children | ||
| return extractTextArray(node.props.children) | ||
| } | ||
|
|
||
| // 其他情况(null, undefined, boolean, function) | ||
| return [] | ||
| } |
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,22 @@ | ||
| import { ItemInput } from '@primer/react/lib/deprecated/ActionList' | ||
|
|
||
| export function mergeAndDeduplicate( | ||
| prev: ItemInput[], | ||
| selected: ItemInput[], | ||
| prevId: string, | ||
| selectId: string | ||
| ): ItemInput[] { | ||
| const updatedPrev = prev.map((item) => ({ | ||
| ...item, | ||
| groupId: prevId | ||
| })) | ||
|
|
||
| const updatedSelected = selected.map((item) => ({ | ||
| ...item, | ||
| groupId: selectId | ||
| })) | ||
|
|
||
| const mergedArray = [...updatedPrev, ...updatedSelected] | ||
|
|
||
| return Array.from(new Map(mergedArray.map((item) => [item.text, item])).values()) | ||
| } |
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,8 @@ | ||
| export const pickWithReflect = <T extends Object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> => { | ||
| const result = {} as Pick<T, K> | ||
|
|
||
| keys.forEach((i) => { | ||
| result[i] = Reflect.get(obj, i) | ||
| }) | ||
| return result | ||
| } |
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
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 filtering logic for the 'Author' selection uses sort['Author'] as the filter criterion, which may be incorrect. Consider filtering based on the currently selected member's id (i.e. item.user.id) to ensure accurate results.