@@ -78,10 +78,8 @@ 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") && 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,
+ minute: props.data?.date.includes("T") ? ("2-digit" as const) : undefined,
+ hour: props.data?.date.includes("T") ? ("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 bcd6c89..2be7a84 100644
--- a/components/base/ListItem.vue
+++ b/components/base/ListItem.vue
@@ -10,7 +10,7 @@
{{ data?.title }}
-
+
{{ itemDate }}
@@ -59,10 +59,8 @@ 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") && 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,
+ minute: props.data?.date.includes("T") ? ("2-digit" as const) : undefined,
+ hour: props.data?.date.includes("T") ? ("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 a2b35a2..a2a620b 100644
--- a/components/dynamicZone/FileDownload.vue
+++ b/components/dynamicZone/FileDownload.vue
@@ -1,21 +1,12 @@
-
-
-
+
@@ -27,15 +18,7 @@ import type DynamicZoneFileDownload from "../../types/component/dynamic-zone/fil
const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url;
-const props = defineProps({
+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
new file mode 100644
index 0000000..3f4813b
--- /dev/null
+++ b/components/dynamicZone/FileViewer.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
diff --git a/pages/[...slug].vue b/pages/[...slug].vue
index 68a631b..f92caad 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] } : {}),
+ ...(active_page_id.value == "" ? { slug: params[0], ref_only_access: true } : {}),
},
})
);
diff --git a/types/component/baseComponent.ts b/types/component/baseComponent.ts
index f0d1395..ecae36c 100644
--- a/types/component/baseComponent.ts
+++ b/types/component/baseComponent.ts
@@ -9,6 +9,7 @@ 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;
@@ -25,6 +26,7 @@ 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";
@@ -38,5 +40,6 @@ 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 9a24e46..5bd9446 100644
--- a/types/component/dynamic-zone/fileDownload.ts
+++ b/types/component/dynamic-zone/fileDownload.ts
@@ -3,6 +3,5 @@ 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
new file mode 100644
index 0000000..eb4d5c3
--- /dev/null
+++ b/types/component/dynamic-zone/fileViewer.ts
@@ -0,0 +1,7 @@
+import type BaseComponent from "../baseComponent";
+import type BaseFile from "../baseFile";
+
+export default interface DynamicZoneFileViewer extends BaseComponent {
+ __component: "dynamic-zone.file-viewer";
+ file: BaseFile;
+}