* feat: Use react-select for tags selector
Replace existing component with react-select component, by passing in
our custom component.
This retained the existing search functionality.
* fix: Fix missing deps causing constant rerender
This bug appeared after removing the react-query call to the backend
when selecting/unselecting a tag in the dropdown. Since it no longer
gets the updated state from the backend, it doesnt mask the bug.
The bug is essentially the `ContentTagsCollapsibleHelper` rerendering
causing the states to reset overriding the selected (not commited) tags.
This is due to missing dependancies in the useCallback.
* feat: Add stagedContentTags state in react-select
This adds a state and callbacks in the toplevel component of the content
tags drawer to be able to add/remove staged content tags and have them
showup in the react-select as selected chips.
* feat: Split up applied & staged content tags trees
Now content tags have seperate tree states for applied ones and staged
ones. They are updated seperately and both are used when updating the
selectable box UI. This allows for more flexibility with actions that
can be performed on the staged content tags with impacting the applied
ones.
* feat: Change style of implicit checkbox to checks
This overrides the indeterminate input checkbox style to match the
checked checkbox style, using variables defined in paragon.
* feat: Add bottom buttons in tags dropdown selector
* refactor: Remove cloneDeep + simplify code
* feat: Update placeholder/button texts
* feat: Implement cancel button + add proptypes
* feat: Implement commit/cancel staged tags
This implements the commit functionality for staged tags, taking account
for implicit tags. This also handles the case for removing applied tags
by clicking on the "x" in the TagBubble.
* feat: Keep all staged tags only commit explicit
* feat: Change style of add/cancel/load more buttons
* feat: Add inline "Add" button to commit tags
In the react-select component, an inline "Add" button showsup when some
tags are staged, if they are clicked they are commited/applied.
* fix: Keep applied tag checked when only staged child unchecked
* feat: Style add tags widget + staged tags
Also clear search term whenever tags are staged/cancelled
* feat: Fixed some typing errors
* test: Update tests to fix existing broken cases
* test: Add new functionality tests
* chore: add types to ContentTagsCollapsible
* chore: add types for useContentTagsCollapsibleHelper
* fix: Small bug with useIntl
* chore: Fix more linter issues
* refactor: Separate stagedTags and stagedTagsTree state updates
This refactor removed the warning that was caused because the state of a
parent component (ContentTagsDrawer) was being updated in the middle of
a state update in (ContentTagsCollapsible). This seperated the two state
updates to avoid this issue.
* chore: Update package-lock.json
* fix: Reset applied tags in selectbox when fetching
Whenever we get new applied tags from the backend, we reset the applied
tags that are checked, and only check the explicit tags. This was
causing an issue of duplicate applied tags being added to the selectbox.
* chore: Update package.json
---------
Co-authored-by: Braden MacDonald <braden@opencraft.com>
The Configure Live modal in Pages & Resources page uses a selectable box to select the video conferencing tool. It seems broken as well (not selectable).
It looks like the bug with not working SelectableBox (see e.g. #886) affects pretty much any component that uses it.
Thus, this PR replaces every usage of the paragon component with our working copy from flcc.
Due to a bug in the SelectableBox component, selecting values was not possible in different components throughout this MFE.
This fixes the Gallery and the Select Problem Types components by updating the FLCC version and replacing the SelectableBox copy with an import from FLCC.
For a full bug description see #880.
Description
We are encountering a bug in our stage environment that is very hard to reproduce locally, but not impossible. This is the same bug dealt with in several previous PRs like for example #871 (here I'm working on another component that uses the same paragon component and therefore encounters the same bug).
Since I was able to reproduce it locally, it is definitely not just a bug affecting only 2U-specific things.
Expected behavior
open a course with files
select a different sorting order (for example oldest to newest)
you should be able to select the different option
you should be able to successfully apply it
Actual behavior on stage environment
you can't select different option
you can't apply different option
Previous steps
Previously, I reproduced this locally by just adding the latest version of SelectableBox as a copy into this repo and importing it from there. Then, under the mistaken assumption that there was a missing context provider, I added that and it got fixed locally. However it turned out to not work on stage.
Measures taken in this PR
I replaced the entire SelectableBox component with all subcomponents with a version from @edx/paragon@21.5.6, which was apparently the version in the commit that didn't have the error yet. In theory, this would just fix the problem, though I have my doubts. But it's worth a try. I only imported it in one place, in this SortAndFilter modal.
I added console logging for onChange events which seem to the problem, as they are not triggering a change in the value of the context on stage. I see little choice than to log them to get more info. This will only affect the component that's not working.
* feat: TagCount component
* feat: Update ContentTagsDrawer to use it in the MFE
* feat: Manage tags menu added on units
* feat: Tag count added on unit
* feat: Add button feat to Tag count
* test: Course Outline api tests
* test: Ignore lines that can not be tested
* style: Comment added on ContentTagsDrawer
* style: Nits on CardHeader
* feat: added Sidebar with unit info
* feat: added unit location
* refactor: added legacy behavior
* feat: added live variant
* refactor: code refactoring
* feat: added tests and translations
* feat: added new font size
* refactor: after review
step 1 for trying fixes for the stage bug where the paragon radio select is not clickable. Here I just replace the paragon component with our identical copy to see what that changes. Followup steps are to change this component until hopefully the problem gets fixed.
* feat: Make "Pages & Resources" course apps into plugins
* feat: move ora_settings
* feat: move proctoring
* feat: move progress
* feat: move teams
* feat: move wiki
* feat: move Xpert settings
* fix: add webpack.prod.config.js
* fix: clean up unused parts of package.json files
* feat: Add an error message when displaying a Course App Plugin fails
* chore: fix various eslint warnings
* chore: fix jest tests
* fix: error preventing "npm ci" from working
* feat: better tests for <SettingsComponent>
* chore: move xpert_unit_summary into same dir as other plugins
* fix: eslint-import-resolver-webpack is a dev dependency
* chore: move learning_assistant to be a plugin too
* feat: for compatibility, install 2U plugins by default
* fix: bug with learning_assistant package.json
* feat: add proctoring exam link to actions
* feat: prerequisite settings in advanced tab
* refactor: use formik for configuration modal in outline
* feat: proctoring exam settings in subsection configuration
test: prereq & proctoring settings
* feat: outline alerts
test: outline page alerts
* refactor: replace highlights badge with bubble
* feat: discussion badge in outline
* refactor: status bar style and date format
* Fix spacing between checklist and highlights button
* Fix title alignment in status bar
* Align learn more link to center with respect to button
* Update start date display in local format
* fix: unit url
* refactor: redesign item header
* move status to end of card
* move edit icon next to title
* make it visible on hover
* test: improve coverage
* refactor: update messages and alert colors
* feat: Course unit - add new component section
* feat: Course unit - make Discussion and Drag-and-Drop button functional
* feat: Course unit - make Problem button functional
* feat: Unit page - make Video button functional