oppia / oppia

A free, online learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
5.63k stars 3.78k forks source link

Fix #19816 Change where headerText and subheaderText value are set and fix their display on frontend #20219

Open Sepremo opened 2 weeks ago

Sepremo commented 2 weeks ago

Overview

  1. This PR fixes #19816.
  2. This PR does the following: Relocated the updates for the headerText and subheaderText values from the Chapter Editor component (story-node-editor.component.ts) to the component responsible for the navigation of the Story Editor (in story-editor-navigation.service.ts), like it is done for the updates of SubTopic values in the component for routing of the Topic Editor (in topic-editor-routing.service.ts)
  3. The original bug occurred because: The headerText (along with subheaderText) property undergoes updates after Angular's change detection cycle has concluded. This behavior stems from the component managing the new Chapter Editor Tab. The issue arises because it alters a bound value (as bound in the top-navigation-bar.component.html) within a new Tab (Chapter Editor), albeit within the same page (Story Editor). This error came from the code migration in #17968.

Essential Checklist

Please follow the instructions for making a code change.

Proof that changes are correct

https://github.com/oppia/oppia/assets/12527288/2cba4632-b20e-485a-b7dd-5db2740edf4e

After

oppiabot[bot] commented 2 weeks ago

Assigning @Lawful2002 for the first pass review of this PR. Thanks!

Sepremo commented 2 weeks ago

@seanlip PTAL

Ash-2k3 commented 4 days ago

Hi @Sepremo, just wanted to check, if there's any update on this ?

Sepremo commented 16 hours ago

Hi @Ash-2k3, sorry, I've been a bit busy but I am going to see if it's easy to fix the other similar issues. In the meantime I'll add the changes to fix navigateToChapterEditor.