Merge pull request #4969 from christianbeeznest/ofaj-21046-4

Course: Fix filemanager from editor and saving intro - refs #21046
pull/4976/head
christianbeeznest 1 year ago committed by GitHub
commit dadb56159d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      assets/vue/components/ctoolintro/Form.vue
  2. 3
      assets/vue/mixins/UpdateMixin.js
  3. 5
      assets/vue/views/course/CourseHome.vue
  4. 14
      assets/vue/views/ctoolintro/Update.vue

@ -33,6 +33,7 @@
import useVuelidate from "@vuelidate/core";
import { ref } from "vue";
import { usePlatformConfig } from "../../store/platformConfig";
import {useRoute} from "vue-router";
export default {
name: "ToolIntroForm",
props: {
@ -58,7 +59,10 @@ export default {
extraPlugins.value = "translatehtml";
}
return { v$: useVuelidate(), extraPlugins };
const route = useRoute();
const parentResourceNodeId = ref(route.query.parentResourceNodeId);
return { v$: useVuelidate(), extraPlugins, parentResourceNodeId};
},
data() {
return {
@ -77,12 +81,11 @@ export default {
},
methods: {
browser(callback, value, meta) {
//const route = useRoute();
let nodeId = this.$route.params["node"];
let nodeId = this.parentResourceNodeId;
let folderParams = this.$route.query;
let url = this.$router.resolve({
name: "DocumentForHtmlEditor",
params: { id: nodeId },
params: { node: nodeId },
query: folderParams,
});
url = url.fullPath;

@ -130,7 +130,8 @@ export default {
updated(val) {
console.log('updated');
this.showMessage(`${val['@id']} updated.`);
//this.showMessage(`${val['@id']} updated.`);
this.$router.go(-1);
},
retrieved(val) {

@ -94,7 +94,7 @@
:label="t('Edit introduction')"
icon="edit"
type="black"
@click="createInSession ? addIntro(course, intro) : updateIntro(intro)"
@click="createInSession ? addIntro(course, intro) : updateIntro(course, intro)"
/>
</div>
@ -372,7 +372,7 @@ function addIntro(course, intro) {
})
}
function updateIntro(intro) {
function updateIntro(course, intro) {
return router.push({
name: "ToolIntroUpdate",
params: { id: "/api/c_tool_intros/" + intro.iid },
@ -381,6 +381,7 @@ function updateIntro(intro) {
sid: sessionId,
ctoolintroIid: intro.iid,
ctoolId: intro.c_tool.iid,
parentResourceNodeId: course.resourceNode.id,
id: "/api/c_tool_intros/" + intro.iid,
},
})

@ -49,19 +49,17 @@ export default {
let ctoolintroId = route.query.ctoolintroIid
// Get the current intro text.
axios
.get(ENTRYPOINT + "c_tool_intros/" + ctoolintroId)
axios.get(ENTRYPOINT + "c_tool_intros/" + ctoolintroId)
.then((response) => {
let data = response.data
item.value["introText"] = data.introText
let data = response.data;
item.value["introText"] = data.introText;
item.value["parentResourceNodeId"] = Number(route.query.parentResourceNodeId);
})
.catch(function (error) {
console.log(error)
})
console.error(error);
});
item.value["parentResourceNodeId"] = Number(route.query.parentResourceNodeId)
item.value["courseTool"] = "/api/c_tools/" + toolId
item.value["resourceLinkList"] = [
{
sid,

Loading…
Cancel
Save