Display: Fix ShortcutList component + add missing icon for LP categories - refs BT#22040

dependabot/npm_and_yarn/micromatch-4.0.8
Angel Fernando Quiroz Campos 1 month ago
parent be0838c440
commit 61d65b48cf
No known key found for this signature in database
GPG Key ID: B284841AE3E562CD
  1. 41
      assets/vue/components/course/ShortCutList.vue
  2. 10
      assets/vue/views/course/CourseHome.vue
  3. BIN
      public/img/tools/lp_categories.png

@ -1,34 +1,39 @@
<template>
<div class="bg-gray-100 rounded-xl p-2 shadow-md">
<div class="flex flex-col flex-center">
<div class="mx-auto">
<a :href="goToShortCut(shortcut)">
<div class="course-tool">
<BaseAppLink
:url="url"
class="course-tool__link"
>
<img
:alt="shortcut.title"
:src="`/img/tools/${shortcut.type}.png`"
class="w-32 h-32 object-contain"
class="course-tool__icon"
/>
</a>
</div>
<div class="flex flex-row gap-2 text-gray-500 pt-3">
<a>
</BaseAppLink>
<BaseAppLink
:url="url"
class="course-tool__title"
>
{{ shortcut.title }}
</a>
</div>
</div>
</BaseAppLink>
</div>
</template>
<script setup>
defineProps({
import { computed } from "vue"
import { storeToRefs } from "pinia"
import BaseAppLink from "../basecomponents/BaseAppLink.vue"
import { useCidReqStore } from "../../store/cidReq"
const cidReqStore = useCidReqStore()
const { course, session } = storeToRefs(cidReqStore)
const props = defineProps({
shortcut: {
type: Object,
required: true,
},
goToShortCut: {
type: Function,
required: true,
},
})
const url = computed(() => `${props.shortcut.url}?cid=${course.value.id}&sid=${session.value?.id || 0}`)
</script>

@ -192,7 +192,6 @@
v-for="(shortcut, index) in shortcuts"
:key="'shortcut-' + index.toString()"
:change-visibility="changeVisibility"
:go-to-short-cut="goToShortCut"
:shortcut="shortcut"
/>
</div>
@ -294,15 +293,6 @@ function goToSettingCourseTool(tool) {
return "/course/" + course.value.id + "/settings/" + tool.tool.title + "?sid=" + session.value?.id
}
function goToShortCut(shortcut) {
const url = new URLSearchParams("?")
url.append("cid", course.value.id)
url.append("sid", session.value?.id)
return shortcut.url + "?" + url
}
const setToolVisibility = (tool, visibility) => {
tool.resourceNode.resourceLinks[0].visibility = visibility
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Loading…
Cancel
Save