Skip to content

Commit 7281204

Browse files
committed
move commitStatus to own file
1 parent 20343d5 commit 7281204

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

templates/repo/commit_status.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- make sure this matches the color logic in web_src/js/types.ts -->
1+
<!-- make sure this matches the color logic in web_src/js/data.ts -->
22
{{if eq .State "pending"}}
33
{{svg "octicon-dot-fill" 18 "commit-status icon text yellow"}}
44
{{end}}

web_src/js/components/DashboardRepoList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {createApp, nextTick} from 'vue';
33
import {SvgIcon} from '../svg.ts';
44
import {GET} from '../modules/fetch.ts';
55
import {fomanticQuery} from '../modules/fomantic/base.ts';
6-
import {commitStatus} from '../types.ts';
6+
import {commitStatus} from '../data.ts';
77
import type {CommitStatus} from '../types.ts';
88
99
const {appSubUrl, assetUrlPrefix, pageData} = window.config;

web_src/js/data.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type {CommitStatusMap} from './types.ts';
2+
3+
// make sure this matches templates/repo/commit_status.tmpl
4+
export const commitStatus: CommitStatusMap = {
5+
pending: {name: 'octicon-dot-fill', color: 'yellow'},
6+
success: {name: 'octicon-check', color: 'green'},
7+
error: {name: 'gitea-exclamation', color: 'red'},
8+
failure: {name: 'octicon-x', color: 'red'},
9+
warning: {name: 'gitea-exclamation', color: 'yellow'},
10+
};

web_src/js/types.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,6 @@ export type CommitStatusMap = {
6969
};
7070
};
7171

72-
// make sure this matches templates/repo/commit_status.tmpl
73-
export const commitStatus: CommitStatusMap = {
74-
pending: {name: 'octicon-dot-fill', color: 'yellow'},
75-
success: {name: 'octicon-check', color: 'green'},
76-
error: {name: 'gitea-exclamation', color: 'red'},
77-
failure: {name: 'octicon-x', color: 'red'},
78-
warning: {name: 'gitea-exclamation', color: 'yellow'},
79-
};
80-
8172
export type ActionsStatus = 'unknown' | 'waiting' | 'running' | 'success' | 'failure' | 'cancelled' | 'skipped' | 'blocked';
8273

8374
export type ActionsStepLogLine = {

0 commit comments

Comments
 (0)