-
Notifications
You must be signed in to change notification settings - Fork 64
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
BB-2886 [BD-03] [Authoring MFE] Implement forum tool selector #36
BB-2886 [BD-03] [Authoring MFE] Implement forum tool selector #36
Conversation
Thanks for the pull request, @aayushagra! I've created BLENDED-550 to keep track of it in Jira. When this pull request is ready, tag your edX technical lead. |
@aayushagra Could you add the [BD-03] tag to the title of this ticket, and make this a draft PR/ mark it as WIP. |
src/forum-tool-selector-settings/forumToolSelectorSettings.scss
Outdated
Show resolved
Hide resolved
src/forum-tool-selector-settings/forumToolSelectorSettings.scss
Outdated
Show resolved
Hide resolved
src/forum-tool-selector-settings/forumToolSelectorSettings.scss
Outdated
Show resolved
Hide resolved
src/forum-tool-selector-settings/forumToolSelectorSettings.scss
Outdated
Show resolved
Hide resolved
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 needs a lot of changes and restructuring. I've left some comments that should guide you along the way.
src/forum-tool-selector-settings/ForumToolSelectorSettings/ForumToolSelectorContainer.jsx
Outdated
Show resolved
Hide resolved
src/forum-tool-selector-settings/ForumToolSelectorSettings/ForumToolSelectorContainer.jsx
Outdated
Show resolved
Hide resolved
src/forum-tool-selector-settings/ForumToolSelectorSettings/ForumToolSelectorContainer.jsx
Outdated
Show resolved
Hide resolved
src/forum-tool-selector-settings/ForumToolSelectorSettings/ForumToolSelectorContainer.jsx
Outdated
Show resolved
Hide resolved
function chunk(arr, len) { | ||
const chunks = []; | ||
let i = 0; | ||
const n = arr.length; | ||
while (i < n) { | ||
chunks.push(arr.slice(i, i += len)); | ||
} | ||
return chunks; | ||
} |
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.
@xitij2000 Should this be moved elsewhere?
Lodash also has a chunk() function and lodash is already used by edx-platform so we can also use it here (Although it'll need to be added to package.json explicitly even though it's already installed otherwise the linter complains)
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.
I don't know why you need this at all? This is simply not part of the design? The view isn't paginated.
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.
@xitij2000 Because we can only fit 3 in a row. If there's more than 3 entries we need this to render the three cards + the features table below those three cards. Unless I've got the UI wrong for how to handle more than 3 cards?
Right now it's 3 cards, table for those 3 cards, then 3 more cards and their table etc
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.
You can handle that using scroll snaps as I mentioned in my ticket description: https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-type
You don't need javascript for this.
function chunk(arr, len) { | ||
const chunks = []; | ||
let i = 0; | ||
const n = arr.length; | ||
while (i < n) { | ||
chunks.push(arr.slice(i, i += len)); | ||
} | ||
return chunks; | ||
} |
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.
I don't know why you need this at all? This is simply not part of the design? The view isn't paginated.
src/forum-tool-selector-settings/features-table/FeaturesTable.jsx
Outdated
Show resolved
Hide resolved
src/forum-tool-selector-settings/features-table/FeaturesTable.jsx
Outdated
Show resolved
Hide resolved
src/forum-tool-selector-settings/features-table/FeaturesTable.jsx
Outdated
Show resolved
Hide resolved
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.
I think there are still a lot of adjustments that can be made to get this closer to the mockup. I've suggested some.
const [selectedForumId, setSelectedForumId] = useState(null); | ||
|
||
const onSelectForum = (forumId) => { | ||
setSelectedForumId(forumId); | ||
}; | ||
|
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.
Note: this will be replaced with redux state later.
...ssion-tool-selector/discussion-tool-selector/discussion-tool-option/DiscussionToolOption.jsx
Outdated
Show resolved
Hide resolved
...ssion-tool-selector/discussion-tool-selector/discussion-tool-option/DiscussionToolOption.jsx
Outdated
Show resolved
Hide resolved
...ssion-tool-selector/discussion-tool-selector/discussion-tool-option/DiscussionToolOption.jsx
Outdated
Show resolved
Hide resolved
src/discussion-tool-selector/discussion-tool-selector/features-table/FeaturesTable.jsx
Outdated
Show resolved
Hide resolved
<tr> | ||
<th> </th> | ||
{forums.map(forum => ( | ||
<th className="text-center p-2" key={forum.forumId}>{forum.forumId}</th> |
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.
<th className="text-center p-2" key={forum.forumId}>{forum.forumId}</th> | |
<th className="text-center p-2" key={forum.forumId}><h5>{forum.forumId}</h5></th> |
src/discussion-tool-selector/discussion-tool-selector/features-table/FeaturesTable.jsx
Outdated
Show resolved
Hide resolved
src/discussion-tool-selector/discussion-tool-selector/features-table/FeaturesTable.jsx
Outdated
Show resolved
Hide resolved
src/discussion-tool-selector/discussion-tool-selector/features-table/FeaturesTable.jsx
Outdated
Show resolved
Hide resolved
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.
👍 I have a final few suggestions.
- I tested this: tested on devstack. Checked that it matches the mockups, and forms the basis for upcoming work.
- I read through the code
- I checked for accessibility issues
- Includes documentation
src/discussion-tool-selector/discussion-tool-selector/features-table/FeaturesTable.jsx
Show resolved
Hide resolved
@aayushagra Please squash your commits down to one, and add UI screenshots to the ticket description. @stvstnfrd This PR is adding components for the forum selector UI. |
334b98d
to
63d1312
Compare
@xitij2000 I have squashed the commits & added screenshots |
This was merged as part of #44. Woohoo! Closing. |
@natabene and @marcotuts - while this PR was "rejected" cause I closed it, the code was actually accepted and merged via a different PR which I rebased this on. I don't know if we want to account for this in our records on OSPRs, but I thought I'd mention it since it's not the first time this has happened. I want to make sure credit is given where credit is due. :) |
@davidjoy Thanks for calling out, I defer to @marcotuts . |
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
* feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local> feat: Course outline Status Bar (openedx#50) * feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: add checklist * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents * feat: [2u-259] add api, enable modal * feat: [2u-259] add tests * feat: [2u-259] add translates * feat: [2u-271] fix transalates * feat: [2u-281] fix isQuery pending, utils, hooks * feat: [2u-281] fix useScrollToHashElement * feat: [2u-271] fix imports --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local> feat: Course Outline Reindex (openedx#55) * feat: [2u-277] add alerts * feat: [2u-277] add translates * feat: [2u-277] fix tests * fix: [2u-277] fix slice and hook --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local> fix: Course outline tests (openedx#56) * fix: fixed course outline status bar tests * fix: fixed course outline status bar tests * fix: fixed course outline enable highlights modal tests * fix: enable modal tests fix: increase code coverage on the page
* feat: Course outline Top level page (#36) * feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local> feat: Course outline Status Bar (#50) * feat: [2u-259] add components * feat: [2u-259] fix sidebar * feat: [2u-259] add tests, fix links * feat: [2u-259] fix messages * feat: [2u-159] fix reducer and sidebar * feat: add checklist * feat: [2u-259] fix reducer * feat: [2u-259] remove warning from selectors * feat: [2u-259] remove indents * feat: [2u-259] add api, enable modal * feat: [2u-259] add tests * feat: [2u-259] add translates * feat: [2u-271] fix transalates * feat: [2u-281] fix isQuery pending, utils, hooks * feat: [2u-281] fix useScrollToHashElement * feat: [2u-271] fix imports --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local> feat: Course Outline Reindex (#55) * feat: [2u-277] add alerts * feat: [2u-277] add translates * feat: [2u-277] fix tests * fix: [2u-277] fix slice and hook --------- Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local> fix: Course outline tests (#56) * fix: fixed course outline status bar tests * fix: fixed course outline status bar tests * fix: fixed course outline enable highlights modal tests * fix: enable modal tests fix: increase code coverage on the page * refactor: improve course outline page feat: lms live link chore: update outline link fix: course outline link refactor: remove unnecessary css and rename test file refactor: remove unnecessary css from outlineSidebar test: make use of message variable instead of hardcoded text refactor: remove unnecessary h5 class test: use test id for detecting component refactor: update course outline url and some default messages --------- Co-authored-by: vladislavkeblysh <138868841+vladislavkeblysh@users.noreply.github.com>
Implement components for forum selection (See mockup: https://edx.invisionapp.com/console/share/XDXMC3XU9MR/420742421)
JIRA tickets: https://openedx.atlassian.net/browse/OSPR-4902
Dependencies: None
Screenshots:
Mockup: https://edx.invisionapp.com/console/share/XDXMC3XU9MR/420742421
Sandbox URL: TBD - sandbox is being provisioned.
Merge deadline: None
Author notes and concerns:
Reviewers