Skip to content

Commit 5c073aa

Browse files
committed
fix: Issue with icons in sync modal
1 parent 65789d4 commit 5c073aa

5 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/container-comparison/CompareContainersWidget.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ describe('CompareContainersWidget', () => {
125125
const blocks = await screen.findAllByText('This subsection will be added in the new version');
126126
await user.click(blocks[0]);
127127

128-
screen.logTestingPlaygroundURL();
129128
expect(await screen.findByText(/this subsection is new/i)).toBeInTheDocument();
130129
});
131130

src/container-comparison/CompareContainersWidget.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,17 @@ const CompareContainersWidgetInner = ({
6969
if ((!data || !libData) && !['added', 'removed'].includes(state || '')) {
7070
return [undefined, undefined];
7171
}
72-
return diffPreviewContainerChildren(data?.children || [], libData as ContainerChildBase[] || []);
72+
73+
let libChildren = libData as ContainerChildBase[] || [];
74+
if (state === 'removed') {
75+
// There is the case in which the item is removed, but it still exists
76+
// in the library, in that case the query will bring its children,
77+
// but we must put it empty so that the status of all the children of
78+
// the downstream are 'removed'
79+
libChildren = [];
80+
}
81+
82+
return diffPreviewContainerChildren(data?.children || [], libChildren);
7383
}, [data, libData]);
7484

7585
const renderBeforeChildren = useCallback(() => {

src/course-outline/section-card/SectionCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ const SectionCard = ({
146146
upstreamBlockVersionSynced: upstreamInfo.versionSynced,
147147
isReadyToSyncIndividually: upstreamInfo.isReadyToSyncIndividually,
148148
isContainer: true,
149+
blockType: 'section',
149150
};
150151
}, [upstreamInfo]);
151152

src/course-outline/subsection-card/SubsectionCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ const SubsectionCard = ({
128128
upstreamBlockVersionSynced: upstreamInfo.versionSynced,
129129
isReadyToSyncIndividually: upstreamInfo.isReadyToSyncIndividually,
130130
isContainer: true,
131+
blockType: 'subsection',
131132
};
132133
}, [upstreamInfo]);
133134

src/course-outline/unit-card/UnitCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const UnitCard = ({
105105
upstreamBlockVersionSynced: upstreamInfo.versionSynced,
106106
isReadyToSyncIndividually: upstreamInfo.isReadyToSyncIndividually,
107107
isContainer: true,
108+
blockType: 'unit',
108109
};
109110
}, [upstreamInfo]);
110111

0 commit comments

Comments
 (0)