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: Fix devops bugs #4299

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions locales/en/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,4 +541,5 @@ module.exports = {
'Observer of the DevOps project, capable of viewing the running status of pipelines',
DEVOPS_PROJECT_DESC:
"DevOps projects are used to group resources for management and to control different users' resource management permissions.",
PLEASE_SELECT_CLUSTER: 'Please select a cluster',
};
1 change: 1 addition & 0 deletions locales/es/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,4 +541,5 @@ module.exports = {
'Observer of the DevOps project, capable of viewing the running status of pipelines',
DEVOPS_PROJECT_DESC:
"DevOps projects are used to group resources for management and to control different users' resource management permissions.",
PLEASE_SELECT_CLUSTER: 'Please select a cluster',
};
1 change: 1 addition & 0 deletions locales/tc/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,4 +541,5 @@ module.exports = {
'Observer of the DevOps project, capable of viewing the running status of pipelines',
DEVOPS_PROJECT_DESC:
"DevOps projects are used to group resources for management and to control different users' resource management permissions.",
PLEASE_SELECT_CLUSTER: '請選擇集群',
};
2 changes: 1 addition & 1 deletion locales/zh/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ module.exports = {
pipeline_developer: 'DevOps 业务的开发者,可以进行流水线的触发以及查看',
pipeline_reporter: 'DevOps 业务的观察者,可以查看流水线的运行情况',
DEVOPS_PROJECT_DESC: 'DevOps 业务用于对资源进行分组管理以及控制不同用户的资源管理权限。',

PLEASE_SELECT_CLUSTER: '请选择集群',
// 应用介绍
NO_DOCUMENT_DESC: '未发现应用介绍。',
DOCUMENTATION: '应用介绍',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ const useWorkspaceClusterSelect = (initParams: ProjectSelectInitValue = {}) => {

// select first
React.useEffect(() => {
if (!cluster && clusterList?.filter(i => !i.disabled)?.length) {
setCluster(first(clusterList)?.name);
const clusters = clusterList?.filter(i => !i.disabled) ?? [];
if (!cluster && clusters.length) {
setCluster(first(clusters)?.name);
}
}, [clusterList]);

Expand Down
23 changes: 11 additions & 12 deletions packages/console/src/pages/workspaces/containers/Devops/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,21 @@ import {
FormattedDevops,
getDisplayName,
getLocalTime,
PodsStore,
StatusIndicator,
tableState2Query,
useBatchActions,
useCacheStore,
useCommonActions,
useItemActions,
useTableActions,
useUrlSearchParamsStatus,
useV3action,
} from '@ks-console/shared';
import { Banner, BannerTip, Card, DataTable } from '@kubed/components';
import { Pen, StrategyGroup, Trash } from '@kubed/icons';
import { ColumnDef, Table } from '@tanstack/react-table';
import * as React from 'react';
import { useParams } from 'react-router-dom';
import useWorkspaceClusterSelect from './ClusterSelect';
import { Pen, StrategyGroup, Trash } from '@kubed/icons';
import { Banner, BannerTip, Card, DataTable, notify } from '@kubed/components';

const module = devopsStore.module;

Expand All @@ -45,7 +43,7 @@ const Devops = () => {
const { cluster } = params;
const { state, setState } = useUrlSearchParamsStatus([]);

const { open: openV3Modal } = useV3action();
const { open: openV3Modal, render } = useV3action();

const commonParams = {
cluster: cluster,
Expand Down Expand Up @@ -90,7 +88,7 @@ const Devops = () => {
v3Module: 'devopsStore',
...commonParams,
detail: record,
v3StoreParams: '',
v3StoreParams: {},
action: 'devops.edit',
success: () => {
refetch();
Expand Down Expand Up @@ -299,7 +297,7 @@ const Devops = () => {
if (!cluster) {
return {
image: <StrategyGroup size={40} />,
description: t('PLEASE_SELECT_CLUSTER_OR_PROJECT'),
description: t('PLEASE_SELECT_CLUSTER'),
};
}
return {
Expand All @@ -316,18 +314,18 @@ const Devops = () => {

const banner = {
icon: <StrategyGroup />,
title: t('DEVOPS.DEVOPS_PROJECT_PL'),
description: t('DEVOPS.DEVOPS_DESCRIPTION'),
title: t('DEVOPS_PROJECT_PL'),
description: t('DEVOPS_DESCRIPTION'),
};

const tips = [
{
title: t('DEVOPS.DEVOPS_TIP_GITOPS_Q'),
title: t('DEVOPS_TIP_GITOPS_Q'),
description: t('DEVOPS_TIP_GITOPS_A'),
},
{
title: t('DEVOPS.DEVOPS_TIP_TYPE_Q'),
description: t('DEVOPS.DEVOPS_TIP_TYPE_A'),
title: t('DEVOPS_TIP_TYPE_Q'),
description: t('DEVOPS_TIP_TYPE_A'),
},
];

Expand All @@ -343,6 +341,7 @@ const Devops = () => {
<Card padding={0}>
<DataTable.DataTable table={table} />
</Card>
{render()}
</>
);
};
Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/components/GlobalStyles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ const GlobalStyles = createGlobalStyle`
visibility: visible;
}
}
.kube-table {
td.table-cell {
word-break: break-word;

.field-label {
max-width: 350px;
}
}
}
`;

export default GlobalStyles;
Loading