New: migration scripts added to repo (fixes #208)#209
Conversation
joe-allen-89
left a comment
There was a problem hiding this comment.
A couple of changes for using the new helpers, and a couple of queries on best practice but all looking good.
joe-allen-89
left a comment
There was a problem hiding this comment.
All running through nicely 👍
|
Boxmenu can also be applied to contentObjects as a submenu. It looks as though some of the v6 scripts only consider boxmenu as the course menu. To check if the course or contentObject is of type boxMenu, it is essential to check that |
joe-allen-89
left a comment
There was a problem hiding this comment.
All running through nicely 👍
|
|
||
| whereFromPlugin('Box menu - from v6.0.2', { name: 'adapt-contrib-boxMenu', version: '<6.1.0' }); | ||
|
|
||
| whereContent('Box menu - where menus have _menuHeader', async (content) => { | ||
| const candidates = [getCourse(), ...content.filter(({ _type, _component }) => _type === 'menu' && (!_component || _component === 'boxMenu'))]; | ||
| menusWithHeaders = candidates.filter(({ _boxMenu }) => _boxMenu?._menuHeader); | ||
| return menusWithHeaders.length; | ||
| }); |
There was a problem hiding this comment.
[getCourse(), ...content.filter(({ _type, _component }) => _type === 'menu' && (!_component || _component === 'boxMenu'))]; this is really complicated for what it does.
Maybe something a bit easier to read?
| whereFromPlugin('Box menu - from v6.0.2', { name: 'adapt-contrib-boxMenu', version: '<6.1.0' }); | |
| whereContent('Box menu - where menus have _menuHeader', async (content) => { | |
| const candidates = [getCourse(), ...content.filter(({ _type, _component }) => _type === 'menu' && (!_component || _component === 'boxMenu'))]; | |
| menusWithHeaders = candidates.filter(({ _boxMenu }) => _boxMenu?._menuHeader); | |
| return menusWithHeaders.length; | |
| }); | |
| function getBoxMenus(content) { | |
| return content.filter(({ _type, _component }) => | |
| (_type === 'menu' || _type === 'course') && | |
| (!_component || _component === 'boxMenu')) | |
| } | |
| whereFromPlugin('Box menu - from v6.0.2', { name: 'adapt-contrib-boxMenu', version: '<6.1.0' }); | |
| whereContent('Box menu - where menus have _menuHeader', async (content) => { | |
| menusWithHeaders = getBoxMenus(content).filter(({ _boxMenu }) => _boxMenu?._menuHeader); | |
| return menusWithHeaders.length; | |
| }); |
|
🎉 This PR is included in version 7.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
#208
New