This commit is contained in:
bakhirev 2025-02-12 16:50:32 +03:00
parent 04cf07c913
commit 9787d34c90
5 changed files with 38 additions and 34 deletions

File diff suppressed because one or more lines are too long

View file

@ -48,7 +48,7 @@ export function getOption(value: any, index: number): IOption {
return { return {
id: getId(value, index), id: getId(value, index),
title, title,
_textForSearch: title?.toLowerCase() || '', _textForSearch: title?.toLowerCase ? title?.toLowerCase() : '',
source: value, source: value,
}; };
} }

View file

@ -4,7 +4,7 @@
*/ */
export function getGithubPrInfo(text: string) { export function getGithubPrInfo(text: string) {
const json = (text || '') const json = (text || '')
.replace(/["']+/gim, '') .replace(/["'\r\n]+/gim, '')
.replace('#', '#": "') .replace('#', '#": "')
.replace(' in ', '", "in": "') .replace(' in ', '", "in": "')
.replace(' from ', '", "from": "') .replace(' from ', '", "from": "')

View file

@ -34,7 +34,7 @@ const Department = observer(({
.filter((item: any) => item.totalDaysWorked > 10); .filter((item: any) => item.totalDaysWorked > 10);
const options = Object.keys(byMonths).map((id: string) => ({ id })); const options = Object.keys(byMonths).map((id: string) => ({ id }));
const [taskCode, setTaskCode] = useState(options[0].id); const [taskCode, setTaskCode] = useState(options?.[0]?.id);
if (!content?.length) { if (!content?.length) {
return <NothingFound />; return <NothingFound />;
@ -56,6 +56,8 @@ const Department = observer(({
<Pagination /> <Pagination />
</DataLoader> </DataLoader>
{taskCode ? (
<>
<Title title="page.team.department.months.title"/> <Title title="page.team.department.months.title"/>
<PageWrapper> <PageWrapper>
<div className={style.table_filters}> <div className={style.table_filters}>
@ -83,6 +85,8 @@ const Department = observer(({
</DataLoader> </DataLoader>
<Description text={t('page.team.department.months.description')} /> <Description text={t('page.team.department.months.description')} />
</> </>
) : null}
</>
); );
}); });

View file

@ -35,14 +35,14 @@ function Block({
title, title,
recommendations, recommendations,
}: BlockProps): React.ReactElement | null { }: BlockProps): React.ReactElement | null {
const cards = recommendations.map((recommendation: any) => ( const cards = recommendations?.map((recommendation: any) => (
<CardForPrint <CardForPrint
key={recommendation.description} key={recommendation.description}
recommendation={recommendation} recommendation={recommendation}
/> />
)); ));
if (!cards.length) return null; if (!cards?.length) return null;
return ( return (
<> <>