Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed broken "Pages and Resources" page #446

Merged
merged 2 commits into from
Feb 9, 2023

Conversation

BilalQamar95
Copy link
Contributor

@BilalQamar95 BilalQamar95 commented Feb 8, 2023

What has changed

Fixed broken "Pages and Resources" page, as a result of changes made in 322. Updated the AppHeader call in course authoring page.

Screenshot 2023-02-08 at 6 19 33 PM

@BilalQamar95 BilalQamar95 self-assigned this Feb 8, 2023
@BilalQamar95 BilalQamar95 changed the title fix: corrected incorrect AppHeader function initiation fix: corrected incorrect AppHeader function call Feb 8, 2023
@codecov
Copy link

codecov bot commented Feb 8, 2023

Codecov Report

Base: 74.45% // Head: 74.48% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (9e7e6ae) compared to base (8359157).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #446      +/-   ##
==========================================
+ Coverage   74.45%   74.48%   +0.02%     
==========================================
  Files         106      106              
  Lines        2083     2085       +2     
  Branches      514      514              
==========================================
+ Hits         1551     1553       +2     
  Misses        504      504              
  Partials       28       28              
Impacted Files Coverage Δ
src/CourseAuthoringPage.jsx 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@BilalQamar95 BilalQamar95 changed the title fix: corrected incorrect AppHeader function call Fixed broken "Pages and Resources" page Feb 8, 2023
@BilalQamar95 BilalQamar95 force-pushed the bilalqamar95/authoring-page-fix branch from ccb12e1 to ae91c0b Compare February 8, 2023 13:48
@jristau1984
Copy link
Contributor

Tagging in @bszabo to decide whether he wants to field this PR rather than the revert.

@bszabo
Copy link
Contributor

bszabo commented Feb 8, 2023

I'm working this afternoon to reproduce the error and confirm that this fix makes it go away. This is the preferable way forward if it works. Will report back here.

@@ -57,7 +57,7 @@ const CourseAuthoringPage = ({ courseId, children }) => {
we shouldn't have the header and footer on these pages.
This functionality will be removed in TNL-9591 */}
{inProgress ? !pathname.includes('/editor/') && <Loading />
: <AppHeader courseNumber={courseNumber} courseOrg={courseOrg} courseTitle={courseTitle} courseId={courseId} />}
: AppHeader(courseNumber, courseOrg, courseTitle, courseId)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BilalQamar95 Rendering a React component by calling it as a function instead of rendering it with JSX (i.e., <AppHeader ... />) is an anti-pattern. I would recommend instead changing AppHeader's function signature to make it be a true React component (i.e., accepts a props object that may be destructured), rather than the existing function:

const AppHeader = ({ courseNumber, courseOrg, courseTitle, courseId }) => (...);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will update it

@bszabo bszabo self-requested a review February 9, 2023 11:35
@bszabo
Copy link
Contributor

bszabo commented Feb 9, 2023

I've confirmed that this fix resolves the problem for which the course-authoring build pipeline was paused. I'm approving this PR and closing the associated revert PR.

@bszabo bszabo merged commit 86974b7 into master Feb 9, 2023
@bszabo bszabo deleted the bilalqamar95/authoring-page-fix branch February 9, 2023 11:45
bradenmacdonald pushed a commit to open-craft/frontend-app-authoring that referenced this pull request Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants