Repository navigation
feat: complete subsection & unit features - #797
Conversation
|
Thanks for the pull request, @navinkarkera! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #797 +/- ##
==========================================
+ Coverage 90.30% 90.46% +0.15%
==========================================
Files 506 509 +3
Lines 8476 8859 +383
Branches 1782 1903 +121
==========================================
+ Hits 7654 8014 +360
- Misses 794 817 +23
Partials 28 28 ☔ View full report in Codecov by Sentry. |
KristinAoki
left a comment
There was a problem hiding this comment.
What waffle flags control the deletable, draggable, duplicable, and childAddable?
| {actions.allowMoveUp && ( | ||
| <Dropdown.Item | ||
| data-testid={`${namePrefix}-card-header__menu-move-up-button`} | ||
| onClick={onClickMoveUp} | ||
| > | ||
| {intl.formatMessage(messages.menuMoveUp)} | ||
| </Dropdown.Item> | ||
| )} | ||
| {actions.allowMoveDown && ( |
There was a problem hiding this comment.
For the move up and down would it be better to disable the option when they are at the top and bottom rather than removing it from the list of options. I think it is best to keep the menus consitent when moving them around.
There was a problem hiding this comment.
Will update it.
Update: Done
| SortableItem, | ||
| ErrorAlert, | ||
| } from '@edx/frontend-lib-content-components'; | ||
| import { arrayMove } from '@dnd-kit/sortable'; |
There was a problem hiding this comment.
Will this cause any dependency conflict issues with frontend-lib-content-components if the package versions do not match? Also what does arrayMove do?
There was a problem hiding this comment.
I think npm should take care of it as @dnd-kit/sortable is already part of frontend-lib-content-components.
As for arrayMove function, it handles moving an element inside an array to a new index. It is used in drag-n-drop implementation in frontend-lib-content-components.
There was a problem hiding this comment.
What is the reason for adding it here if the function is already available in frontend-lib-content-components?
There was a problem hiding this comment.
@KristinAoki Assuming that you mean adding the dependency in this repo, the linter complains if we don't explicitly add the dependency here and it makes sense as there is no guarantee that frontend-lib-content-components won't remove it in future.
@KristinAoki They are not controlled via waffle flags but this part of the API adds it. |
942b8ad to
05f8ee4
Compare
|
@KristinAoki Although, I have updated the PR, we haven't done an internal review yet so I would recommend you to wait for now. I'll ping you in a combined PR when it is ready. Apologies for the confusion. cc: @mphilbrick211 |
mavidser
left a comment
There was a problem hiding this comment.
👍 LGTM. One minor note
- I tested the move up and down behavior in sections and subsections
- I read through the code
- I checked for accessibility issues
ba9c17b to
a2ba99c
Compare
|
@mavidser Also added move menu actions to units after including commits from unit drag-n-drop implementation. |
a2ba99c to
ef1096e
Compare
|
@navinkarkera LGTM 👍 |
|
I've created issue TNL-11377 in the private 2U Jira. |
|
@KristinAoki This is ready for you. Combined all PRs implemented in last 2 weeks here. |
KristinAoki
left a comment
There was a problem hiding this comment.
As I was going through the menu options for sections, subsections, and units, I realized that the messages need to be changed in the publish modals. The headers are good, but the body of the modal are incorrect. The following changes need to be made:
- Publish all unpublished changes for this chapter? -> Publish all unpublished changes for this section?
- Publish all unpublished changes for this sequential? -> Publish all unpublished changes for this subsection?
- Publish all unpublished changes for this vertical? -> Publish all unpublished changes for this unit?
| <div className="hide-header mt-3" data-testid="advanced-tab-hours-picker-wrapper"> | ||
| <DatepickerControl | ||
| type={DATEPICKER_TYPES.time} | ||
| value={timeLimit} |
There was a problem hiding this comment.
Based on the helper text, the time limit should be able to enter a time greater than 23:59 such as 72:00
There was a problem hiding this comment.
Nice catch! Updated to use normal form autosuggest as datetime picker does not allow time greater than 24:00.
There was a problem hiding this comment.
I would just update it use Form control because the autosuggest is not necessary and crowds the modal. If we are worried about users not using the correct format for the time, we could add "HH:MM" as the placeholder for the field or set a pattern for the field.
There was a problem hiding this comment.
@KristinAoki That makes the code simpler. Added a form control with pattern validation as well as placeholder.
| subsection, | ||
| children, | ||
| index, | ||
| canMoveItem, |
There was a problem hiding this comment.
Should this be false when there are no other siblings, such as when there is only on subsection in a section? There is no where to move the element so it shouldn't have the drag handle or the move options in the menu.
There was a problem hiding this comment.
Should this be false when there are no other siblings, such as when there is only on subsection in a section?
Yes, both move up & down options are disabled.
There is no where to move the element so it shouldn't have the drag handle
Makes sense, updated 👍
| setDueDate={setDueDateState} | ||
| /> | ||
| </Tab> | ||
| <Tab eventKey="visibility" title={intl.formatMessage(messages.visibilityTabTitle)}> |
There was a problem hiding this comment.
When viewing this tab I would expect the modal to scroll instead of the entire page. The expected scroll behavior can be seen in the highlights modal
2b74f41 to
996ee5a
Compare
navinkarkera
left a comment
There was a problem hiding this comment.
@KristinAoki Addressed all your comments 👍 .
| <div className="hide-header mt-3" data-testid="advanced-tab-hours-picker-wrapper"> | ||
| <DatepickerControl | ||
| type={DATEPICKER_TYPES.time} | ||
| value={timeLimit} |
There was a problem hiding this comment.
Nice catch! Updated to use normal form autosuggest as datetime picker does not allow time greater than 24:00.
| subsection, | ||
| children, | ||
| index, | ||
| canMoveItem, |
There was a problem hiding this comment.
Should this be false when there are no other siblings, such as when there is only on subsection in a section?
Yes, both move up & down options are disabled.
There is no where to move the element so it shouldn't have the drag handle
Makes sense, updated 👍
996ee5a to
6f39842
Compare
8b5b9a8 to
e92a6dc
Compare
feat: Update tests, fix bugs in drag and drop elements chore: address review feedback
Uses action flags from API to control display of delete, duplicate, child new button and dragging. Use isHeaderVisible flag to control display of subsection headers. All these changes prepare outline for entrance exam section display. feat: use actions flags for subsections test: actions
refactor: move common styles to conditional sortable element
chore: address review feedback
test: add tests for move options refactor: disable move option instead of hiding fix: incorrect variable name in tests feat: move up & down menu action for units test: add tests for unit move options
test: add render and API tests fix: fix non saving options and add review style changes fix: remove additional tab in the section configuration fix: remove isSubsection state, fix css issues and fix tests fix: add review changes, fix advanced tab hour selection and update tests test: fix failing test in courseOutline.test.jsx fix: remove unused state, add TODO comment, fix stack rendering and NaN values feat: show previous state in autosuggest if an invalid option is provided and fix warnings test: fix failing test
fixes issues related to form autosuggest fix: hide header only for advanced tab time picker
e92a6dc to
2f6af06
Compare
|
@navinkarkera 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |

Description:
This PR combines following features and PRs:
Private-refBB-8278Private-refBB-8431Private-refBB-8421Private-refBB-8423Private-refBB-8277Private-refBB-8430feat: move up & down option
Private-refBB-8422Description:
Adds move up and down option to sections, subsections and units menu.
Screenshots:
Test instructions:
make {lms,cms}-up.npm start.Notes: Please use rebase option to merge (Do not squash, as the commits are already squashed based on the features and authors).