When active/archived filters were on or there was selected any order filter, the search skipped these values and it was just returned the courses list without the respective filters. Additionally, when a search keyword was applied and a filter was selected, the keyword stayed stuck and the search list returned were not the appropriate
* Makes the Active Tab Key independent from the URL, except for the initial load, where the active tab is set from the url.
*Avoids unnecessarily changing SearchParams: Due to a limitation of the useSearchParams react hook, which uses a memoized value for the URL that becomes stale after selecting a tab, it unexpectedly changes the URL value. Unfortunately there's no way to completely avoid this, so if there's a usageKey url param, the hook setter function will be called and the URL will revert to the stale memoized url.
The following bugs were found with the TinyMCE aux modal (used in emoticons, formulas and embed iframe):
* The TinyMCE aux modal and the Editor modal close when clicking on any content in the aux modal.
* When the user opens the Edit Source Code modal, this adds data-focus-on-hidden to the TinyMce aux modal, making it unusable (not clickable).
* Since they are two separate modals, the focus remains on the editor modal, making it impossible to use scrolling or inputs from the modal aux.
Solution: Move the aux modal inside the editor modal.
One discarded solution: Block the modal editor from closing when interacting with the modal aux. The modal editor still retained focus.
Show a detailed error when 400 Bad Request received while adding a component to a library, either a new or pasted component. The most likely error from the backend here is "library can only have {max} components", and since this error is translated already, we can just report it through.
(cherry picked from commit f1bdc6200f)
The text & problem xblock editors will display a confirmation box before
cancelling only if user has changed something else it will directly go
back.
(cherry picked from commit df8a65dc4e)
Allow users to upload and delete assets associated with Content Library
components via the sidebar panel, under the "Advanced Details" section
of the "Details" tab. This is intended as a debug tool and power-user
feature, similar to the OLX editor provided there. It's also serving as
our interim image-upload solution, because it was easier to implement
than the full modal that integrates with TinyMCE.
---------
Co-authored-by: XnpioChV <xnpiochv@gmail.com>
* feat: direct link to single block in library
Adds support for displaying single xblock in a library when passed a
query param: usageKey. This is required for directing users to a
specific block from course.
* feat: show alert while editing library block from course
* feat: menu option to delete a component
* feat: close component sidebar if it's open when that component id deleted
* feat: hide unsupported block types from the "Add Content" menu
* fix: expand and internationalize the "component usage" text
* refactor!: turn on homepage course API V2 consumption by default
Turn on getting courses from the HomePageCourses API
which allows pagination, filtering and ordering. See https://github.com/openedx/edx-platform/pull/34173
for more details on the API implementation.
* fix: home page initial a-z course sort
---------
Co-authored-by: Diana Olarte <diana.olarte@edunext.co>
The static asset substitution used to make images show up properly when
in the TinyMCE editor doesn't work for Content Libraries. Unfortunately,
this will cause the static asset references in XBlock content to get
mangled and saved incorrectly. So until we can handle it correctly,
we're just going to disable it entirely if the LearningContext is a v2
Content Library.
This means that static assets won't display properly in the editor
itself, but it should at least get written/preserved correctly, so that
those assets will show up properly in XBlock previews.
edx-platform commit 7316111 (PR #35598) moved the XBlock embed view so
that it can be rendered on either LMS or Studio. This commit moves the
frontend to actually call the Studio endpoint. This will make Content
Library static asset display easier, because that view will only be made
available through Studio and not the LMS.
* feat: show error msg from server on paste
* feat: add an allowlist of for supported blocks in library
Libraries v2 currently don't support editing blocks other than problem,
text and videos. This commit adds a configuration variable called
`LIBRARY_SUPPORTED_BLOCKS` to setup allowed list of block types users
can paste into libraries. By default it is set to support
'problem,text,video,html`.
* feat: enable add button for blocks based on setting
---------
Co-authored-by: Rômulo Penido <romulo@opencraft.com>
* style: avoid using reserved word "type" as variable name
use componentType or blockType instead.
* refactor: let BlockTypeLabel handle displaying the component label
including the child count, if one is provided.
This change removes hooks for the block_types REST API
* test: add tests for BlockTypeLabel
---------
Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
* feat: enable the problem editor for library components
* fix: don't try to load "advanced settings" when editing problem in library
* fix: don't fetch images when editing problem in library
* docs: add a note about plans for the editor modal
* fix: choosing a problem type then cancelling resulted in an error
* chore: remove unused mockApi, clean up problematic 'module' self import
* test: update workflow test to test problem editor
* feat: show capa content summary on cards in library search results
* docs: fix comment typos found in code review
* refactor: add 'key-utils' to consolidate opaque key logic
* fix: a11y - missing 'alt' text for Problem Editor IconButton
* fix: warning in <ProblemTypeSelect> component - missing key prop in list
* fix: warning: `problemType` required in `ProblemEditor`, but is `null`
* fix: warning: The prop `onClose` marked as required in `SelectTypeModal`
* fix: warning: prop `name` is marked as required in `ForwardRef(_c)`
* fix: warning: props `alt`, `id`, and `key` are required
* test: improve test coverage of SelectTypeModal, refactor some code
* test: improve test coverage
fix: use "Recently Modified" as the default sort option
When search keyword(s) are entered, use "Most Relevant" as default.
Also
* Hides "Most Relevant" option if no keyword is entered.
* Re-orders the sort menu options
* Ensures the default sort option is not stored in the query string
* Shows the selected sort option on the drop-down toggle button
* Shows "Sort By" as a header inside the drop-down menu
* fix: discard changes
* refactor: disable discard btn for new libs
Enable it if components are added.
* refactor: invalidate library related content queries
* chore: add comment about content search query invalidation
* fix: share alike after save, license link for creative common
* test: update snapshot
---------
Co-authored-by: Kyrylo Hudym-Levkovych <kyr.hudym@kyrs-MacBook-Pro.local>
* fix: Hide open Create content buttons without permissions
* feat: Read only badge on library Home
* refactor: library authoring to get canEditLibrary from useContentLibrary
* style: Typo on the code
Corrected the typo in the prop name of the Alert component from 'varaint' to 'variant'. This change ensures the proper functioning of the alert in informational variant.
* fix: pasting and images only insert at beginning
* fix: add image click not showing gallery
* chore: increase code coverage
* fix: empty string when no srcs need updates
* fix: assest to static in raw editor
* fix(deps): update dependency @openedx/paragon to v22.6.1
* fix: lint errors from stricter types in new paragon version
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat: add upload progress modal
* fix: increase code coverage
* fix: fix code to be more readable
* fix: delete empty file
* fix: failing test and lint
* fix: progress bar not updating
* feat: add missing abort controller on POST to edxVal
* fix: warnings about Duplicate message id
* fix: paragon's Hyperlink no longer accepts a 'content' attribute
* test: ensure all act() calls are async
* test: Removed "async" from "describe"
* fix: DiscussionsSettings tests
* Don't nest userAction.click in act() -- nested act() statements have
indeterminent behaviour.
* Use getBy* instead of findBy* with userAction to avoid nested act() statements
* Always await userEvent.click
* Use fireEvent.click when the onClick handlers need to be called
* Use queryBy* instead of getBy* when using .toBeInTheDocument or
* fix: typo in data-testid
* test: Use useLocation to test route changes
* Don't nest userAction.click in act() -- nested act() statements have
* chore: fix lint:fix and lint errors
* remove "indent" setting from .eslintrc.js
* add @typescript-eslint/ prefix to eslint-disable-line statements where flagged by linter
* changed stylelint setting import-notation to "string"
* test: fix failing tests after upgrade
* fix: css error "target selector was not found"
* chore: upgrades dependency frontend-lib-content-components@2.3.0
* chore: bumps @edx/frontend-component-ai-translations to ^2.1.0
---------
Co-authored-by: Yusuf Musleh <yusuf@opencraft.com>
This PR adds a new configuration flag that shows/hides tabs in studio home along with some new functionality around to V1 and V2 Libraries.
When the new LIBRARY_MODE flag is set to "mixed" (default in dev) it will show "Libraries" and "Legacy Libraries" tabs that correspond to v1 and v2 tabs respectively.
When the new LIBRARY_MODE flag is set to "v1 only" (default in production) or "v2 only", only one tab "Libraries" is shown and only the respective libraries are fetched when the tab is clicked.
In addition to the above changes, the URL/route now updates when clicking on the tabs, and navigating to it directly would open up that tab as well as a new placeholder page that you will be redirected to when clicking on a v2 library if the library authoring MFE is not enabled.
This reverts commit e22cce9fa6.
Reverts #1106
The reason is that the pipeline to deploy to stage broke. This commit is probably the reason.
The revert is temporary until the pipeline problem is solved.
* fix: paragon's Hyperlink no longer accepts a 'content' attribute
* test: ensure all act() calls are async
* test: Removed "async" from "describe"
Returning a Promise from "describe" is not supported.
* fix: DiscussionsSettings tests
Previous commit revealed several issues with these tests
* Don't nest userAction.click in act() -- nested act() statements have indeterminent behaviour.
* Use getBy* instead of findBy* with userAction to avoid nested act() statements
* Use fireEvent.click when the onClick handlers need to be called
* Use queryBy* instead of getBy* when using .toBeInTheDocument or waitForElementToBeRemoved
queryBy* return null when the element is not found.
* fix: typo in data-testid
Warning: React does not recognize the `data-testId` prop on a DOM
element. If you intentionally want it to appear in the DOM as a custom
attribute, spell it as lowercase `data-testid` instead.
* test: Use useLocation to test route changes
---------
Co-authored-by: Yusuf Musleh <yusuf@opencraft.com>
This change fixes redirection to the library component in the unit when selecting the search result. It also fixes an issue with navigating to the library MFE when selecting a library component.
Adds the new "Other tags" Section to tags drawer that contains the taxonomies/tags that the user doesn't have permission to see/edit. It allow to delete those tags.
Updates the code of Tag Drawer to send two messages to parent (if the drawer is a iframe) when the tags are updated:
- One message with updated content tags.
- One message with the content tags count.
* feat: More spacing between search bar and selectmenu
* feat: Autofocus search field when modal opens
* feat: Fix issues with scroll to search result
This includes the following:
- The target search element is aligned to the top of the page when scrolling to it
- Makes sure the section/subsection is expanded in order to scroll to result
* fix: Match focus border radius with button's
* fix: Only expand (sub)section with search result
It contains different changes to achieve the reading and editing mode of the drawer tag:
* Manage tags drawer footer with buttons added.
* Creation of ContentTagsDrawerContext.
* Creation of global state and global removed state to allow edit mode.
* Update API client to match with openedx-learning 0.9.1: Save tags of multiple taxonomies; to save all tags added/removed on edit mode
* Extract TagsTree and use it on the Tags Drawer.
* Update TagsTree to allow edit mode.
* Add a Toast on Tags Drawer; show the toast afert save.
* Scrolling + sticky footer on tags drawer
* chore: add @openedx/frontend-plugin-framework
chore: move plugin page setting button to a props
chore: split out app setting modal for reusability
chore: add implementation of WTC plugin
chore: update app setting form
chore: implement the plugin form with mock
chore: follow the UI design
chore: remove translation plugin and move it into frontend-plugin instead
* chore: add eslint ignore for env.config.jsx
* chore: update package-lock.json
Switching from undefined to "" tells the browser to put in a modal which requires users to confirm thier navigation away. this will prevent continued annoyances from upload failures: https://2u-internal.atlassian.net/browse/TNL-11587
As of #918 , the content search only allows filtering the results by one tag at a time, which is a limitation of Instantsearch.
So with this change, usage of Instantsearch + instant-meilisearch has been replaced with direct usage of Meilisearch. Not only does this simplify the code and make our MFE bundle size smaller, but it allows us much more control over how the tags filtering works, so that we can implement searching by multiple tags.
Trying to modify Instantsearch to do that was too difficult, given the complexity of its codebase.
Related ticket: openedx/modular-learning#201
* feat: Remove 'x' close btn from tags drawer
* feat: Change style for taxonomy tags count
* feat: Update heading styles in tags drawer
* feat: Move dropdown arrows to left of taxonomy
---------
Co-authored-by: Yusuf Musleh <yusuf@opencraft.com>
This change makes improvements to the `SearchResult` component which shows the search results in a number of ways:
- It improves the information messages that show up before you start search, and if the results are empty.
- It adds more context to the search results, by displaying the location of the content
- It adds a link to directly navigate to the relevant content item.
- It adds an animated highlight to a unit right after you navigate to it.
---------
Co-authored-by: Jillian <jill@opencraft.com>
Co-authored-by: Braden MacDonald <mail@bradenm.com>
Update codecove to the latest version and start using the per repo
tokens which will soon be required to get more reliable coverage builds.
This change also has a corresponding addition of a codecov repo upload
token to the repository secrets for this repo.
* feat: pagination studio home for courses
* chore: addressing some comments
* refactor: addressing pr comments
* test: adding test for studio home slice
* feat: search input and filters for course home
* fix: using open edx paragon
* feat: usedebounce hook for searching courses
* fix: filters params for searching coruses
* feat: adding coursekey when course name is empty
* chore: remove edit in studio button
* fix: message changed when courses were not found
* refactor: support courses tab filters and pagination
* test: more cases for course filters component
* refactor: coverage for onsubmit search field
* test: unit test for courses tab component
* feat: loading for search input and layout of course tab
* fix: linter problems
* test: adding more tests for courses tab
* refactor: don't ignore empty string as a case for searching
* refactor: manage empty search bar as special case for searching
* fix: remove expected dispatch mock for clear button
---------
Co-authored-by: Maria Grimaldi <maria.grimaldi@edunext.co>
Implementation of openedx/modular-learning#201
Implements a modal for searching course content with filters for searching in current or all courses, filtering by content type, content tags and text.
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
JIRA: https://2u-internal.atlassian.net/browse/TNL-11465
This is a problem we're experiencing on stage due to a bug in paragon. This is intended as a temporary fix until we can dig into why this is happening in paragon. But basically the Context for the SelectableBox is missing a provider in paragon. The short-term fix is to copy over paragon's selectablebox component and fix it. This is done so that our quick fix doesn't break anything else in paragon for now or cause any unexpected issues.
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
This is a refactoring for a part of the ReactStateXMLParser. I wanted to use functions that are more generic and not just handle a list of edge cases. So I encapsulated the operation that was done in this part of the code to a function `findNodesAndRemoveTheirParentNodes` which is more generic and could be used for different operations.
internal issue: https://2u-internal.atlassian.net/browse/TNL-11311
This fixes a bug where the editor was deleting the OLX tag when editing in the simple editor and then saving.
Also the description was being converted to em for the simple editor, but then not converted back. However, the xblock renders label and then em in reverse order for some reason.
To fix it, the em gets converted back to description now, but not for every em tag (added a class "olx_description" for the tags that should be converted).
* fix: video upload page layout fixes
* fix: video editor thumbnail fallback icon colour and size
* fix: video uploader close button go back instead of closing app
Change the video uploader close button to always go back in navigation history,
and change the gallery to replace its location with the video uploader's when
automatically loading it due to an empty video list, so that when the uploader
goes back in the history, it goes to what was before the gallery.
* fix: video editor spinners vertical alignment
The Editor component uses the pgn__modal-fullscreen class to be fullscreen,
but it is not structured like a Paragon FullscreenModal and the fullscreen
positioning style is not applied correctly, particularly in the case where
the content is smaller than the body - a vertically centred component will
be centred to the content size, not to the screen.
Here we directly apply the style that would have applied to the relevant
elements of a Paragon FullscreenModal.
* fix: use trailingElement for video uploader input button
Also styles the button so it looks the same on hover/active.
The max attempts setting for a problem xblock should be set to null for
course default max attempt setting to take effect. This makes sure that
xblock setting is updated if course default is updated.
This commit reverts to advanced editor when partial_credit attribute is
added to multichoice, single select and numerical problems. Without this
change, the partial_credit attribute is removed from the problem on the
next edit.
The issue had to do with how Firefox handles pasting newlines inside a <pre
contenteditable> tag (TinyMCE's editor works via contenteditable) and
fast-xml-parser's parsing. In Firefox, newlines are converted to <br> when
pasted, while Chrome preserves them. The parser by default trims spaces in text
nodes. In Firefox, the parser creates individual text nodes between the <br>
elements, and those have leading spaces in the example. In Chrome, there are no
<br> elements and the entire content is a single text node as-is. Setting
trimValues to false disables the trimming and resolves this issue in Firefox.
While investigating this, I noticed the builder also mishandles <br /> tags
emitted by the editor, converting them to <br></br>. The unpairedTags option in
the builder ensures they are output correctly as a single tag, and setting
suppressUnpairedNode to false ensures that single tag is <br/> rather than <br>
to remain XML compatible.
While trying to resolve this, I was looking into the paste plugin in TinyMCE.
It changes the behavior of pasting, making it more consistent between Chrome
and Firefox (i.e. both emit <br>) and is incorporated into TinyMCE 6 core.
Unfortunately, it seems to mangle pasting inside a <pre> tag by inserting
redundant nbsp characters (tinymce/tinymce#9017). TinyMCE 6 also outputs <br>
rather than <br /> - adding unpairedTags to the parser options is meant to
handle this, but it does not seem to behave entirely correct
(NaturalIntelligence/fast-xml-parser#609). These should be kept in mind if/when
upgrading to TinyMCE 6 (the different behaviors can be seen easily at
https://fiddle.tiny.cloud).
This fixes a bug where an answer text was flipped in terms of the character order when typing (TNL-10980). One of the prop names of the TinyMceWidget that is imported in course-authoring had to be changed, so this goes together with https://github.com/openedx/frontend-app-course-authoring/pull/575.
This PR fixes style component and remove any new component introduced.
We introduce a new thumbnail for setting page as well.
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
The sort and filter UI of the video gallery was not working, this fixes that
issue, and also adds a new UI for filering videos that allows filtering videos
to include more than one status.
It also fixes the hooks related to VideoGallery to avoid potential bugs in the
future and updates tests to use react testing library instead of enzyme.
It also reduces the padding in gallery page.
Description:
This is a bug where the image resizing in text editor and problem editor was completely broken. Putting in a text value when the aspect ratio lock was enabled would change both values but not to the size you wanted. If you disabled the lock, not just one but both values would change.
This is a problem that mostly affects images that are rectangular, not square. There's an example image below which is one that caused problems on prod.
Main fixes:
when I keep the image ratio locked, I can change one value (like width) and the other will jump to the proportionate value, but rounded to full pixels.
when I unlock the aspect ratio and change a value, then click save on the image dimension modal, only the one value will change, which will stretch the image in whatever direction. This is reflected in the tinymce image and then the updated value will appear when I reopen the image dimension modal. It is not possible to reset the image to the original dimensions any longer. The new values are saved.
The image dimensions in the edit image settings modal should always reflect the actual dimensions of the image when I look at it e.g. in the course outline. (Otherwise I may click save and the image is squished.)
There was a problem with deselecting an image: when you edit image dimensions and then save or press cancel, the "edit image" button will not disappear, but the image is not selected anymore. When you do not click anything else but immediately click on this button, sometimes (at least the second or third time you do this) this will throw an error. I fixed it so it will just open the default "select image" modal.
Other requirements:
Resizing the image means that when I open the dimensions update, I see the new dimensions.
Images in the editor are now displayed with the correct dimensions, proportional or stretched, if those dimensions don't exceed the size of the editor.
A known smaller bug emerging from this is that when you have more than one instance of the same image in the same editor, you cannot get or set its dimensions correctly. I believe I have gotten it into the following state: When you click one of the copies, you will either get the correct dimensions of the selected copy, or if not, it will display the original image dimensions. When you edit the dimensions, the correct copy of the image will be updated.
Out of Scope:
This cannot handle more than one instance of the same image properly. There will be a separate bug issue for this.
Sometimes, when you edit image dimensions and then reopen the image dimension modal, the dimensions will be null and thus just not appear in the modal - randomly. This is a bug as well.
This changes make the style consistent across the first three
headline line levels
1. The first level add CSS prop initial
2. The second level change prop from capital to inital
3. No change
This is a PR enabling eslint "rules-of-hooks".
This lint rule catches some very annoying bugs and enforces you to use correct naming for custom hooks (prepend with "use"), which is a mandatory react rule and important for a number of reasons.
I added eslint-disable statements wherever the rules are broken, and if this is merged, I would expect new code not to break the rules any longer.
I strongly suggest that the much better way to extract and reuse hooks and logic from components is the way the community does it and the React docs suggest. The new React docs are really fantastic in this regard and you can use the patterns found there very well to have an excellent application. https://react.dev/learn/reusing-logic-with-custom-hooks
dumb
It is done to make sure the business logic is not in a component and can
be individually tested.
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
The SelectImageModal component has been refactored so that it can also be used on the video selection page; and all its child components.
Now this component is called SelectionModal and is used both for the image selector and in this new video selection screen.
The assets api has been used to get the videos.
this creates the ability for explanations to work if they are:
Not a child of a response type
Use an h2 tag for the explanation title
do not use the "Explanation" title.
Since every course has graded problems, every course author will be editing or creating problems, and every learner will need to receive points for any problem in a graded assignment in order to earn a passing grade. So if what I encountered and am reporting here is reproducible, this should probably be addressed before the problem editor feature is released.
This change increases the frequency at which odd tags (like shuffle) on multiple choice problems don't go to the visual editor.
Instead, they will now divert to the advanced editor. There might be other places where we need to follow a similar pattern, but we don't know those yet.
Before this commit, the popup message which offers to import transcripts
from YouTube would only appear after saving the video settings, and then
reopenning the editor.
With this commit, the popup appears dynamically, i.e. whenever a URL is
changed to a YouTube one, certain validations and check take place,
after which, if possible to do so, user will be offered to import
transcripts from the YouTube video.
This is related to Maintainership Pilot expectations. This CODEOWNERS file will notify teaching-and-learning team members of PR submissions, but there are currently no additional branch protections related to this ownership.
This file populates Backstage info for the Open edX community. It helps identify that tnl is the owner of this component. This is in relation to Maintainership OEP-55.
* build: Creating a missing workflow file `self-assign-issue.yml`.
The .github/workflows/self-assign-issue.yml workflow is missing or needs an update to stay in
sync with the current standard for this workflow as defined in the
`.github` repo of the `openedx` GitHub org.
* build: Creating a missing workflow file `add-depr-ticket-to-depr-board.yml`.
The .github/workflows/add-depr-ticket-to-depr-board.yml workflow is missing or needs an update to stay in
sync with the current standard for this workflow as defined in the
`.github` repo of the `openedx` GitHub org.
* build: Creating a missing workflow file `add-remove-label-on-comment.yml`.
The .github/workflows/add-remove-label-on-comment.yml workflow is missing or needs an update to stay in
sync with the current standard for this workflow as defined in the
`.github` repo of the `openedx` GitHub org.
* build: Updating a missing workflow file `commitlint.yml`.
The .github/workflows/commitlint.yml workflow is missing or needs an update to stay in
sync with the current standard for this workflow as defined in the
`.github` repo of the `openedx` GitHub org.
This Ticket adds three new settings widgets to the Problem Editor:
Randomization: This is a setting for advanced problems only which deals with python scripts.
General Feedback: This is feedback which is only applied to certain problem types for mass-adding feedback to incorrect problems.
Group Feedback: For certain problems, the user can provide specific feedback for a combination of specific answers.
fix: match new frontend behavior with legacy behavior (zero problem attempts is zero attempts, null attempts is infinite); negative values disallowed and forced to zero. TNL-10324.
* refactor: move CodeEditor to shared components and remove circular dependency
* feat: add code editor to problem editor
* fix: typo
* feat: add save function to raw olx editor and add highlighting
* feat: simplify and add tests to edit problem view
* feat: add tests to problem edit view
* fix: update raw editor tests
* fix: code editor tests
* fix: package-lock
* fix: lint
The repo should have a CODEOWNERS file, but this effort is specifically to help test a need to make an edx-platform file notify T&L when changes are made. We are doing the testing on this edx repo that we own to minimize the churn and impact on edx-platform.
The scope of this effort includes:
# Create a CODEOWNERS file in this repo that calls out a single file as owned by a team.
# Submit a no-change PR to that file and ensure the team is notified
# Submit a no-change PR to another file in the repo and ensure the team is NOT notified
# Update the CODEOWNERS file to have T&L team as owners of the whole repo, instead of just one file (long term desired state)
As sometimes the html components are rendered downstream before the block is loaded, we need to handle the case of no block value being provided to the raw editor at the time of first render. Subsequent thunk actions will trigger re-renders to display the block.
For https://2u-internal.atlassian.net/browse/TNL-9955
there are multiple instantiations of the text editor in different contexts, so we need to handle them upfront to not break either experience flow” or something along those lines…
Note: this removes the crop and rotate functionality from the toolbar, as it requires an image_proxy server or tinymce cloud. https://www.tiny.cloud/docs-4x/plugins/imagetools/#imagetools_proxy. We also need to create a follow up ticket to handle right click behavior.
This is that follow up ticket
* feat: add capabilities
* chore: more tests
* fix: use correct hook source for getDispatch
* fix: fix fetchImages data contract
* fix: make onClose method a callback for ImageUploadModal
* chore: lint and test updates
* chore: clean up propType warning
Co-authored-by: connorhaugh <chaugh21@amherst.edu>
* chore: add brand mocking in gallery view
* feat: dev gallery app
* chore: link mock block ids to real block type api
* feat: image settings page features
* chore: more tests
* chore: keystore util and more testing
* chore: more tests
* chore: re-install lint plugin...
* chore: lint fixes
* chore: moar tests
* chore: remove brand from module.config and link gallery to edx.org brand
* feat: devgallery api mode
* feat: dev gallery app
* chore: link mock block ids to real block type api
* feat: image settings page features
* fix: update tests
* fix: console message cleanup
* fix: test fixes from code walkthrough with ray
This work adds the functionality that when an image is selected ineither the select image step of the image upload modal, or by using the toolbar inside tinymce, the requisite image is loaded into the settings page, and on the click of the save button, it is inserted into tinymce html.
* feat: devgallery api mode
* chore: update react version
* feat: dev gallery app
* chore: fix component tests
* chore: lint fixes
* chore: link mock block ids to real block type api
This is the Course Authoring micro-frontend, currently under development by `2U <https://2u.com>`_.
This implements most of the frontend for **Open edX Studio**, allowing authors to create and edit courses, libraries, and their learning components.
Its purpose is to provide both a framework and UI for new or replacement React-based authoring features outside ``edx-platform``. You can find the current set described below.
A few parts of Studio still default to the `"legacy" pages defined in edx-platform <https://github.com/openedx/edx-platform/tree/master/cms>`_, but those are rapidly being deprecated and replaced with the React- and Paragon-based pages defined here.
Getting Started
@@ -18,51 +18,87 @@ Getting Started
Prerequisites
=============
The `devstack`_ is currently recommended as a development environment for your
new MFE. If you start it with ``make dev.up.lms`` that should give you
everything you need as a companion to this frontend.
Note that it is also possible to use `Tutor`_ to develop an MFE. You can refer
to the `relevant tutor-mfe documentation`_ to get started using it.
.._Devstack: https://github.com/openedx/devstack
`Tutor`_ is currently recommended as a development environment for the Authoring
MFE. Most likely, it already has this MFE configured; however, you'll need to
make some changes in order to run it in development mode. You can refer
to the `relevant tutor-mfe documentation`_ for details, or follow the quick
All features that integrate into the edx-platform CMS require that the ``COURSE_AUTHORING_MICROFRONTEND_URL`` Django setting is set in the CMS environment and points to this MFE's deployment URL. This should be done automatically if you are using devstack or tutor-mfe.
5. Start Tutor in development mode. This command will start the LMS and Studio,
and other required MFEs like ``authn`` and ``account``, but will not start
the Authoring MFE, which we're going to run on the host instead of in a
container managed by Tutor. Run:
``npm start``
..code-block::bash
tutor dev start lms cms mfe
The dev server is running at `http://localhost:2001 <http://localhost:2001>`_.
or whatever port you setup.
Startup
=======
1. Install npm dependencies:
..code-block::bash
cd frontend-app-authoring && npm ci
2. Start the dev server:
..code-block::bash
npm run dev
Then you can access the app at http://apps.local.openedx.io:2001/course-authoring/home
Troubleshooting
---------------
* If you see an "Invalid Host header" error, then you're probably using a different domain name for your devstack such as
``local.edly.io`` or ``local.overhang.io`` (not the new recommended default, ``local.openedx.io``). In that case, run
these commands to update your devstack's domain names:
..code-block::bash
tutor dev stop
tutor config save --set LMS_HOST=local.openedx.io --set CMS_HOST=studio.local.openedx.io
tutor dev launch -I --skip-build
tutor dev stop authoring # We will run this MFE on the host
* If tutor-mfe is not starting the authoring MFE in development mode (eg. `tutor dev start authoring` fails), it may be due to
using a tutor version that expects the MFE name to be frontend-app-course-authoring (the previous name of this repo). To fix
this, you can rename the cloned repo directory to frontend-app-course-authoring. More information can be found in
[this forum post](https://discuss.openedx.org/t/repo-rename-frontend-app-course-authoring-frontend-app-authoring/13930/2)
Features
@@ -140,22 +176,11 @@ Requirements
*``new_core_editors.use_new_video_editor``: must be enabled for the new Video Xblock editor to be used in Studio
*``new_core_editors.use_new_problem_editor``: must be enabled for the new Problem Xblock editor to be used in Studio
Configuration
-------------
In additional to the standard settings, the following local configuration item is required:
*``ENABLE_NEW_EDITOR_PAGES``: must be enabled in order to actually present the new XBlock editors (on by default)
Feature Description
-------------------
When a corresponding waffle flag is set, upon editing a block in Studio, the view is rendered by this MFE instead of by the XBlock's authoring view. The user remains in Studio.
..note::
The new editors themselves are currently implemented in a repository outside ``openedx``: `frontend-lib-content-components <https://github.com/edx/frontend-lib-content-components/>`_, a dependency of this MFE. This repository is slated to be moved to the ``openedx`` org, however.
Feature: New Proctoring Exams View
==================================
@@ -267,9 +292,26 @@ Configuration
In additional to the standard settings, the following local configuration items are required:
*``ENABLE_TAGGING_TAXONOMY_PAGES``: must be enabled in order to actually present the new Tagging/Taxonomy pages.
*``ENABLE_TAGGING_TAXONOMY_PAGES``: must be enabled (which it is by default) in order to actually enable/show the new
Tagging/Taxonomy functionality.
Feature: Libraries V2/Legacy Tabs
=================================
Configuration
-------------
In additional to the standard settings, the following local configurations can be set to switch between different library modes:
*``MEILISEARCH_ENABLED``: Studio setting which is enabled when the `meilisearch plugin`_ is installed.
*``edx-platform`` Waffle flags:
*``contentstore.new_studio_mfe.disable_legacy_libraries``: this feature flag must be OFF to show legacy Libraries V1
*``contentstore.new_studio_mfe.disable_new_libraries``: this feature flag must be OFF to show Content Libraries V2
***Permissions enabled** (which returns the boolean flag value): ``/api/course_roles/v1/user_permissions/enabled/``
The basic scaffolding for *fetching* and *storing* the permissions is located in the ``src/generic/data`` folder:
*``api.js``: Exposes the ``getUserPermissions(courseId)`` and ``getUserPermissionsEnabledFlag()`` methods.
*``selectors.js``: Exposes the selectors ``getUserPermissions`` and ``getUserPermissionsEnabled`` to be used by ``useSelector()``.
*``slice.js``: Exposes the ``updateUserPermissions`` and ``updateUserPermissionsEnabled`` methods that will be used by the ``thunks.js`` file for dispatching and storing.
*``thunks.js``: Exposes the ``fetchUserPermissionsQuery(courseId)`` and ``fetchUserPermissionsEnabledFlag()`` methods for fetching.
In the ``src/generic/hooks.jsx`` we created a custom hook for exposing the ``checkPermission`` method, so that way we can call
this method from any page and pass the permission we want to check for the current logged in user.
In this example on the ``src/course-team/CourseTeam.jsx`` page, we use the hook for checking if the current user has the ``manage_all_users``
permission:
1. First, we import the hook (line 1).
2. Then we call the ``checkPermission`` method and assign it to a const (line 2).
3. Finally we use the const for showing or hiding a button (line 8).
defaultMessage:'We encountered a technical error while trying to save proctored exam settings. This might be a temporary issue, so please try again in a few minutes. If the problem persists, please go to the {support_link} for help.',
description:'Alert message for proctoring settings save error.',
},
'authoring.proctoring.alert.forbidden':{
id:'authoring.proctoring.alert.forbidden',
defaultMessage:'You do not have permission to edit proctored exam settings for this course. If you are a course team member and this problem persists, please go to the {support_link} for help.',
description:'Alert message for proctoring settings permission error.',
description:'Title for link to full accessibility policy.',
},
a11yBodyPageHeader:{
id:'a11yBodyPageHeader',
defaultMessage:'Individualized Accessibility Process for Course Creators',
description:'Heading for studio\'s accessibility policy page.',
},
a11yBodyIntroGraph:{
id:'a11yBodyIntroGraph',
defaultMessage:`At edX, we seek to understand and respect the unique needs and perspectives of the edX global community.
We value every course team and are committed to expanding access to all, including course team creators and authors with
disabilities. To that end, we have adopted a {communityAccessibilityLink} and this process to allow course team creators
and authors to request assistance if they are unable to develop and post content on our platform via Studio because of their
disabilities.`,
description:'Introductory paragraph outlining why we care about accessibility, and what we\'re doing about it.',
},
a11yBodyStepsHeader:{
id:'a11yBodyStepsHeader',
defaultMessage:'Course team creators and authors needing such assistance should take the following steps:',
description:'Heading for list of steps authors can take for accessibility requests.',
},
a11yBodyEdxResponse:{
id:'a11yBodyEdxResponse',
defaultMessage:`'We will communicate with you about your preferences and needs in determining the appropriate solution, although
the ultimate decision will be ours, provided that the solution is effective and timely. The factors we will consider in choosing
an accessibility solution are: effectiveness; timeliness (relative to your deadlines); ease of implementation; and ease of use for
you. We will notify you of the decision and explain the basis for our decision within 10 business days of discussing with you.`,
description:'Paragraph outlining how we will select an accessibility solution.',
},
a11yBodyEdxFollowUp:{
id:'a11yBodyEdxFollowUp',
defaultMessage:`Thereafter, we will communicate with you on a weekly basis regarding our evaluation, decision, and progress in
implementing the accessibility solution. We will notify you when implementation of your accessibility solution is complete and
will follow-up with you as may be necessary to see if the solution was effective.`,
description:'Paragraph outlining how we will follow-up with you during and after implementing an accessibility solution.',
},
a11yBodyOngoingSupport:{
id:'a11yBodyOngoingSupport',
defaultMessage:'EdX will provide ongoing technical support as needed and will address any additional issues that arise after the initial course creation.',
description:'A statement of ongoing support.',
},
a11yBodyA11yFeedback:{
id:'a11yBodyA11yFeedback',
defaultMessage:'Please direct any questions or suggestions on how to improve the accessibility of Studio to {emailElement} or use the form below. We welcome your feedback.',
description:'Contact information heading for those with accessibility issues or suggestions.',
},
a11yBodyEmailHeading:{
id:'a11yBodyEmailHeading',
defaultMessage:'Send an email to {emailElement} with the following information:',
description:'Heading for list of information required when you email us.',
},
a11yBodyNameEmail:{
id:'a11yBodyNameEmail',
defaultMessage:'your name and email address;',
description:'Your contact information.',
},
a11yBodyInstitution:{
id:'a11yBodyInstitution',
defaultMessage:'the edX member institution that you are affiliated with;',
description:'edX affiliate information.',
},
a11yBodyBarrier:{
id:'a11yBodyBarrier',
defaultMessage:'a brief description of the challenge or barrier to access that you are experiencing; and',
description:'Accessibility problem information.',
},
a11yBodyTimeConstraints:{
id:'a11yBodyTimeConstraints',
defaultMessage:'how soon you need access and for how long (e.g., a planned course start date or in connection with a course-related deadline such as a final essay).',
description:'Time contstraint information.',
},
a11yBodyReceipt:{
id:'a11yBodyReceipt',
defaultMessage:'The edX Support Team will respond to confirm receipt and forward your request to the edX Partner Manager for your institution and the edX Website Accessibility Specialist.',
description:'Paragraph outlining what steps edX will take immediately.',
},
a11yBodyExtraInfo:{
id:'a11yBodyExtraInfo',
defaultMessage:`With guidance from the Website Accessibility Specialist, edX will contact you to discuss your request and gather
additional information from you about your preferences and needs, to determine if there's a workable solution that edX is able to support.`,
description:'Paragraph outlining how and when edX will reach out to you.',
},
a11yBodyFixesListHeader:{
id:'a11yBodyFixesListHeader',
defaultMessage:'EdX will assist you promptly and thoroughly so that you are able to create content on the CMS within your time constraints. Such efforts may include, but are not limited to:',
description:'Heading for list of ways we might be able to assist.',
},
a11yBodyThirdParty:{
id:'a11yBodyThirdParty',
defaultMessage:'Purchasing a third-party tool or software for use on an individual basis to assist your use of Studio;',
description:'Buy third-party software.',
},
a11yBodyContractor:{
id:'a11yBodyContractor',
defaultMessage:'Engaging a trained independent contractor to provide real-time visual, verbal and physical assistance; or',
description:'Hire a contractor.',
},
a11yBodyCodeFix:{
id:'a11yBodyCodeFix',
defaultMessage:'Developing new code to implement a technical fix.',
description:'Loading message while form feedback is being submitted',
},
accessibilityPolicyFormSuccess:{
id:'accessibilityPolicyFormSuccess',
defaultMessage:'Thank you for contacting edX!',
description:'Simple thank you message when form submission is successful',
},
accessibilityPolicyFormSuccessDetails:{
id:'accessibilityPolicyFormSuccessDetails',
defaultMessage:'Thank you for your feedback regarding the accessibility of Studio. We typically respond within one business day ({day_start} to {day_end}, {time_start} to {time_end}).',
description:'Detailed thank you message when form submission is successful',
},
accessibilityPolicyFormValidEmail:{
id:'accessibilityPolicyFormValidEmail',
defaultMessage:'Enter a valid email address.',
description:'Error message for when an invalid email is entered into the form',
},
accessibilityPolicyFormValidMessage:{
id:'accessibilityPolicyFormValidMessage',
defaultMessage:'Enter a message.',
description:'Error message an invalid message is entered into the form',
},
accessibilityPolicyFormValidName:{
id:'accessibilityPolicyFormValidName',
defaultMessage:'Enter a name.',
description:'Error message an invalid name is entered into the form',
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.