-
Notifications
You must be signed in to change notification settings - Fork 76
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
feat: Enable taxonomy/tagging feature in MFE by default #971
Closed
rpenido
wants to merge
11
commits into
openedx:master
from
open-craft:rpenido/fal-3708-enable-taxonomy-tagging-feature-in-mfe-by-default
Closed
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5fbfe66
refactor: change ENABLE_TAGGING_TAXONOMY_LIST_PAGE waffle flag to DIS…
rpenido 22084d4
feat: create useStudioHomeData hook
rpenido c0404ae
test: add queryclientprovider to fix errors
rpenido 0c6951b
test: add queryclientprovider
rpenido b0cd867
chore: update test mock
bradenmacdonald 5f32f47
chore: update with latest master
bradenmacdonald d85522b
feat: finish implementing disable flag for taxonomy/tagging features
bradenmacdonald 29daee5
perf: don't refetch the "studio home data" too often
bradenmacdonald e82c2de
test: increase test coverage
bradenmacdonald 5d37761
fix: Hide unit tags sidebar if taxonomies disabled
yusuf-musleh 5b19f45
chore: linting
yusuf-musleh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always seems to be falling back to
false
since the env variable is not being set, regardless of whether the flags is set in the edx-platform or not. So the "Manage Tags" and tags counts always show regardless if the new waffle flag is set or not.The previous flag has the following env variables set:
https://github.com/openedx/frontend-app-course-authoring/blob/65f45f72f08c1f38ced5d8d302fbdd2406da228d/.env#L36
https://github.com/openedx/frontend-app-course-authoring/blob/65f45f72f08c1f38ced5d8d302fbdd2406da228d/.env.development#L39
https://github.com/openedx/frontend-app-course-authoring/blob/65f45f72f08c1f38ced5d8d302fbdd2406da228d/.env.test#L34
Since it currently doens't seem to be reading it from the edx-platform backend, I'm not sure what the general practice is for this, however maybe we could utilize the
taxonomiesEnabled
flag that is passed in from the backend:https://github.com/openedx/frontend-app-course-authoring/blob/65f45f72f08c1f38ced5d8d302fbdd2406da228d/src/studio-home/tabs-section/index.jsx#L32-L37
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @yusuf-musleh!
I think getting the data from the backend is the right approach, but we need to fetch a lot of data to use this selector.
I created a new hook (using react-query) that solves that problem. The only issue is that we need this info in the index.jsx, where we don't have the necessary configs just to call a hook.
We may need to use some kind of "lazy load" for the routes. Maybe @bradenmacdonald could help us with some ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey guys, I don't know if there is a good pattern for this now. I think we should just stick to the simplest option and have an environment variable that disables the MFE features (
getConfig().DISABLE_TAGGING_FEATURE
) and a waffle flag that controls the legacy UI (content_tagging.disabled
).The waffle flag is already set on edx.org, in anticipation of this PR, but we'll also have to get them to set the env var once it's confirmed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I like @rpenido's approach and I think it's even better if we can get it to work. Which
index.jsx
is the problem? The studio home page or the taxonomies page?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root index, where we declare the
<App>
.One "easy" approach to avoid this problem (needing a provider at the App level) is to move the check to the destination pages, showing an error message or redirecting to another place if the flag is disabled. I think this is not the best solution, but it will work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine. We want most people using this, and having it disabled will be fairly rare. The important thing is that reading this flag doesn't slow down the frontend, so shouldn't introduce an additional blocking API request on every page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So let's go with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I implemented that ^
@yusuf-musleh could you please review/test this PR again?