Merge pull request 'patches v1.3.3' (#12) from develop into main
Reviewed-on: #12
This commit is contained in:
commit
a1e57ea2f0
41 changed files with 5134 additions and 4946 deletions
|
@ -54,10 +54,10 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type Article from "../types/collection/article";
|
import type Article from "~~/types/collection/article";
|
||||||
import type Operation from "../types/collection/operation";
|
import type Operation from "~~/types/collection/operation";
|
||||||
import type Event from "../types/collection/event";
|
import type Event from "~~/types/collection/event";
|
||||||
import type Vehicle from "../types/collection/vehicle";
|
import type Vehicle from "~~/types/collection/vehicle";
|
||||||
|
|
||||||
const runtimeConfig = useRuntimeConfig();
|
const runtimeConfig = useRuntimeConfig();
|
||||||
const baseUrl = runtimeConfig.public.strapi.url;
|
const baseUrl = runtimeConfig.public.strapi.url;
|
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type ItemsHero from "../types/component/items/hero";
|
import type ItemsHero from "~~/types/component/items/hero";
|
||||||
import type { ComponentTypes } from "../types/component/baseComponent";
|
import type { ComponentTypes } from "~~/types/component/baseComponent";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
hero: { type: Object as PropType<ItemsHero>, required: false, default: null },
|
hero: { type: Object as PropType<ItemsHero>, required: false, default: null },
|
|
@ -36,8 +36,8 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type BaseCollection from "~/types/collection/baseCollection";
|
import type BaseCollection from "~~/types/collection/baseCollection";
|
||||||
import type Lookup from "../../types/collection/lookup";
|
import type Lookup from "~~/types/collection/lookup";
|
||||||
|
|
||||||
const runtimeConfig = useRuntimeConfig();
|
const runtimeConfig = useRuntimeConfig();
|
||||||
const baseUrl = runtimeConfig.public.strapi.url;
|
const baseUrl = runtimeConfig.public.strapi.url;
|
|
@ -22,8 +22,8 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type BaseCollection from "../../types/collection/baseCollection";
|
import type BaseCollection from "~~/types/collection/baseCollection";
|
||||||
import type Lookup from "../../types/collection/lookup";
|
import type Lookup from "~~/types/collection/lookup";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: Object as PropType<BaseCollection>,
|
data: Object as PropType<BaseCollection>,
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type DynamicZoneColumnImageText from "../../types/component/dynamic-zone/columnImageText";
|
import type DynamicZoneColumnImageText from "~~/types/component/dynamic-zone/columnImageText";
|
||||||
|
|
||||||
const runtimeConfig = useRuntimeConfig();
|
const runtimeConfig = useRuntimeConfig();
|
||||||
const baseUrl = runtimeConfig.public.strapi.url;
|
const baseUrl = runtimeConfig.public.strapi.url;
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type DynamicZoneDualColumnText from "../../types/component/dynamic-zone/dualColumnText";
|
import type DynamicZoneDualColumnText from "~~/types/component/dynamic-zone/dualColumnText";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
data: Object as PropType<DynamicZoneDualColumnText>,
|
data: Object as PropType<DynamicZoneDualColumnText>,
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type DynamicZoneEmbedding from "../../types/component/dynamic-zone/embedding";
|
import type DynamicZoneEmbedding from "~~/types/component/dynamic-zone/embedding";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: Object as PropType<DynamicZoneEmbedding>,
|
data: Object as PropType<DynamicZoneEmbedding>,
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type DynamicZoneFileDownload from "../../types/component/dynamic-zone/fileDownload";
|
import type DynamicZoneFileDownload from "~~/types/component/dynamic-zone/fileDownload";
|
||||||
|
|
||||||
const runtimeConfig = useRuntimeConfig();
|
const runtimeConfig = useRuntimeConfig();
|
||||||
const baseUrl = runtimeConfig.public.strapi.url;
|
const baseUrl = runtimeConfig.public.strapi.url;
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type DynamicZoneFileViewer from "../../types/component/dynamic-zone/fileViewer";
|
import type DynamicZoneFileViewer from "~~/types/component/dynamic-zone/fileViewer";
|
||||||
|
|
||||||
const runtimeConfig = useRuntimeConfig();
|
const runtimeConfig = useRuntimeConfig();
|
||||||
const baseUrl = runtimeConfig.public.strapi.url;
|
const baseUrl = runtimeConfig.public.strapi.url;
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type DynamicZoneFullImage from "../../types/component/dynamic-zone/fullImage";
|
import type DynamicZoneFullImage from "~~/types/component/dynamic-zone/fullImage";
|
||||||
|
|
||||||
const runtimeConfig = useRuntimeConfig();
|
const runtimeConfig = useRuntimeConfig();
|
||||||
const baseUrl = runtimeConfig.public.strapi.url;
|
const baseUrl = runtimeConfig.public.strapi.url;
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type DynamicZoneFullText from "../../types/component/dynamic-zone/fullText";
|
import type DynamicZoneFullText from "~~/types/component/dynamic-zone/fullText";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
data: Object as PropType<DynamicZoneFullText>,
|
data: Object as PropType<DynamicZoneFullText>,
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type DynamicZoneGallery from "../../types/component/dynamic-zone/gallery";
|
import type DynamicZoneGallery from "~~/types/component/dynamic-zone/gallery";
|
||||||
|
|
||||||
const runtimeConfig = useRuntimeConfig();
|
const runtimeConfig = useRuntimeConfig();
|
||||||
const baseUrl = runtimeConfig.public.strapi.url;
|
const baseUrl = runtimeConfig.public.strapi.url;
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type DynamicZoneSection from "../../types/component/dynamic-zone/section";
|
import type DynamicZoneSection from "~~/types/component/dynamic-zone/section";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
data: Object as PropType<DynamicZoneSection>,
|
data: Object as PropType<DynamicZoneSection>,
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type DynamicZoneSpacer from "../../types/component/dynamic-zone/spacer";
|
import type DynamicZoneSpacer from "~~/types/component/dynamic-zone/spacer";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
data: Object as PropType<DynamicZoneSpacer>,
|
data: Object as PropType<DynamicZoneSpacer>,
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type ContentField from "../../types/field/content";
|
import type ContentField from "~~/types/field/content";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
data: Object as PropType<ContentField>,
|
data: Object as PropType<ContentField>,
|
|
@ -13,7 +13,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { TextField } from "../../types/field/content";
|
import type { TextField } from "~~/types/field/content";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
data: Array<TextField>,
|
data: Array<TextField>,
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type { TypeField } from "../../types/field/content";
|
import type { TypeField } from "~~/types/field/content";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
data: Object as PropType<TypeField>,
|
data: Object as PropType<TypeField>,
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type ItemsHero from "../../types/component/items/hero";
|
import type ItemsHero from "~~/types/component/items/hero";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
data: Object as PropType<ItemsHero>,
|
data: Object as PropType<ItemsHero>,
|
|
@ -21,14 +21,14 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type SharedEmphasiseArticle from "../../types/component/shared/emphasiseArticle";
|
import type SharedEmphasiseArticle from "~~/types/component/shared/emphasiseArticle";
|
||||||
import type Lookup from "../../types/collection/lookup";
|
import type Lookup from "~~/types/collection/lookup";
|
||||||
|
|
||||||
const { find } = useStrapi();
|
const { find } = useStrapi();
|
||||||
const { data: lookup } = await useAsyncData(() =>
|
const { data: lookup } = await useAsyncData(() =>
|
||||||
find<Lookup>("collection-lookups", {
|
find<Lookup>("collection-lookups", {
|
||||||
filters: {
|
filters: {
|
||||||
collection: "articles",
|
collection: { $eq: "articles" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
|
@ -90,8 +90,8 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type SharedList from "../../types/component/shared/list";
|
import type SharedList from "~~/types/component/shared/list";
|
||||||
import type BaseCollection from "~/types/collection/baseCollection";
|
import type BaseCollection from "~~/types/collection/baseCollection";
|
||||||
|
|
||||||
interface Meta {
|
interface Meta {
|
||||||
page: number;
|
page: number;
|
||||||
|
@ -113,36 +113,46 @@ const pagination = ref<Meta>({ page: 0, pageSize: 0, pageCount: 0, total: 0 });
|
||||||
const activeYear = ref<number>(0);
|
const activeYear = ref<number>(0);
|
||||||
|
|
||||||
if (props.data?.lookup.list_with_date != "none") {
|
if (props.data?.lookup.list_with_date != "none") {
|
||||||
const { data: year } = await useAsyncData<Array<number>>(() =>
|
const { data: year } = await useAsyncData<Array<number>>(
|
||||||
$fetch(`${baseUrl}/api/custom/${props.data?.lookup.collection}/distinct-years`)
|
"range" + (props.data?.lookup.documentId ?? ""),
|
||||||
|
() => $fetch(`${baseUrl}/api/custom/${props.data?.lookup.collection}/distinct-years`),
|
||||||
|
{
|
||||||
|
watch: [() => props.data],
|
||||||
|
}
|
||||||
);
|
);
|
||||||
years.value = year.value ?? [];
|
years.value = year.value ?? [];
|
||||||
activeYear.value = years.value[0] ?? 0;
|
activeYear.value = years.value[0] ?? 0;
|
||||||
}
|
}
|
||||||
const { data: collections } = await useAsyncData(() =>
|
const { data: collections } = await useAsyncData(
|
||||||
find<BaseCollection>(props.data?.lookup.collection ?? "", {
|
props.data?.lookup.documentId ?? "",
|
||||||
...(props.data?.lookup?.list_with_date != "none"
|
() =>
|
||||||
? {
|
find<BaseCollection>(props.data?.lookup.collection ?? "", {
|
||||||
sort: "date:desc",
|
...(props.data?.lookup?.list_with_date != "none"
|
||||||
filters: {
|
? {
|
||||||
date: {
|
sort: "date:desc",
|
||||||
$between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`],
|
filters: {
|
||||||
|
date: {
|
||||||
|
//@ts-ignore
|
||||||
|
$between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
pagination: {
|
||||||
pagination: {
|
page: 1,
|
||||||
page: 1,
|
pageSize: 10,
|
||||||
pageSize: 10,
|
withCount: true,
|
||||||
withCount: true,
|
},
|
||||||
},
|
}
|
||||||
}
|
: {
|
||||||
: {
|
pagination: {
|
||||||
pagination: {
|
page: 1,
|
||||||
page: 1,
|
pageSize: 10,
|
||||||
pageSize: 10,
|
withCount: true,
|
||||||
withCount: true,
|
},
|
||||||
},
|
}),
|
||||||
}),
|
}),
|
||||||
})
|
{
|
||||||
|
watch: [() => props.data],
|
||||||
|
}
|
||||||
);
|
);
|
||||||
collection.value = collections.value?.data;
|
collection.value = collections.value?.data;
|
||||||
pagination.value = (collections.value?.meta.pagination as unknown as {
|
pagination.value = (collections.value?.meta.pagination as unknown as {
|
||||||
|
@ -226,6 +236,7 @@ async function changeTimedData(year: number) {
|
||||||
sort: "date:desc",
|
sort: "date:desc",
|
||||||
filters: {
|
filters: {
|
||||||
date: {
|
date: {
|
||||||
|
// @ts-ignore
|
||||||
$between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`],
|
$between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -254,6 +265,7 @@ async function changeTimedPage(page: number = 1) {
|
||||||
sort: "date:desc",
|
sort: "date:desc",
|
||||||
filters: {
|
filters: {
|
||||||
date: {
|
date: {
|
||||||
|
// @ts-ignore
|
||||||
$between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`],
|
$between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`],
|
||||||
},
|
},
|
||||||
},
|
},
|
|
@ -1,8 +1,8 @@
|
||||||
import type BaseFile from "../types/component/baseFile";
|
import type BaseFile from "~~/types/component/baseFile";
|
||||||
import type Footer from "../types/component/global/footer";
|
import type Footer from "~~/types/component/global/footer";
|
||||||
import type Navbar from "../types/component/global/navbar";
|
import type Navbar from "~~/types/component/global/navbar";
|
||||||
import type SEO from "../types/component/global/seo";
|
import type SEO from "~~/types/component/global/seo";
|
||||||
import type Global from "../types/single/global";
|
import type Global from "~~/types/single/global";
|
||||||
|
|
||||||
export const useGlobal = () => {
|
export const useGlobal = () => {
|
||||||
const global = useState<Global | null>("global");
|
const global = useState<Global | null>("global");
|
|
@ -1,5 +1,5 @@
|
||||||
import type Page from "../types/collection/page";
|
import type Page from "~~/types/collection/page";
|
||||||
import type { ComponentTypes } from "../types/component/baseComponent";
|
import type { ComponentTypes } from "~~/types/component/baseComponent";
|
||||||
|
|
||||||
export const useSitemap = () => {
|
export const useSitemap = () => {
|
||||||
const { navbar, footer } = useGlobal();
|
const { navbar, footer } = useGlobal();
|
|
@ -22,7 +22,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type Homepage from "../types/single/homepage";
|
import type Homepage from "~~/types/single/homepage";
|
||||||
|
|
||||||
const runtimeConfig = useRuntimeConfig();
|
const runtimeConfig = useRuntimeConfig();
|
||||||
const baseUrl = runtimeConfig.public.strapi.url;
|
const baseUrl = runtimeConfig.public.strapi.url;
|
|
@ -7,11 +7,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type Article from "../types/collection/article";
|
import type Article from "~~/types/collection/article";
|
||||||
import type Event from "../types/collection/event";
|
import type Event from "~~/types/collection/event";
|
||||||
import type Operation from "../types/collection/operation";
|
import type Operation from "~~/types/collection/operation";
|
||||||
import type Vehicle from "../types/collection/vehicle";
|
import type Vehicle from "~~/types/collection/vehicle";
|
||||||
import type Page from "../types/collection/page";
|
import type Page from "~~/types/collection/page";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
params: { slug: params },
|
params: { slug: params },
|
||||||
|
@ -33,10 +33,14 @@ const similarestPage = computed(() => {
|
||||||
(bestMatch, current) => {
|
(bestMatch, current) => {
|
||||||
const currentMatchLength = current.path
|
const currentMatchLength = current.path
|
||||||
.split("/")
|
.split("/")
|
||||||
.filter((segment, index) => segment != "" && segment == activePath.value.split("/")[index]).length;
|
.filter(
|
||||||
|
(segment, index) => segment != "" && segment.trim() == activePath.value.split("/")[index]?.trim()
|
||||||
|
).length;
|
||||||
const bestMatchLength = bestMatch.path
|
const bestMatchLength = bestMatch.path
|
||||||
.split("/")
|
.split("/")
|
||||||
.filter((segment, index) => segment != "" && segment == activePath.value.split("/")[index]).length;
|
.filter(
|
||||||
|
(segment, index) => segment != "" && segment.trim() == activePath.value.split("/")[index]?.trim()
|
||||||
|
).length;
|
||||||
|
|
||||||
if (currentMatchLength > bestMatchLength) {
|
if (currentMatchLength > bestMatchLength) {
|
||||||
return current;
|
return current;
|
||||||
|
@ -49,10 +53,10 @@ const similarestPage = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: pages } = await useAsyncData(
|
const { data: pages } = await useAsyncData(
|
||||||
|
activePath,
|
||||||
() =>
|
() =>
|
||||||
findOne<Page | Array<Page>>("pages", similarestPage.value?.document, {
|
findOne<Page | Array<Page>>("pages", similarestPage.value?.document, {
|
||||||
populate: {
|
populate: {
|
||||||
populate: "*",
|
|
||||||
content: {
|
content: {
|
||||||
populate: "*",
|
populate: "*",
|
||||||
},
|
},
|
||||||
|
@ -60,14 +64,16 @@ const { data: pages } = await useAsyncData(
|
||||||
populate: "*",
|
populate: "*",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
filters: {
|
filters: !similarestPage.value?.document
|
||||||
...(!similarestPage.value?.document
|
? {
|
||||||
? { slug: Array.isArray(params) ? params.join("~") : params, ref_only_access: false }
|
slug: { $eq: Array.isArray(params) ? params.join("~") : params ?? "" },
|
||||||
: {}),
|
ref_only_access: { $eq: false },
|
||||||
},
|
}
|
||||||
|
: {},
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
default: () => null,
|
default: () => null,
|
||||||
|
watch: [activePath],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const page = computed(() => {
|
const page = computed(() => {
|
||||||
|
@ -83,13 +89,13 @@ const notFound = computed(() => {
|
||||||
else
|
else
|
||||||
return (
|
return (
|
||||||
!page.value ||
|
!page.value ||
|
||||||
(page.value && !(page.value.content.length != 0 || (page.value.hero.title && page.value.hero.banner)))
|
(page.value && !(page.value.content.length != 0 || page.value.hero.title || page.value.hero.banner))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const showContentBuilder = computed(() => {
|
const showContentBuilder = computed(() => {
|
||||||
if (isCollectionDetail.value && detail.value) return !detail.value;
|
if (isCollectionDetail.value && detail.value) return !detail.value;
|
||||||
else return page.value && (page.value.content.length != 0 || (page.value.hero.title && page.value.hero.banner));
|
else return page.value && (page.value.content.length != 0 || page.value.hero.title || page.value.hero.banner);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isCollectionDetail) {
|
if (isCollectionDetail) {
|
||||||
|
@ -103,13 +109,21 @@ if (isCollectionDetail) {
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const element of collectionOfDetail) {
|
for (const element of collectionOfDetail) {
|
||||||
const { data: details } = await useAsyncData(() =>
|
const detailKey = `detail-${element}-${activePath.value.substring(activePath.value.lastIndexOf("/") + 1)}`;
|
||||||
find<Article | Operation | Event | Vehicle>(element ?? "", {
|
const { data: details } = await useAsyncData(
|
||||||
populate: "*",
|
detailKey,
|
||||||
filters: {
|
() =>
|
||||||
slug: activePath.value.substring(activePath.value.lastIndexOf("/") + 1),
|
find<Article | Operation | Event | Vehicle>(element ?? "", {
|
||||||
},
|
populate: "*",
|
||||||
})
|
filters: {
|
||||||
|
slug: {
|
||||||
|
$eq: activePath.value.substring(activePath.value.lastIndexOf("/") + 1),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
watch: [activePath],
|
||||||
|
}
|
||||||
);
|
);
|
||||||
if (details.value?.data[0]) {
|
if (details.value?.data[0]) {
|
||||||
detail.value = details.value?.data[0];
|
detail.value = details.value?.data[0];
|
|
@ -5,7 +5,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type Homepage from "../types/single/homepage";
|
import type Homepage from "~~/types/single/homepage";
|
||||||
|
|
||||||
const { findOne } = useStrapi();
|
const { findOne } = useStrapi();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type Global from "../types/single/global";
|
import type Global from "~~/types/single/global";
|
||||||
|
|
||||||
export default defineNuxtPlugin(async (nuxtApp) => {
|
export default defineNuxtPlugin(async (nuxtApp) => {
|
||||||
const globalState = useState<Global | null>("global", () => null);
|
const globalState = useState<Global | null>("global", () => null);
|
|
@ -1,17 +1,25 @@
|
||||||
import type Page from "../types/collection/page";
|
import type Page from "~~/types/collection/page";
|
||||||
import type Global from "../types/single/global";
|
import type Global from "~~/types/single/global";
|
||||||
|
|
||||||
export default defineNuxtPlugin(async (nuxtApp) => {
|
export default defineNuxtPlugin(async (nuxtApp) => {
|
||||||
const pageState = useState<Page[]>("sitemap_pages", () => []);
|
const pageState = useState<Page[]>("sitemap_pages", () => []);
|
||||||
|
|
||||||
if (!pageState.value) {
|
if (pageState.value.length == 0) {
|
||||||
const { find } = useStrapi();
|
const { find } = useStrapi();
|
||||||
const { data: page_res } = await useAsyncData(
|
const { data: page_res } = await useAsyncData(
|
||||||
"sitemap_pages",
|
"sitemap_pages",
|
||||||
() =>
|
() =>
|
||||||
find<Page>("pages", {
|
find<Page>("pages", {
|
||||||
filters: {
|
filters: {
|
||||||
ref_only_access: false,
|
//@ts-ignore
|
||||||
|
$or: [
|
||||||
|
{
|
||||||
|
ref_only_access: { $eq: false },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ref_only_access: { $null: true },
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
{
|
{
|
|
@ -18,6 +18,8 @@ export default defineNuxtConfig({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ssr: true,
|
||||||
|
|
||||||
css: ["~/assets/app.css", "~/assets/ConthraxSemiBold.css"],
|
css: ["~/assets/app.css", "~/assets/ConthraxSemiBold.css"],
|
||||||
|
|
||||||
compatibilityDate: "2024-04-03",
|
compatibilityDate: "2024-04-03",
|
||||||
|
|
9853
package-lock.json
generated
9853
package-lock.json
generated
File diff suppressed because it is too large
Load diff
10
package.json
10
package.json
|
@ -12,14 +12,14 @@
|
||||||
"postinstall": "nuxt prepare"
|
"postinstall": "nuxt prepare"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/image": "^1.8.1",
|
"@nuxt/image": "^1.10.0",
|
||||||
"@nuxtjs/strapi": "^2.0.0",
|
"@nuxtjs/strapi": "^2.1.1",
|
||||||
"@tailwindcss/vite": "^4.1.4",
|
"@tailwindcss/vite": "^4.1.11",
|
||||||
"nuxt": "^3.16.2",
|
"nuxt": "^4.0.1",
|
||||||
"vue": "latest",
|
"vue": "latest",
|
||||||
"vue-router": "latest"
|
"vue-router": "latest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"tailwindcss": "^4.1.4"
|
"tailwindcss": "^4.1.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,5 +12,6 @@ export default interface Page {
|
||||||
slug: string;
|
slug: string;
|
||||||
hero: ItemsHero;
|
hero: ItemsHero;
|
||||||
content: Array<ComponentTypes>;
|
content: Array<ComponentTypes>;
|
||||||
|
ref_only_access: boolean;
|
||||||
localizations: any[];
|
localizations: any[];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue