Skip to content

Commit

Permalink
Refactor: Revert the SubTag.tsx changes to previous one
Browse files Browse the repository at this point in the history
  • Loading branch information
PratapRathi committed Dec 23, 2024
1 parent b2caab3 commit cf44483
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/screens/SubTags/SubTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,15 @@ function SubTags(): JSX.Element {
},
});

/* istanbul ignore next -- @preserve */
if (data) {
toast.success(t('tagCreationSuccess') as string);
subTagsRefetch();
setTagName('');
setAddSubTagModalIsOpen(false);
}
} catch (error: unknown) {
/* istanbul ignore next -- @preserve */
if (error instanceof Error) {
toast.error(error.message);
}
Expand All @@ -154,7 +156,8 @@ function SubTags(): JSX.Element {
}

const subTagsList =
subTagsData?.getChildTags.childTags.edges.map((edge) => edge.node) ?? [];
subTagsData?.getChildTags.childTags.edges.map((edge) => edge.node) ??
/* istanbul ignore next -- @preserve */ [];

const parentTagName = subTagsData?.getChildTags.name;

Expand Down Expand Up @@ -392,6 +395,7 @@ function SubTags(): JSX.Element {
next={loadMoreSubTags}
hasMore={
subTagsData?.getChildTags.childTags.pageInfo.hasNextPage ??
/* istanbul ignore next -- @preserve */
false
}
loader={<InfiniteScrollLoader />}
Expand All @@ -403,15 +407,16 @@ function SubTags(): JSX.Element {
hideFooter={true}
getRowId={(row) => row.id}
slots={{
noRowsOverlay: /* istanbul ignore next */ () => (
<Stack
height="100%"
alignItems="center"
justifyContent="center"
>
{t('noTagsFound')}
</Stack>
),
noRowsOverlay:
/* istanbul ignore next -- @preserve */ () => (
<Stack
height="100%"
alignItems="center"
justifyContent="center"
>
{t('noTagsFound')}
</Stack>
),
}}
sx={dataGridStyle}
getRowClassName={() => `${styles.rowBackground}`}
Expand Down

0 comments on commit cf44483

Please sign in to comment.