-
Notifications
You must be signed in to change notification settings - Fork 21
[add] IT weekly pages #44
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
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9198dfa
Initial plan
Copilot a26bab4
Implement IT Weekly pages with GitHub Issues integration
Copilot b7dad36
Changes before error encountered
Copilot e2aca7a
Implement code review feedback - use RepositoryModel, add translation…
Copilot a321775
Apply suggestion from @TechQuery
TechQuery 2974d5e
Changes before error encountered
Copilot 73a9305
[optimize] upgrade to Koa 3, Sentry 10 & other latest Upstream packages
TechQuery d7b0c87
[optimize] update Wiki submodule
TechQuery 87905e0
Update components/Git/IssueCard.tsx
TechQuery 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ name: CI & CD | |
| on: | ||
| push: | ||
| branches: | ||
| - '*' | ||
| - '**' | ||
| jobs: | ||
| Build-and-Deploy: | ||
| env: | ||
|
|
||
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,21 @@ | ||
| .issueCard { | ||
| transition: | ||
| transform 0.2s ease, | ||
| box-shadow 0.2s ease; | ||
|
|
||
| &:hover { | ||
| transform: translateY(-2px); | ||
| box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important; | ||
| } | ||
| } | ||
| .issueTitle { | ||
| transition: color 0.2s ease; | ||
|
|
||
| &:hover { | ||
| color: #028dfa !important; | ||
| } | ||
| } | ||
| .authorInfo { | ||
| color: #586069; | ||
| font-size: 14px; | ||
| } |
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,54 @@ | ||
| import { Issue } from 'mobx-github'; | ||
| import { observer } from 'mobx-react'; | ||
| import { FC, useContext } from 'react'; | ||
| import { Badge, Card, CardProps } from 'react-bootstrap'; | ||
|
|
||
| import { I18nContext } from '../../models/Translation'; | ||
| import styles from './IssueCard.module.less'; | ||
| import { LabelBar } from './LabelBar'; | ||
|
|
||
| export type IssueCardProps = Omit<Issue, 'id'> & Omit<CardProps, 'body'>; | ||
|
|
||
| export const IssueCard: FC<IssueCardProps> = observer( | ||
| ({ className = '', number, title, labels, body, user, created_at, state }) => { | ||
| const { t } = useContext(I18nContext); | ||
|
|
||
| return ( | ||
| <Card className={`h-100 shadow-sm ${styles.issueCard} ${className}`}> | ||
| <Card.Header className="d-flex justify-content-between align-items-center"> | ||
| <Badge bg={state === 'open' ? 'success' : 'secondary'}> | ||
| {state === 'open' ? t('open') : t('closed')} | ||
| </Badge> | ||
| <small className="text-muted">#{number}</small> | ||
| </Card.Header> | ||
|
|
||
| <Card.Body className="d-flex flex-column gap-3"> | ||
| <Card.Title className="h5"> | ||
| <a | ||
| href={`/weekly/${number}`} | ||
| className={`text-decoration-none text-dark ${styles.issueTitle}`} | ||
| > | ||
| {title} | ||
| </a> | ||
| </Card.Title> | ||
|
|
||
| {body && ( | ||
| <Card.Text className="text-muted flex-grow-1"> | ||
| {body.slice(0, 150)} | ||
| {body.length > 150 && '...'} | ||
| </Card.Text> | ||
| )} | ||
| {labels?.[0] && <LabelBar labels={labels} />} | ||
| </Card.Body> | ||
|
|
||
| <Card.Footer | ||
| className={`d-flex justify-content-between align-items-center small text-muted ${styles.authorInfo}`} | ||
| > | ||
| <span>{user && `${t('weekly_author')}: ${user.login}`}</span> | ||
|
|
||
| <time dateTime={created_at}>{new Date(created_at).toLocaleDateString('zh-CN')}</time> | ||
| </Card.Footer> | ||
| </Card> | ||
| ); | ||
| }, | ||
| ); | ||
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 { Issue } from 'mobx-github'; | ||
| import { FC } from 'react'; | ||
|
|
||
| export type LabelBarProps = Pick<Issue, 'labels'>; | ||
|
|
||
| export const LabelBar: FC<LabelBarProps> = ({ labels }) => ( | ||
| <ul className="list-unstyled d-flex flex-wrap gap-2"> | ||
| {labels.map((label, index) => { | ||
| const { name, color } = typeof label === 'object' ? label : {}; | ||
|
|
||
| return ( | ||
| <li | ||
| key={index} | ||
| className="p-2 rounded small" | ||
| style={{ backgroundColor: color || 'lightgray' }} | ||
| > | ||
| {typeof label === 'string' ? label : name} | ||
| </li> | ||
| ); | ||
| })} | ||
| </ul> | ||
| ); |
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.
Uh oh!
There was an error while loading. Please reload this page.