Skip to content

Commit

Permalink
fix table enum bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzm0809 committed Nov 6, 2023
1 parent ec2bd42 commit 08d6df0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ import ClassList from '@/pages/RegCenter/GitProject/components/BuildSteps/JarSho
import { CodeTree } from '@/pages/RegCenter/GitProject/components/CodeTree';
import ProjectModal from '@/pages/RegCenter/GitProject/components/ProjectModal';
import {
GIT_PROJECT_BUILD_STEP,
GIT_PROJECT_BUILD_STEP_ENUM,
GIT_PROJECT_BUILD_STEP_JAVA_ENUM, GIT_PROJECT_BUILD_STEP_PYTHON_ENUM,
GIT_PROJECT_CODE_TYPE,
GIT_PROJECT_CODE_TYPE_ENUM,
GIT_PROJECT_STATUS,
Expand Down Expand Up @@ -227,8 +226,8 @@ const ProjectProTable: React.FC = () => {
title: l('rc.gp.buildStep'),
dataIndex: 'buildStep',
hideInSearch: true,
filters: GIT_PROJECT_BUILD_STEP,
valueEnum: GIT_PROJECT_BUILD_STEP_ENUM
// filters: GIT_PROJECT_BUILD_STEP,
valueEnum: (row) => row.codeType === 1 ? GIT_PROJECT_BUILD_STEP_JAVA_ENUM : GIT_PROJECT_BUILD_STEP_PYTHON_ENUM,
},
{
title: l('rc.gp.buildState'),
Expand Down
41 changes: 34 additions & 7 deletions dinky-web/src/pages/RegCenter/GitProject/constans.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const CLONE_TYPES = [
* @param item
*/
export const renderBranchesTagColor = (item: string) => {
let colorTag = item.includes('dev')
return item.includes('dev')
? 'processing'
: item.includes('test')
? 'warning'
Expand All @@ -142,13 +142,9 @@ export const renderBranchesTagColor = (item: string) => {
: item.includes('main')
? 'success'
: 'default';
return colorTag;
};

/**
* git project build step enum
*/
export const GIT_PROJECT_BUILD_STEP_ENUM = {
const GIT_PROJECT_BUILD_STEP_BASE = {
0: {
title: l('rc.gp.build.step.0'),
text: l('rc.gp.build.step.0'),
Expand All @@ -159,6 +155,12 @@ export const GIT_PROJECT_BUILD_STEP_ENUM = {
text: l('rc.gp.build.step.1'),
status: 'default'
},
}
/**
* git project build step enum
*/
export const GIT_PROJECT_BUILD_STEP_JAVA_ENUM = {
...GIT_PROJECT_BUILD_STEP_BASE,
2: {
title: l('rc.gp.build.step.2'),
text: l('rc.gp.build.step.2'),
Expand All @@ -185,6 +187,32 @@ export const GIT_PROJECT_BUILD_STEP_ENUM = {
status: 'success'
}
};

export const GIT_PROJECT_BUILD_STEP_PYTHON_ENUM = {
...GIT_PROJECT_BUILD_STEP_BASE,
2: {
title: l('rc.gp.build.step.2'),
text: l('rc.gp.build.step.2'),
status: 'processing'
},
3: {
title: l('rc.gp.build.step.4'),
text: l('rc.gp.build.step.4'),
status: 'success'
},
4: {
title: l('rc.gp.build.step.5'),
text: l('rc.gp.build.step.5'),
status: 'success'
},
5: {
title: l('rc.gp.build.step.6'),
text: l('rc.gp.build.step.6'),
status: 'success'
}
};


/**
* git project build step filter
*/
Expand Down Expand Up @@ -228,7 +256,6 @@ export const GIT_PROJECT_BUILD_STEP = [

/**
* git project build step enum
* @type {{"100%": string, "0%": string, "20%": string, "40%": string, "60%": string, "80%": string}}
*/
export const processColor = {
'0%': '#8ac1ea',
Expand Down

0 comments on commit 08d6df0

Please sign in to comment.