Skip to content
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

Fix typescript errors in Vue files, fix regression in "Recent Commits" chart #32649

Merged
merged 17 commits into from
Dec 8, 2024
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
move commitStatus to own file
silverwind committed Nov 26, 2024

Verified

This commit was signed with the committer’s verified signature.
commit 7281204ec065c8430ca6e1a84688b3c27d6c13b4
2 changes: 1 addition & 1 deletion templates/repo/commit_status.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- make sure this matches the color logic in web_src/js/types.ts -->
<!-- make sure this matches the color logic in web_src/js/data.ts -->
{{if eq .State "pending"}}
{{svg "octicon-dot-fill" 18 "commit-status icon text yellow"}}
{{end}}
2 changes: 1 addition & 1 deletion web_src/js/components/DashboardRepoList.vue
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import {createApp, nextTick} from 'vue';
import {SvgIcon} from '../svg.ts';
import {GET} from '../modules/fetch.ts';
import {fomanticQuery} from '../modules/fomantic/base.ts';
import {commitStatus} from '../types.ts';
import {commitStatus} from '../data.ts';
import type {CommitStatus} from '../types.ts';

const {appSubUrl, assetUrlPrefix, pageData} = window.config;
10 changes: 10 additions & 0 deletions web_src/js/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type {CommitStatusMap} from './types.ts';

// make sure this matches templates/repo/commit_status.tmpl
export const commitStatus: CommitStatusMap = {
pending: {name: 'octicon-dot-fill', color: 'yellow'},
success: {name: 'octicon-check', color: 'green'},
error: {name: 'gitea-exclamation', color: 'red'},
failure: {name: 'octicon-x', color: 'red'},
warning: {name: 'gitea-exclamation', color: 'yellow'},
};
9 changes: 0 additions & 9 deletions web_src/js/types.ts
Original file line number Diff line number Diff line change
@@ -69,15 +69,6 @@ export type CommitStatusMap = {
};
};

// make sure this matches templates/repo/commit_status.tmpl
export const commitStatus: CommitStatusMap = {
pending: {name: 'octicon-dot-fill', color: 'yellow'},
success: {name: 'octicon-check', color: 'green'},
error: {name: 'gitea-exclamation', color: 'red'},
failure: {name: 'octicon-x', color: 'red'},
warning: {name: 'gitea-exclamation', color: 'yellow'},
};

export type ActionsStatus = 'unknown' | 'waiting' | 'running' | 'success' | 'failure' | 'cancelled' | 'skipped' | 'blocked';

export type ActionsStepLogLine = {