-
Notifications
You must be signed in to change notification settings - Fork 42
Support multiple instances of a module. #451
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
base: master
Are you sure you want to change the base?
Conversation
|
Hi guys, this draft should be easy to review (hopefully). Let me know whether you are happy with this, then I will add a brief documentation. |
|
Hi @fschmenger and sorry for the delay on reviewing this one. I wanted to have a time slot where I could fully think about this one and experiment a bit before replying... At first, for sure this is quite a nice addition, easy to implement and potentially useful! Here are some thinkings/ideas/remarks that came to my mind while playing with this so we can discuss it a bit further:
<template v-for="(tbButton, index) in menuButtons" :key="index">
<v-list-item class="py-0">
<component
v-bind="tbButton"
:is="tbButton.type" :key="index"
/>
</v-list-item>
</template>it should be: <template v-for="(menuButton, index) in menuButtons" :key="index">
<v-list-item class="py-0">
<component
v-bind="menuButton"
:is="menuButton.type" :key="index"
/>
</v-list-item>
</template>
Once again I wrote something way too long. The idea is just to discuss thoroughly. Thanks again for this nice idea and addition! |
…lti instantiation.
…sts (functionality is already tested inside module core implementation).
9aff4ba to
c94e592
Compare
|
Thanks for the review @sronveaux. I rebased the branch on the current master. Everything mentioned above should be addressed now (fixing the typo should be part of a different PR). |
…nit tests to avoid warnings.
…e has been slightly altered to match WguAppTemplate.spec.js, redundant assertions have been removed.
…e stock components.
|
I finalized some missing parts in the documentation and unit tests. Happy if you can give it another review but take your time! |
This PR adds a optional property
moduleTypeto the module configuration, to make it possible to instantiate the same module multiple times. This can be useful, i.e. when you have the same or similar application logic and just require different parametrization.To see an example, change the configuration of
sample-moduleinapp.conftoTo make it work, the line
moduleName="sample-module"(which was redundant and is now generically forwarded) must be removed from
SampleModule.vue:If you are using language files you must provide the title of the modules individually based on the instance name, e.g.