Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const PopperContent = ({ dataList, name, active, setActive, origin }) => {
const { t } = useTranslation();
const activeItem = dataList
.find((item) => item.type === active)
?.childern.sort((a, b) => b.contribution - a.contribution);
?.children.sort((a, b) => b.contribution - a.contribution);
// const allType = ['Code', 'Code Admin', 'Issue', 'Issue Admin', 'Observe'];
return (
<div className="right-0 rounded bg-[#fcfcfc] text-xs drop-shadow-md">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import client from '@common/gqlClient';
import MyTable from '@common/components/Table';
import classnames from 'classnames';
import {
useContributionTypeLsit,
useContributionTypeList,
useEcologicalType,
useMileageOptions,
} from '../contribution';
Expand Down Expand Up @@ -160,7 +160,7 @@ const MetricTable: React.FC<{
sortOpts = sorter.order && {
type:
sorter.field === 'contribution'
? 'contribution_filterd'
? 'contribution_filtered'
: sorter.field,
direction: sorter.order === 'ascend' ? 'asc' : 'desc',
};
Expand Down Expand Up @@ -249,7 +249,7 @@ const MetricTable: React.FC<{
/>
);
},
filters: useContributionTypeLsit(),
filters: useContributionTypeList(),
defaultFilteredValue:
defaultFilterOpts.find((i) => i.type === 'contribution_type')?.values ||
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const useContributionTypeMap = () => {
};
};
// 领域画像 filter
export const useContributionTypeLsit = () => {
export const useContributionTypeList = () => {
const obj = useContributionTypeMap();
const result = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const getDomainData = (data, contributionTypeMap) => {
const domainType = result.find((z) => z.type === type);
if (domainType) {
domainType.contribution += contribution;
domainType.childern.push({ text, contribution });
domainType.children.push({ text, contribution });
} else {
result.push({
type,
color,
contribution,
childern: [{ text, contribution }],
children: [{ text, contribution }],
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Robustness = () => {
{t('metrics_models:activity.title')}
</MenuItem>
{/* <MenuItem id="2" disabled>
{t('metrics_models:developer_convertion.title')}
{t('metrics_models:developer_conversion.title')}
</MenuItem>
<MenuItem id="3" disabled>
{t('metrics_models:developer_retention.title')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Robustness = () => {
{t('metrics_models:activity.title')}
</MenuItem>
<MenuItem id="2" disabled>
{t('metrics_models:developer_convertion.title')}
{t('metrics_models:developer_conversion.title')}
</MenuItem>
<MenuItem id="3" disabled>
{t('metrics_models:developer_retention.title')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const ArchiveDownload = ({ category = 'insight' }) => {
<DataSourceSelector
defaultValue={apiBaseUrl}
onChange={(value) => setBaseUrl(value)}
hideenCompass={true}
hiddenCompass={true}
/>
<DateSelect onChange={setSelectedDate} />
<div className="overflow-x-auto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next';
const DataSourceSelector = ({
defaultValue = 'https://oss-compass.isrc.ac.cn',
onChange,
hideenCompass = false,
hiddenCompass = false,
}) => {
const { t } = useTranslation();
const apiBaseUrl = `${window.location.origin}`;
Expand Down Expand Up @@ -35,15 +35,15 @@ const DataSourceSelector = ({
]
: defaultOptions;

// 当 hideenCompass 为 true 时,过滤掉 OSS Compass 选项
if (hideenCompass) {
// 当 hiddenCompass 为 true 时,过滤掉 OSS Compass 选项
if (hiddenCompass) {
newOptions = newOptions.filter(
(option) => option.label !== 'OSS Compass'
);
}

setOptions(newOptions);
}, [apiBaseUrl, hideenCompass, t]);
}, [apiBaseUrl, hiddenCompass, t]);

return (
<div>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/modules/home/Explain/plantConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ export const useModelList = (): ModelList[] => {
color: '#cea936',
},
{
name: t('metrics_models:developer_convertion.title'),
name: t('metrics_models:developer_conversion.title'),
top: -288,
left: 268,
width: 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ interface RepoData {
interface RepoTableProps {
projectType?: string;
selectedRegions?: string[];
shwoTitle?: boolean;
showTitle?: boolean;
}

const RepoTable: React.FC<RepoTableProps> = ({
projectType = '',
selectedRegions = [],
shwoTitle = false,
showTitle = false,
}) => {
const [data, setData] = useState<RepoData[]>([]);
const [loading, setLoading] = useState(true);
Expand Down Expand Up @@ -222,7 +222,7 @@ const RepoTable: React.FC<RepoTableProps> = ({
];

return (
<Card title={shwoTitle ? '仓库信息' : ''} className="mb-6">
<Card title={showTitle ? '仓库信息' : ''} className="mb-6">
<div className="mb-6">
<Space>
<Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ const GovernanceTabPanel: React.FC<{
<div className="mb-6 mt-4 flex items-center gap-2 text-xl font-semibold text-gray-900">
<span>{techStackName} - 仓库贡献排名</span>
</div>
<RepoTable projectType={projectType} shwoTitle={false} />
<RepoTable projectType={projectType} showTitle={false} />

<Modal
title={tableModal?.title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const PopperContent = ({ dataList, name, active, setActive, origin }) => {
const { t } = useTranslation();
const activeItem = dataList
.find((item) => item.type === active)
?.childern.sort((a, b) => b.contribution - a.contribution);
?.children.sort((a, b) => b.contribution - a.contribution);
// const allType = ['Code', 'Code Admin', 'Issue', 'Issue Admin', 'Observe'];
return (
<div className="right-0 rounded bg-[#fcfcfc] text-xs drop-shadow-md">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import client from '@common/gqlClient';
import MyTable from '@common/components/Table';
import classnames from 'classnames';
import {
useContributionTypeLsit,
useContributionTypeList,
useEcologicalType,
useMileageOptions,
} from '../contribution';
Expand Down Expand Up @@ -152,7 +152,7 @@ const MetricTable: React.FC<{
sortOpts = sorter.order && {
type:
sorter.field === 'contribution'
? 'contribution_filterd'
? 'contribution_filtered'
: sorter.field,
direction: sorter.order === 'ascend' ? 'asc' : 'desc',
};
Expand Down Expand Up @@ -237,7 +237,7 @@ const MetricTable: React.FC<{
/>
);
},
filters: useContributionTypeLsit(),
filters: useContributionTypeList(),
defaultFilteredValue:
defaultFilterOpts.find((i) => i.type === 'contribution_type')?.values ||
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const useContributionTypeMap = () => {
};
};
// 领域画像 filter
export const useContributionTypeLsit = () => {
export const useContributionTypeList = () => {
const obj = useContributionTypeMap();
const result = [];

Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/modules/lab/model/Analyze/component/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const getDomainData = (data, contributionTypeMap) => {
const domainType = result.find((z) => z.type === type);
if (domainType) {
domainType.contribution += contribution;
domainType.childern.push({ text, contribution });
domainType.children.push({ text, contribution });
} else {
result.push({
type,
color,
contribution,
childern: [{ text, contribution }],
children: [{ text, contribution }],
});
}
});
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/modules/lab/model/User/FormInviteUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import Pagination from '@common/components/Antd/Pagination';
import useEventEmitter from 'ahooks/lib/useEventEmitter';
import { ReFetch } from '@common/constant';
import { useTranslation } from 'react-i18next';
import { myPermisssion } from './type';
import { myPermissions } from './type';

const per = 6;
const FormInviteUsers = forwardRef(
(props: { modelId: number; permission: myPermisssion }, ref) => {
(props: { modelId: number; permission: myPermissions }, ref) => {
const { modelId, permission } = props;
const { t } = useTranslation();

Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/modules/lab/model/User/FormUsers.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import FormUsersItem from './FormUsersItem';
import { UserItem, myPermisssion } from './type';
import { UserItem, myPermissions } from './type';
import { EventEmitter } from 'ahooks/lib/useEventEmitter';
import { useTranslation } from 'react-i18next';

const FormUsers = (props: {
items: UserItem[];
count: number;
modelId: number;
permission: myPermisssion;
permission: myPermissions;
event$: EventEmitter<string>;
}) => {
const { t } = useTranslation();
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/modules/lab/model/User/FormUsersItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Button } from '@oss-compass/ui';
import SelectDrowBox from './SelectDrowBox';
import { toast } from 'react-hot-toast';
import { useTranslation } from 'react-i18next';
import { myPermisssion } from './type';
import { myPermissions } from './type';
import { useRouter } from 'next/router';
import { useUserInfo } from '@modules/auth';

Expand Down Expand Up @@ -140,7 +140,7 @@ const QuitModel = ({ modelId, memberId }) => {
const FormUsersItem = (props: {
user: UserItem;
modelId: number;
permission: myPermisssion;
permission: myPermissions;
event$: EventEmitter<string>;
}) => {
const { providerUser: loginUser } = useUserInfo();
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/modules/lab/model/User/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ const UserManage = () => {
const items = data?.memberOverview?.items || [];
const name = data?.memberOverview.model.name;

const myPermisssion = useMyMemberPermissionQuery(gqlClient, {
const myPermissions = useMyMemberPermissionQuery(gqlClient, {
modelId,
});
const permission = myPermisssion.data?.myMemberPermission;
const permission = myPermissions.data?.myMemberPermission;

const inviteUsers = useRef(null);
const event$ = useEventEmitter<string>();
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/modules/lab/model/User/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface UserItem {
isOwner?: boolean;
id: number;
}
export interface myPermisssion {
export interface myPermissions {
canDestroy: Boolean;
canExecute: Boolean;
canRead: Boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import MyTable from '@common/components/Table';
import { Tabs } from 'antd';
import type { TabsProps } from 'antd';
import {
useContributionTypeLsit,
useContributionTypeList,
useEcologicalType,
useMileageOptions,
} from '@modules/analyze/DataView/MetricDetail/MetricContributor/contribution';
Expand Down Expand Up @@ -379,7 +379,7 @@ const MerticTable = () => {
/>
);
},
filters: useContributionTypeLsit(),
filters: useContributionTypeList(),
filterMode: 'tree',
align: 'left',
width: '300px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import MyTable from '@common/components/Table';
import { Tabs } from 'antd';
import type { TabsProps } from 'antd';
import {
useContributionTypeLsit,
useContributionTypeList,
useEcologicalType,
useMileageOptions,
} from '@modules/analyze/DataView/MetricDetail/MetricContributor/contribution';
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/modules/oh/hooks/useCheckGraduateRiskState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const useCheckGraduateRiskState = (shortCode, mertic) => {
const riskFill = useMemo(() => {
if (metricState && metricState.length > 0) {
const leaderState = metricState.filter((item) => item.memberType === 1);
const commiterState = metricState.filter((item) => item.memberType === 0);
const committerState = metricState.filter((item) => item.memberType === 0);
const legalState = metricState.filter((item) => item.memberType === 2);
const complianceState = metricState.filter(
(item) => item.memberType === 3
Expand All @@ -17,7 +17,7 @@ const useCheckGraduateRiskState = (shortCode, mertic) => {
} else {
return (
leaderState.length > 0 &&
commiterState.length > 0 &&
committerState.length > 0 &&
complianceState.length > 0
);
}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/modules/oh/hooks/useCheckRiskState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const useCheckRiskState = (shortCode, mertic) => {
const riskFill = useMemo(() => {
if (metricState && metricState.length > 0) {
const leaderState = metricState.filter((item) => item.memberType === 1);
const commiterState = metricState.filter((item) => item.memberType === 0);
const committerState = metricState.filter((item) => item.memberType === 0);
const legalState = metricState.filter((item) => item.memberType === 2);
const complianceState = metricState.filter(
(item) => item.memberType === 3
Expand All @@ -17,7 +17,7 @@ const useCheckRiskState = (shortCode, mertic) => {
} else {
return (
leaderState.length > 0 &&
commiterState.length > 0 &&
committerState.length > 0 &&
complianceState.length > 0
);
}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/modules/oh/hooks/useCheckSandboxRiskState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const useCheckSandboxRiskState = (shortCode, mertic) => {
const riskFill = useMemo(() => {
if (metricState && metricState.length > 0) {
const leaderState = metricState.filter((item) => item.memberType === 1);
const commiterState = metricState.filter((item) => item.memberType === 0);
const committerState = metricState.filter((item) => item.memberType === 0);
const legalState = metricState.filter((item) => item.memberType === 2);
const complianceState = metricState.filter(
(item) => item.memberType === 3
Expand All @@ -17,7 +17,7 @@ const useCheckSandboxRiskState = (shortCode, mertic) => {
} else {
return (
leaderState.length > 0 &&
commiterState.length > 0 &&
committerState.length > 0 &&
complianceState.length > 0
);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/modules/os-situation/DataView/ChartsLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ChartCards = ({ ChartInfo }) => {
processedData = {
...data,
legend: {
shwo: true,
show: true,
},
series: data.series
.filter((item) => {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/pages/lab/model/[model]/detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {
};
};

const Deatil = () => {
const Detail = () => {
const { t } = useTranslation();
return (
<NoSsr>
Expand All @@ -36,4 +36,4 @@ const Deatil = () => {
);
};

export default Deatil;
export default Detail;
Loading