Continues migration to Vue3. #794.
This commit is contained in:
parent
dd484a7c7f
commit
815329f478
|
@ -1802,7 +1802,8 @@ export default {
|
|||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
justify-content: space-between;
|
||||
:deep(.b-checkbox.checkbox) {
|
||||
:deep(.b-checkbox.checkbox),
|
||||
:deep(.b-radio.radio) {
|
||||
width: auto
|
||||
}
|
||||
.control-label {
|
||||
|
|
|
@ -222,7 +222,7 @@
|
|||
aria-modal>
|
||||
<b-loading
|
||||
v-model="isLoadingMetadatumTypes"
|
||||
:is-full-page="isFullPage" />
|
||||
:is-full-page="false" />
|
||||
<div
|
||||
|
||||
class="tainacan-modal-content">
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
v-if="!isLoading"
|
||||
class="capabilities-edit-form">
|
||||
<div>
|
||||
<template v-if="existingRoles && Object.values(existingRoles).length && capability.roles">
|
||||
<template v-if="roles && Object.values(roles).length && capability.roles">
|
||||
<b-field :addons="false">
|
||||
<label class="label is-inline">
|
||||
{{ $i18n.get('label_associated_roles') }}
|
||||
|
@ -19,7 +19,7 @@
|
|||
<br>
|
||||
<div class="roles-list">
|
||||
<template
|
||||
v-for="(role, roleIndex) of existingRoles"
|
||||
v-for="(role, roleIndex) of roles"
|
||||
:key="roleIndex">
|
||||
<b-checkbox
|
||||
v-if="!capability.roles_inherited[role.slug]"
|
||||
|
@ -39,7 +39,7 @@
|
|||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<template v-if="existingRoles && Object.values(existingRoles).length && capability.roles">
|
||||
<template v-if="roles && Object.values(roles).length && capability.roles">
|
||||
<b-field :addons="false">
|
||||
<label class="label is-inline">
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-alertcircle" />
|
||||
|
@ -53,7 +53,7 @@
|
|||
<br>
|
||||
<div class="roles-list">
|
||||
<template
|
||||
v-for="(role, roleIndex) of existingRoles"
|
||||
v-for="(role, roleIndex) of roles"
|
||||
:key="roleIndex">
|
||||
<b-checkbox
|
||||
v-if="capability.roles_inherited[role.slug]"
|
||||
|
@ -93,7 +93,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions } from 'vuex';
|
||||
import { mapActions, mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'CapabilityEditionModal',
|
||||
|
@ -106,14 +106,17 @@ export default {
|
|||
],
|
||||
data() {
|
||||
return {
|
||||
existingRoles: [],
|
||||
isLoading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
roles() {
|
||||
return this.getRoles();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.isLoading = true;
|
||||
this.fetchRoles().then((roles) => {
|
||||
this.existingRoles = roles;
|
||||
this.fetchRoles().then(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
},
|
||||
|
@ -123,6 +126,9 @@ export default {
|
|||
'addCapabilityToRole',
|
||||
'removeCapabilityFromRole'
|
||||
]),
|
||||
...mapGetters('capability', [
|
||||
'getRoles',
|
||||
]),
|
||||
updateRole(role, value) {
|
||||
if (value)
|
||||
this.addCapabilityToRole({ capabilityKey: this.capabilityKey.replace('%d', 'all'), role: role })
|
||||
|
|
|
@ -96,6 +96,20 @@ import mitt from 'mitt';
|
|||
// MODE: 3
|
||||
// })
|
||||
|
||||
function copyAppContext(src, dest) {
|
||||
// replacing _context won't work because methods of app bypasses app._context
|
||||
const { _context: srcContext } = src
|
||||
const { _context: destContext } = dest
|
||||
destContext.config = srcContext.config
|
||||
destContext.mixins = srcContext.mixins
|
||||
destContext.components = srcContext.components
|
||||
destContext.directives = srcContext.directives
|
||||
destContext.provdes = srcContext.provides
|
||||
destContext.optionsCache = srcContext.optionsCache
|
||||
destContext.propsCache = srcContext.propsCache
|
||||
destContext.emitsCache = srcContext.emitsCache
|
||||
}
|
||||
|
||||
export default (element) => {
|
||||
|
||||
function renderTainacanAdminPage() {
|
||||
|
@ -119,8 +133,10 @@ export default (element) => {
|
|||
|
||||
/* Registers Extra Vue Plugins passed to the window.tainacan_extra_plugins */
|
||||
if (typeof window.tainacan_extra_plugins != "undefined") {
|
||||
for (let [extraVuePluginName, extraVuePluginObject] of Object.entries(window.tainacan_extra_plugins))
|
||||
app.use(extraVuePluginObject);
|
||||
for (let [extraVuePluginName, extraVuePluginObject] of Object.entries(window.tainacan_extra_plugins)) {
|
||||
const aPlugin = app.use(extraVuePluginObject);
|
||||
//copyAppContext(app, aPlugin);
|
||||
}
|
||||
}
|
||||
|
||||
// Configure and Register Plugins
|
||||
|
@ -199,7 +215,8 @@ export default (element) => {
|
|||
/* Registers Extra Vue Components passed to the window.tainacan_extra_components */
|
||||
if (typeof window.tainacan_extra_components != "undefined") {
|
||||
for (let [extraVueComponentName, extraVueComponentObject] of Object.entries(window.tainacan_extra_components)) {
|
||||
app.component(extraVueComponentName, extraVueComponentObject);
|
||||
const aComponent = app.component(extraVueComponentName, extraVueComponentObject);
|
||||
//copyAppContext(app, aComponent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue