This PR adds pagination for the studio home view and makes minor changes to each course card.
NOTE: This needs to be activated by the environment variable ENABLE_HOME_PAGE_COURSE_API_V2 otherwise, it will continue using the old course list
enable this feature flag
new_studio_mfe.use_new_home_page
* feat: pagination studio home for courses
* chore: addressing some comments
* refactor: addressing pr comments
* test: adding test for studio home slice
* chore: deleting unnecessary blank line
* feat: adding feature for pagination
* refactor: change customParams to requestParams
* fix: linter problems
* fix: course home number of 0 courses
* chore: update feature name for pagination
* fix: pagination enabled request and test for tab section added again
* chore: removing cms link in course card items
* chore: addresing some comments
* fix: array dependency for pagination
* chore: rename apiHooks.jsx to apihooks.js
* refactor: consolidate taxonomy API code
* fix: was not invalidating tags after import
* fix: UI was freezing while computing plan for large import files
* fix: block highlight and status for unscheduled course
* feat: show alerts related to files after pasting unit
* refactor: rename paste notices and add view files option to alert
* refactor: remove additional visibility state check
* refactor: page alert message
* refactor: Unit sidebar to create the TagsSidebar
* feat: Structure of TagsSidebar and TagsTree
* feat: Adding styles to the TagsTree
* feat: TagsSidebarHeader created
* feat: Add count on TagsSidebarHeader
* test: Tests for new components added
* style: Update tags count with opacity when the count is zero
* refactor: Extract tag count component as generic
* refactor: Transform Sidebar to a wrapper component
---------
Co-authored-by: Rômulo Penido <romulo@opencraft.com>
* feat: add duplicate file validation for asset upload
* fix: modal only appearing once
* feat: add tests for overwrite modal
* fix: input not allowing second upload of same file
* fix: default pageSize for asset details
* 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.