Skip to content

Commit

Permalink
Merge pull request #1056 from openedx/maham/ENT-7363-hide-track-progress
Browse files Browse the repository at this point in the history
fix: hide track progress tab temporarily due to data issues
  • Loading branch information
mahamakifdar19 authored Oct 12, 2023
2 parents f902ee1 + cb6b6f8 commit 0e494d1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 68 deletions.
3 changes: 2 additions & 1 deletion src/components/Admin/AIAnalyticsSummary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ const AIAnalyticsSummary = ({ enterpriseId, insights }) => {
<FormattedMessage id="adminPortal.summarizeAnalytics" defaultMessage="Summarize Analytics" />
</>
</Button>
{/* Track Progress is currently hidden due to data inconsistency. It will be addressed as part of ENT-7812 */}
<Button
variant="outline-primary"
className="d-sm-inline"
className="d-none"
onClick={() => {
showTrackProgressCard(true);
hideSummarizeCard(true);
Expand Down
17 changes: 9 additions & 8 deletions src/components/Admin/AIAnalyticsSummary.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,17 @@ describe('<AIAnalyticsSummary />', () => {
expect(tree).toMatchSnapshot();
});

it('should display AnalyticsDetailCard with learner_progress data when Track Progress button is clicked', () => {
const wrapper = mount(<AIAnalyticsSummaryWrapper insights={mockedInsights} />);
wrapper.find('[data-testid="track-progress"]').first().simulate('click');
// Currently disabled due to data inconsistencies, will be addressed as a part of ENT-7812.
// it('should display AnalyticsDetailCard with learner_progress data when Track Progress button is clicked', () => {
// const wrapper = mount(<AIAnalyticsSummaryWrapper insights={mockedInsights} />);
// wrapper.find('[data-testid="track-progress"]').first().simulate('click');

const tree = renderer
.create(<AIAnalyticsSummaryWrapper insights={mockedInsights} />)
.toJSON();
// const tree = renderer
// .create(<AIAnalyticsSummaryWrapper insights={mockedInsights} />)
// .toJSON();

expect(tree).toMatchSnapshot();
});
// expect(tree).toMatchSnapshot();
// });

it('should handle null analytics data', () => {
const insightsData = { ...mockedInsights, learner_engagement: null };
Expand Down
3 changes: 2 additions & 1 deletion src/components/Admin/AIAnalyticsSummarySkeleton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Skeleton, Stack } from '@edx/paragon';
const AIAnalyticsSummarySkeleton = () => (
<Stack direction="horizontal" gap={2}>
<Skeleton height={40} width={250} />
<Skeleton height={40} width={250} />
{/* Placeholder for Track Progress is currently hidden due to data inconsistency, will be addressed in ENT-7812 */}
<Skeleton className="d-none" height={40} width={250} />
</Stack>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,61 +28,7 @@ Array [
Summarize Analytics
</button>
<button
className="d-sm-inline btn btn-outline-primary"
data-testid="track-progress"
disabled={false}
onClick={[Function]}
type="button"
>
<svg
className="mr-2"
fill="none"
height={24}
viewBox="0 0 24 24"
width={24}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 12.75c1.63 0 3.07.39 4.24.9 1.08.48 1.76 1.56 1.76 2.73V18H6v-1.61c0-1.18.68-2.26 1.76-2.73 1.17-.52 2.61-.91 4.24-.91zM4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58A2.01 2.01 0 000 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29zM20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm4 3.43c0-.81-.48-1.53-1.22-1.85A6.95 6.95 0 0020 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57zM12 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3z"
fill="currentColor"
/>
</svg>
Track Progress
</button>
</div>,
",",
]
`;

exports[`<AIAnalyticsSummary /> should display AnalyticsDetailCard with learner_progress data when Track Progress button is clicked 1`] = `
Array [
<div
className="pgn__hstack pgn__stack-gap--3"
>
<button
className="d-sm-inline btn btn-outline-primary"
data-testid="summarize-analytics"
disabled={false}
onClick={[Function]}
type="button"
>
<svg
className="mr-2"
fill="none"
height={24}
viewBox="0 0 24 24"
width={24}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M20 7l.94-2.06L23 4l-2.06-.94L20 1l-.94 2.06L17 4l2.06.94zM8.5 7l.94-2.06L11.5 4l-2.06-.94L8.5 1l-.94 2.06L5.5 4l2.06.94zM20 12.5l-.94 2.06-2.06.94 2.06.94.94 2.06.94-2.06L23 15.5l-2.06-.94zm-1.59-2.67l-4.24-4.24L1.59 18.17l4.24 4.24L18.41 9.83zm-4.2 1.38L12.8 9.8l1.38-1.38 1.41 1.41-1.38 1.38z"
fill="currentColor"
/>
</svg>
Summarize Analytics
</button>
<button
className="d-sm-inline btn btn-outline-primary"
className="d-none btn btn-outline-primary"
data-testid="track-progress"
disabled={false}
onClick={[Function]}
Expand Down Expand Up @@ -136,7 +82,7 @@ Array [
Summarize Analytics
</button>
<button
className="d-sm-inline btn btn-outline-primary"
className="d-none btn btn-outline-primary"
data-testid="track-progress"
disabled={false}
onClick={[Function]}
Expand Down Expand Up @@ -190,7 +136,7 @@ Array [
Summarize Analytics
</button>
<button
className="d-sm-inline btn btn-outline-primary"
className="d-none btn btn-outline-primary"
data-testid="track-progress"
disabled={false}
onClick={[Function]}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Admin/__snapshots__/Admin.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7750,7 +7750,7 @@ exports[`<Admin /> renders correctly with dashboard insights data renders dashbo
Summarize Analytics
</button>
<button
className="d-sm-inline btn btn-outline-primary"
className="d-none btn btn-outline-primary"
data-testid="track-progress"
disabled={false}
onClick={[Function]}
Expand Down

0 comments on commit 0e494d1

Please sign in to comment.