-
Notifications
You must be signed in to change notification settings - Fork 250
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
issue/2714 Decoupled menu, page, article, block and component #2716
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
cahirodoherty-learningpool
approved these changes
Apr 9, 2020
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.
👀
tomgreenfield
approved these changes
Apr 14, 2020
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.
👁️
tomgreenfield
approved these changes
Apr 14, 2020
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #2714
PR goes into #2713 then into #2711 then into master
Views and models no longer have hard-coded relationships, instead they are determined by the JSON. All core views and models can be replaced. Multi-menu support is now possible by simply registering the menu view with
Adapt.register('course menu boxmenu', { view: BoxMenuView })
;Added
Adapt.store
which is theAdapt.componentStore
extended to contain all content views and models not just component views and modelsAdaptModel
functions for matching type groups such as "blocks", "components", "pages" etc:getTypeGroup()
,getTypeGroups()
,isTypeGroup(typegroup)
Adapt
functions for fetching model and view classes:getViewName
,getViewClass
,getModelName
,getModelClass
AdaptModel
propertyhasManagedChildren
to signify which models automatically render and listen to their children models_model
and_view
specify the name of the registered model or view to use on instantiation. Adapt will use properties_type
,_component
,_model
and_type
,_component
,_view
in order to determine which model or view should be used respectivelyAdapt.log.warnOnce
build.js
andconfig.json
are still fixed filenames outside of the language folders).{ "_type": "" }
,{ "_component": "" }
or{ "_model": "" }
attribute on each JSON file object as this denotes the corresponding model inside the framework.{ "_type": "course" }
object.language-data-manifests
Changed
Adapt.register
name parameter can take an arrray or space separated list of namesAdapt.store
Router
usesAdapt.store
to lookupContentObject
viewsAdaptView
addChildren
usesAdapt.store
to lookup child viewsAdapt.data
is now a collection of all modelsAdapt.data.filter
is used to filter all data models throughoutAdapt.data
usesAdapt.store
to lookup modelsfindRelativeModel
so that it doesn't use hard-coded type groups and so that it returns therootModel
when requestedAdapt.parseRelativeString
so that it doesn't use hard-coded type groupsrouter:menu
if aViewClass
isn't found for themfindAncestor
,findDescendantModels
,findRelativeModel
src/core/js/data.js
to load manifest, files and become the collection for all models. It now has no references to the menu, page, article, block and component structuresrc/core/js/mpabc.js
AdaptCollection
so that it is no longer a data loader, only a container.Deprecated
AdaptModel
properties,_parent
,_children
,_siblings
Adapt.contentObjects
,Adapt.articles
,Adapt.blocks
,Adapt.components
in favour ofAdapt.data
Removed
Testing
Tested with languagePicker, works as normal.
change
events trigger fromAdapt.data
andAdapt.blocks
,Adapt.components
etc as intendedAlready merged #2645 into this pr.