Make "all" filter more explicit
This commit is contained in:
parent
bb894a4ccd
commit
6ea37447f4
|
|
@ -3,3 +3,5 @@ export const itCheckboxDefaultIconCheckedTailwindClass =
|
||||||
|
|
||||||
export const itCheckboxDefaultIconUncheckedTailwindClass =
|
export const itCheckboxDefaultIconUncheckedTailwindClass =
|
||||||
"bg-[url(/static/icons/icon-checkbox-unchecked.svg)] hover:bg-[url(/static/icons/icon-checkbox-unchecked-hover.svg)]";
|
"bg-[url(/static/icons/icon-checkbox-unchecked.svg)] hover:bg-[url(/static/icons/icon-checkbox-unchecked-hover.svg)]";
|
||||||
|
|
||||||
|
export const COURSE_PROFILE_ALL_FILTER = "all";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { COURSE_PROFILE_ALL_FILTER } from "@/constants";
|
||||||
import LearningPathCircleListTile from "@/pages/learningPath/learningPathPage/LearningPathCircleListTile.vue";
|
import LearningPathCircleListTile from "@/pages/learningPath/learningPathPage/LearningPathCircleListTile.vue";
|
||||||
import type { LearningContentWithCompletion, TopicType } from "@/types";
|
import type { LearningContentWithCompletion, TopicType } from "@/types";
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
|
|
@ -11,7 +12,11 @@ interface Props {
|
||||||
const props = defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
|
|
||||||
const filteredCircles = computed(() => {
|
const filteredCircles = computed(() => {
|
||||||
if (props.filter === undefined || props.filter === "") {
|
if (
|
||||||
|
props.filter === undefined ||
|
||||||
|
props.filter === "" ||
|
||||||
|
props.filter === COURSE_PROFILE_ALL_FILTER
|
||||||
|
) {
|
||||||
return props.topic.circles;
|
return props.topic.circles;
|
||||||
}
|
}
|
||||||
return props.topic.circles.filter(
|
return props.topic.circles.filter(
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import type { LearningContentWithCompletion, TopicType } from "@/types";
|
import type { LearningContentWithCompletion, TopicType } from "@/types";
|
||||||
import LearningPathCircleColumn from "./LearningPathCircleColumn.vue";
|
import LearningPathCircleColumn from "./LearningPathCircleColumn.vue";
|
||||||
|
import { COURSE_PROFILE_ALL_FILTER } from "@/constants";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
topic: TopicType;
|
topic: TopicType;
|
||||||
|
|
@ -21,7 +22,11 @@ const isLastCircle = (circleIndex: number, numCircles: number) =>
|
||||||
props.isLastTopic && circleIndex === numCircles - 1;
|
props.isLastTopic && circleIndex === numCircles - 1;
|
||||||
|
|
||||||
const filteredCircles = computed(() => {
|
const filteredCircles = computed(() => {
|
||||||
if (props.filter === undefined || props.filter === "") {
|
if (
|
||||||
|
props.filter === undefined ||
|
||||||
|
props.filter === "" ||
|
||||||
|
props.filter === COURSE_PROFILE_ALL_FILTER
|
||||||
|
) {
|
||||||
return props.topic.circles;
|
return props.topic.circles;
|
||||||
}
|
}
|
||||||
return props.topic.circles.filter(
|
return props.topic.circles.filter(
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { COURSE_PROFILE_ALL_FILTER } from "@/constants";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
profiles?: string[];
|
profiles?: string[];
|
||||||
selected?: string;
|
selected?: string;
|
||||||
}
|
}
|
||||||
|
const allProfile = COURSE_PROFILE_ALL_FILTER;
|
||||||
|
|
||||||
defineProps<Props>();
|
defineProps<Props>();
|
||||||
defineEmits(["select"]);
|
defineEmits(["select"]);
|
||||||
|
|
@ -21,6 +24,8 @@ defineEmits(["select"]);
|
||||||
{{ $t(`profile.${profile}`) }}
|
{{ $t(`profile.${profile}`) }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<a class="link" @click="$emit('select', '')">Alle anzeigen (Allbranche)</a>
|
<a class="link" @click="$emit('select', allProfile)">
|
||||||
|
Alle anzeigen ({{ $t(`profile.${allProfile}`) }})
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue