-
Notifications
You must be signed in to change notification settings - Fork 30
New: migration scripts added to repo (fixes #208) #209
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
Conversation
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.
A couple of changes for using the new helpers, and a couple of queries on best practice but all looking good.
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.
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 |
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.
All running through nicely 👍
migrations/v6.js
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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