abpframework / abpframework/abp
Allow to set modalClass with full namespace or as directly a function
Open
Nobody has claimed this yet.
abp-framework
enhancement
ui-mvc
- Dominant language
- C#
- Stars
- 14.4k
- Forks
- 3.7k
- Avg merge
- 15h 32m
- Merged PRs (30d)
- 106
Description
Currently, we can define a modal class as shown below:
// The modal class implementation
abp.modals.MovieCreation = function () {
this.initModal = function(modalManager, args) {
console.log('initialized the modal...');
}
};
// Modal manager instance
var newMovieModal = new abp.ModalManager({
viewUrl: '/ModalWithForm',
modalClass: 'MovieCreation'
});
We can support so that we directly pass the function to the modalClass parameter:
var newMovieModal = new abp.ModalManager({
viewUrl: '/ModalWithForm',
modalClass: function () {
this.initModal = function(modalManager, args) {
console.log('initialized the modal...');
}
};
});
or we may define the function in my.customns namespace instead of abp.modals and pass it as full form:
var newMovieModal = new abp.ModalManager({
viewUrl: '/ModalWithForm',
modalClass: `my.customns.MovieCreation`
});
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ModalManager implementation and trace how its modalClass option resolves the existing abp.modals.MovieCreation name. Check how the option is used during modal initialization, then verify that a fully qualified namespace string and a function value both initialize the modal as shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100