Skip to content

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

Merged
merged 14 commits into from
Apr 4, 2025
Merged

Conversation

chris-steele
Copy link
Contributor

#208

New

  • migration scripts added to repo

@chris-steele chris-steele marked this pull request as draft January 29, 2025 08:38
@chris-steele chris-steele marked this pull request as ready for review January 29, 2025 10:31
@chris-steele chris-steele marked this pull request as draft January 29, 2025 16:22
@chris-steele chris-steele marked this pull request as ready for review February 4, 2025 09:58
Copy link
Contributor

@joe-allen-89 joe-allen-89 left a 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.

Copy link
Contributor

@joe-allen-89 joe-allen-89 left a 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 👍

@oliverfoster
Copy link
Member

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 _type: "menu"|"course" and _component === undefined|"boxMenu".

@chris-steele chris-steele self-assigned this Mar 31, 2025
@chris-steele chris-steele moved this from Needs Reviewing to Assigned in adapt_framework: The TODO Board Mar 31, 2025
@chris-steele chris-steele moved this from Assigned to Needs Reviewing in adapt_framework: The TODO Board Mar 31, 2025
Copy link
Contributor

@joe-allen-89 joe-allen-89 left a 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
Comment on lines 14 to 21

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;
});
Copy link
Member

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?

Suggested change
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;
});

@joe-allen-89 joe-allen-89 merged commit d0496d5 into master Apr 4, 2025
@joe-allen-89 joe-allen-89 deleted the issue/208 branch April 4, 2025 12:50
@github-project-automation github-project-automation bot moved this from Needs Reviewing to Recently Released in adapt_framework: The TODO Board Apr 4, 2025
github-actions bot pushed a commit that referenced this pull request Apr 4, 2025
# [7.2.0](v7.1.1...v7.2.0) (2025-04-04)

### Chore

* Add support for new issue experience (fixes #207) (#210) ([7bd6640](7bd6640)), closes [#207](#207) [#210](#210)

### New

* migration scripts added to repo (fixes #208) (#209) ([d0496d5](d0496d5)), closes [#208](#208) [#209](#209)
Copy link

github-actions bot commented Apr 4, 2025

🎉 This PR is included in version 7.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants