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 {
id: getId(value, index),
title,
_textForSearch: title?.toLowerCase() || '',
_textForSearch: title?.toLowerCase ? title?.toLowerCase() : '',
source: value,
};
}

View file

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

View file

@ -34,7 +34,7 @@ const Department = observer(({
.filter((item: any) => item.totalDaysWorked > 10);
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) {
return <NothingFound />;
@ -56,32 +56,36 @@ const Department = observer(({
<Pagination />
</DataLoader>
<Title title="page.team.department.months.title"/>
<PageWrapper>
<div className={style.table_filters}>
<SelectWithButtons
title="page.team.tree.filters.author"
value={taskCode}
className={style.table_filters_item}
options={options}
onChange={(value: string) => {
console.log(value);
setTaskCode(value);
}}
/>
</div>
</PageWrapper>
<DataLoader
to="response"
loader={(pagination?: IPaginationRequest, sort?: ISort[]) => getFakeLoader({
content: byMonths[taskCode], pagination, sort, mode,
})}
watch={taskCode}
>
<Months/>
<Pagination />
</DataLoader>
<Description text={t('page.team.department.months.description')} />
{taskCode ? (
<>
<Title title="page.team.department.months.title"/>
<PageWrapper>
<div className={style.table_filters}>
<SelectWithButtons
title="page.team.tree.filters.author"
value={taskCode}
className={style.table_filters_item}
options={options}
onChange={(value: string) => {
console.log(value);
setTaskCode(value);
}}
/>
</div>
</PageWrapper>
<DataLoader
to="response"
loader={(pagination?: IPaginationRequest, sort?: ISort[]) => getFakeLoader({
content: byMonths[taskCode], pagination, sort, mode,
})}
watch={taskCode}
>
<Months/>
<Pagination />
</DataLoader>
<Description text={t('page.team.department.months.description')} />
</>
) : null}
</>
);
});

View file

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