Minor - fix breadcrumb

pull/4032/head
Julio 3 years ago
parent a63648913c
commit 19cb43efe5
  1. 2
      assets/vue/mixins/CreateMixin.js
  2. 6
      assets/vue/views/ccalendarevent/List.vue
  3. 8
      assets/vue/views/ctoolintro/Create.vue
  4. 28
      assets/vue/views/ctoolintro/Update.vue

@ -98,7 +98,7 @@ export default {
}, },
watch: { watch: {
created(created) { created(created) {
console.log('created'); console.log('CreateMixin.js::created');
console.log(created); console.log(created);
if (!created) { if (!created) {

@ -94,7 +94,6 @@ import {ENTRYPOINT} from "../../config/entrypoint";
import {useI18n} from "vue-i18n"; import {useI18n} from "vue-i18n";
import allLocales from '@fullcalendar/core/locales-all'; import allLocales from '@fullcalendar/core/locales-all';
import toInteger from "lodash/toInteger"; import toInteger from "lodash/toInteger";
const servicePrefix = 'CCalendarEvent'; const servicePrefix = 'CCalendarEvent';
export default { export default {
@ -140,6 +139,11 @@ export default {
const sid = toInteger(route.query.sid); const sid = toInteger(route.query.sid);
const gid = toInteger(route.query.gid); const gid = toInteger(route.query.gid);
if (cid) {
let courseIri = '/api/courses/' + cid;
store.dispatch('course/findCourse', { id: courseIri });
}
function onCreated(item) { function onCreated(item) {
//showNotification(t('Updated')); //showNotification(t('Updated'));
reFetch(); reFetch();

@ -27,6 +27,7 @@ import axios from 'axios'
import { ENTRYPOINT } from '../../config/entrypoint' import { ENTRYPOINT } from '../../config/entrypoint'
import useNotification from "../../components/Notification"; import useNotification from "../../components/Notification";
import {useI18n} from "vue-i18n"; import {useI18n} from "vue-i18n";
import toInteger from "lodash/toInteger";
const servicePrefix = 'ctoolintro'; const servicePrefix = 'ctoolintro';
const { mapFields } = createHelpers({ const { mapFields } = createHelpers({
@ -51,12 +52,19 @@ export default {
const router = useRouter(); const router = useRouter();
const {showNotification} = useNotification(); const {showNotification} = useNotification();
const { t } = useI18n(); const { t } = useI18n();
const store = useStore();
let id = route.params.id; let id = route.params.id;
if (isEmpty(id)) { if (isEmpty(id)) {
id = route.query.id; id = route.query.id;
} }
const cid = toInteger(route.query.cid);
if (cid) {
let courseIri = '/api/courses/' + cid;
store.dispatch('course/findCourse', { id: courseIri });
}
let toolId = route.params.courseTool; let toolId = route.params.courseTool;
// Get the current intro text. // Get the current intro text.

@ -2,19 +2,17 @@
<Toolbar <Toolbar
:handle-submit="onSendForm" :handle-submit="onSendForm"
/> />
<ToolIntroForm
<ToolIntroForm ref="updateForm"
ref="updateForm" v-if="item"
v-if="item" :values="item"
:values="item" :errors="violations"
:errors="violations" />
/> <Loading :visible="isLoading || deleteLoading"/>
<Loading :visible="isLoading || deleteLoading" />
</template> </template>
<script> <script>
import { mapActions, mapGetters } from 'vuex'; import {mapActions, mapGetters, useStore} from 'vuex';
import { mapFields } from 'vuex-map-fields'; import { mapFields } from 'vuex-map-fields';
import ToolIntroForm from '../../components/ctoolintro/Form.vue'; import ToolIntroForm from '../../components/ctoolintro/Form.vue';
import Loading from '../../components/Loading.vue'; import Loading from '../../components/Loading.vue';
@ -22,8 +20,9 @@ import Toolbar from '../../components/Toolbar.vue';
import UpdateMixin from '../../mixins/UpdateMixin'; import UpdateMixin from '../../mixins/UpdateMixin';
import useNotification from "../../components/Notification"; import useNotification from "../../components/Notification";
import {useI18n} from "vue-i18n"; import {useI18n} from "vue-i18n";
import {useRouter} from "vue-router"; import {useRoute, useRouter} from "vue-router";
import {watch} from "vue"; import {watch} from "vue";
import toInteger from "lodash/toInteger";
const servicePrefix = 'ctoolintro'; const servicePrefix = 'ctoolintro';
@ -40,6 +39,13 @@ export default {
const {showNotification} = useNotification(); const {showNotification} = useNotification();
const { t } = useI18n(); const { t } = useI18n();
const router = useRouter(); const router = useRouter();
const route = useRoute();
const store = useStore();
const cid = toInteger(route.query.cid);
if (cid) {
let courseIri = '/api/courses/' + cid;
store.dispatch('course/findCourse', { id: courseIri });
}
/*function updated(val) { /*function updated(val) {
showNotification(t('Updated')); showNotification(t('Updated'));

Loading…
Cancel
Save