@@ -78,8 +78,10 @@ const itemDate = computed(() => {
props.lookup?.list_with_date == "none" || props.lookup?.items_with_number != "none"
? ("2-digit" as const)
: undefined,
- minute: props.data?.date.includes("T") ? ("2-digit" as const) : undefined,
- hour: props.data?.date.includes("T") ? ("2-digit" as const) : undefined,
+ minute:
+ props.data?.date.includes("T") && props.lookup?.items_with_number != "none" ? ("2-digit" as const) : undefined,
+ hour:
+ props.data?.date.includes("T") && props.lookup?.items_with_number != "none" ? ("2-digit" as const) : undefined,
};
if (Object.values(config).filter((c) => c).length != 0) {
//(props.lookup?.list_with_date != "none" || props.lookup?.show_date)
diff --git a/components/base/ListItem.vue b/components/base/ListItem.vue
index 2be7a84..bcd6c89 100644
--- a/components/base/ListItem.vue
+++ b/components/base/ListItem.vue
@@ -10,7 +10,7 @@
{{ data?.title }}
-
+
{{ itemDate }}
@@ -59,8 +59,10 @@ const itemDate = computed(() => {
props.lookup?.list_with_date == "none" || props.lookup?.items_with_number != "none"
? ("2-digit" as const)
: undefined,
- minute: props.data?.date.includes("T") ? ("2-digit" as const) : undefined,
- hour: props.data?.date.includes("T") ? ("2-digit" as const) : undefined,
+ minute:
+ props.data?.date.includes("T") && props.lookup?.items_with_number != "none" ? ("2-digit" as const) : undefined,
+ hour:
+ props.data?.date.includes("T") && props.lookup?.items_with_number != "none" ? ("2-digit" as const) : undefined,
};
if (Object.values(config).filter((c) => c).length != 0) {
//(props.lookup?.list_with_date != "none" || props.lookup?.show_date)
diff --git a/components/dynamicZone/FileDownload.vue b/components/dynamicZone/FileDownload.vue
index a2a620b..a2b35a2 100644
--- a/components/dynamicZone/FileDownload.vue
+++ b/components/dynamicZone/FileDownload.vue
@@ -1,12 +1,21 @@
-
+
@@ -18,7 +27,15 @@ import type DynamicZoneFileDownload from "../../types/component/dynamic-zone/fil
const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url;
-defineProps({
+const props = defineProps({
data: Object as PropType
,
});
+
+const showComponent = computed(() => {
+ if (props.data?.file.mime == "application/pdf" || props.data?.file.mime.includes("image")) {
+ return true;
+ } else {
+ return props.data?.enable_download;
+ }
+});
diff --git a/components/dynamicZone/FileViewer.vue b/components/dynamicZone/FileViewer.vue
deleted file mode 100644
index 3f4813b..0000000
--- a/components/dynamicZone/FileViewer.vue
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/pages/[...slug].vue b/pages/[...slug].vue
index f92caad..68a631b 100644
--- a/pages/[...slug].vue
+++ b/pages/[...slug].vue
@@ -48,7 +48,7 @@ const { data: pages } = await useAsyncData("pages", () =>
},
},
filters: {
- ...(active_page_id.value == "" ? { slug: params[0], ref_only_access: true } : {}),
+ ...(active_page_id.value == "" ? { slug: params[0] } : {}),
},
})
);
diff --git a/types/component/baseComponent.ts b/types/component/baseComponent.ts
index ecae36c..f0d1395 100644
--- a/types/component/baseComponent.ts
+++ b/types/component/baseComponent.ts
@@ -9,7 +9,6 @@ import type DynamicZoneFileDownload from "./dynamic-zone/fileDownload";
import type DynamicZoneEmbedding from "./dynamic-zone/embedding";
import type DynamicZoneSection from "./dynamic-zone/section";
import type DynamicZoneSpacer from "./dynamic-zone/spacer";
-import type DynamicZoneFileViewer from "./dynamic-zone/fileViewer";
export default interface BaseComponent {
__component: ComponentNames;
@@ -26,7 +25,6 @@ export type ComponentNames =
| "dynamic-zone.full-image"
| "dynamic-zone.dual-column-text"
| "dynamic-zone.column-image-text"
- | "dynamic-zone.file-viewer"
| "dynamic-zone.file-download"
| "dynamic-zone.embedding";
@@ -40,6 +38,5 @@ export type ComponentTypes =
| DynamicZoneFullImage
| DynamicZoneDualColumnText
| DynamicZoneColumnImageText
- | DynamicZoneFileViewer
| DynamicZoneFileDownload
| DynamicZoneEmbedding;
diff --git a/types/component/dynamic-zone/fileDownload.ts b/types/component/dynamic-zone/fileDownload.ts
index 5bd9446..9a24e46 100644
--- a/types/component/dynamic-zone/fileDownload.ts
+++ b/types/component/dynamic-zone/fileDownload.ts
@@ -3,5 +3,6 @@ import type BaseFile from "../baseFile";
export default interface DynamicZoneFileDownload extends BaseComponent {
__component: "dynamic-zone.file-download";
+ enable_download: boolean;
file: BaseFile;
}
diff --git a/types/component/dynamic-zone/fileViewer.ts b/types/component/dynamic-zone/fileViewer.ts
deleted file mode 100644
index eb4d5c3..0000000
--- a/types/component/dynamic-zone/fileViewer.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type BaseComponent from "../baseComponent";
-import type BaseFile from "../baseFile";
-
-export default interface DynamicZoneFileViewer extends BaseComponent {
- __component: "dynamic-zone.file-viewer";
- file: BaseFile;
-}