From 85ff2182ed6b5d108781bbd5c9e8a5b2e1fe547d Mon Sep 17 00:00:00 2001 From: kaaps Date: Tue, 5 Mar 2024 16:19:28 +0000 Subject: [PATCH 1/3] feat: project deliverable and services --- components.198185.json | 80 ++++++++++++++++++++++------- src/components/pages/project.svelte | 26 +++++----- src/lib/content.ts | 6 +-- src/lib/i18n/data.json | 3 +- src/lib/i18n/types.ts | 3 +- src/types/bloks.d.ts | 25 +++++++-- 6 files changed, 100 insertions(+), 43 deletions(-) diff --git a/components.198185.json b/components.198185.json index a69c258f..1d655d96 100644 --- a/components.198185.json +++ b/components.198185.json @@ -277,7 +277,7 @@ "name": "blog-post", "display_name": "Author", "created_at": "2023-02-15T13:03:53.849Z", - "updated_at": "2024-02-08T14:39:36.267Z", + "updated_at": "2024-03-05T15:42:48.889Z", "id": 3442347, "schema": { "cover": { @@ -347,6 +347,27 @@ "required": true, "min_options": "1", "max_options": "4" + }, + "services": { + "type": "options", + "source": "internal", + "datasource_slug": "services" + }, + "deliverables": { + "type": "options", + "source": "internal", + "datasource_slug": "deliverables" + }, + "tech": { + "type": "options", + "display_name": "", + "source": "internal", + "datasource_slug": "tech-stack" + }, + "industry": { + "type": "options", + "source": "internal", + "datasource_slug": "industry" } }, "image": "//a.storyblok.com/f/198185/x/f51edbf69b/screenshot-2023-03-22-at-11-49-53.png", @@ -2247,31 +2268,40 @@ "name": "landing-page", "display_name": null, "created_at": "2024-01-09T16:40:58.537Z", - "updated_at": "2024-01-16T10:35:21.911Z", + "updated_at": "2024-02-29T15:42:02.200Z", "id": 5142044, "schema": { + "keep_top_bar_hidden": { + "type": "boolean", + "pos": 0, + "required": false + }, "blocks": { "type": "bloks", "restrict_type": "groups", "restrict_components": true, "component_whitelist": [], - "component_group_whitelist": ["c9011224-9690-43bd-b686-e8f60ef6c7f6"] + "component_group_whitelist": ["c9011224-9690-43bd-b686-e8f60ef6c7f6"], + "pos": 1 }, "tab-577daf7c-b61e-4a23-8184-bd9c01ae0af3": { "display_name": "SEO", "keys": ["seo_title", "seo_description", "seo_og_image", "change_frequency", "priority"], - "pos": 0, + "pos": 2, "type": "tab" }, "seo_title": { - "type": "text" + "type": "text", + "pos": 3 }, "seo_description": { - "type": "text" + "type": "text", + "pos": 4 }, "seo_og_image": { "type": "asset", - "filetypes": ["images"] + "filetypes": ["images"], + "pos": 5 }, "change_frequency": { "type": "option", @@ -2313,12 +2343,14 @@ "value": "never", "name": "Never" } - ] + ], + "pos": 6 }, "priority": { "type": "number", "description": "The priority of the page relative to other pages on your site, where 0.1 is the lowest priority and 1.0 is the highest priority.\n\n1.0-0.8\nHomepage, product information, landing pages.\n\n0.7-0.4\nNews articles, some weather services, blog posts, pages that no site would be complete without.\n\n0.3-0.0\nFAQs, outdated info, old press releases, completely static pages that are still relevant enough to keep from deleting entirely.", - "decimals": 1 + "decimals": 1, + "pos": 7 } }, "image": null, @@ -2709,7 +2741,7 @@ "name": "project", "display_name": null, "created_at": "2023-02-15T13:07:44.621Z", - "updated_at": "2024-02-08T14:39:09.539Z", + "updated_at": "2024-03-05T15:29:32.672Z", "id": 3442356, "schema": { "cover": { @@ -2789,23 +2821,35 @@ "filter_content_type": ["deliverable"], "pos": 10 }, + "deliverables_data": { + "type": "options", + "pos": 11, + "source": "internal", + "datasource_slug": "deliverables" + }, "services": { "type": "textarea", "source": "internal_stories", "filter_content_type": ["service"], - "pos": 11 + "pos": 12 + }, + "services_data": { + "type": "options", + "pos": 13, + "source": "internal", + "datasource_slug": "services" }, "links": { "type": "bloks", "restrict_type": "", "restrict_components": true, "component_whitelist": ["link"], - "pos": 12 + "pos": 14 }, "tab-734adeb1-00ef-48e6-aa53-a3001ad39201": { "display_name": "Content", "keys": ["body"], - "pos": 14, + "pos": 15, "type": "tab" }, "body": { @@ -2834,27 +2878,27 @@ "blok", "h4" ], - "pos": 15 + "pos": 16 }, "tab-451d56bd-d365-4df0-8a61-2007b8b22aa9": { "display_name": "SEO", "keys": ["seo_title", "seo_description", "seo_og_image"], - "pos": 16, + "pos": 17, "type": "tab" }, "seo_title": { "type": "text", - "pos": 17 + "pos": 18 }, "seo_description": { "type": "text", - "pos": 18 + "pos": 19 }, "seo_og_image": { "type": "asset", "filetypes": ["images"], "asset_folder_id": 212286, - "pos": 19 + "pos": 20 } }, "image": null, diff --git a/src/components/pages/project.svelte b/src/components/pages/project.svelte index ea332f7b..c64bfdea 100644 --- a/src/components/pages/project.svelte +++ b/src/components/pages/project.svelte @@ -18,7 +18,7 @@ export let related: ProjectPage[]; $: next = related[related.findIndex((p) => p.id === story.id) + 1] || related[0]; - const recognitions = $page.data.awards.filter((aw) => aw.content.project.id === story.id); + $: recognitions = $page.data.awards.filter((aw) => aw.content.project.id === story.id); - {#each [{ title: t('services'), data: story.content.services }, { title: t('deliverables'), data: story.content.deliverables }, { title: t('links'), data: story.content.links }] as { title, data }} + {#each [{ title: t('services'), data: story.content.services_data }, { title: t('deliverables'), data: story.content.deliverables_data }, { title: t('links'), data: story.content.links }] as { title, data }} {#if data} {/if} {/each} diff --git a/src/lib/content.ts b/src/lib/content.ts index 80900aec..7e1c7005 100644 --- a/src/lib/content.ts +++ b/src/lib/content.ts @@ -136,11 +136,7 @@ export type BlogPostPage = ISbStoryData< project: ISbStoryData; } >; -export type ProjectPage = ISbStoryData< - Omit & { - team: ISbStoryData[]; - } ->; +export type ProjectPage = ISbStoryData; export type TeamMemberPage = ISbStoryData; export type LandingPage = ISbStoryData; diff --git a/src/lib/i18n/data.json b/src/lib/i18n/data.json index 1c4a1240..68da7659 100644 --- a/src/lib/i18n/data.json +++ b/src/lib/i18n/data.json @@ -171,5 +171,6 @@ "proposals.package.reply.manpower.title": "What is estimated manpower?", "proposals.package.reply.manpower.desc": "Manpower refers to the total capacity available for the project.", "handbook.last.updated": "Last updated", - "handbook.navigation.website": "Significa website" + "handbook.navigation.website": "Significa website", + "estimate.clear": "Clear" } diff --git a/src/lib/i18n/types.ts b/src/lib/i18n/types.ts index 987dca7c..ed609894 100644 --- a/src/lib/i18n/types.ts +++ b/src/lib/i18n/types.ts @@ -171,7 +171,8 @@ export const TranslationKeys = [ 'proposals.package.reply.manpower.title', 'proposals.package.reply.manpower.desc', 'handbook.last.updated', - 'handbook.navigation.website' + 'handbook.navigation.website', + 'estimate.clear' ] as const; export type TranslationKey = (typeof TranslationKeys)[number]; diff --git a/src/types/bloks.d.ts b/src/types/bloks.d.ts index 18779e7f..7fabb533 100644 --- a/src/types/bloks.d.ts +++ b/src/types/bloks.d.ts @@ -6,6 +6,7 @@ export type MultilinkStoryblok = cached_url?: string; anchor?: string; linktype?: 'story'; + target?: '_self' | '_blank'; story?: { name: string; created_at?: string; @@ -42,11 +43,13 @@ export type MultilinkStoryblok = cached_url?: string; anchor?: string; linktype?: 'asset' | 'url'; + target?: '_self' | '_blank'; [k: string]: any; } | { email?: string; linktype?: 'email'; + target?: '_self' | '_blank'; [k: string]: any; }; @@ -88,13 +91,20 @@ export interface AboutPageStoryblok { } export interface AssetStoryblok { - alt?: string; - copyright?: string; + _uid?: string; id: number; - filename: string; + alt?: string; name: string; - title?: string; focus?: string; + source?: string; + title?: string; + filename: string; + copyright?: string; + fieldtype?: string; + meta_data?: null | { + [k: string]: any; + }; + is_external_url?: boolean; [k: string]: any; } @@ -142,6 +152,10 @@ export interface BlogPostStoryblok { seo_og_image?: AssetStoryblok; body?: RichtextStoryblok; authors: (StoryblokStory | string)[]; + services?: (number | string)[]; + deliverables?: (number | string)[]; + tech?: (number | string)[]; + industry?: (number | string)[]; _uid: string; component: 'blog-post'; [k: string]: any; @@ -589,6 +603,7 @@ export interface ImageGridStoryblok { } export interface LandingPageStoryblok { + keep_top_bar_hidden?: boolean; blocks?: ( | ClientsStoryblok | CtaCardStoryblok @@ -712,7 +727,9 @@ export interface ProjectStoryblok { team?: (StoryblokStory | string)[]; client?: string; deliverables?: string; + deliverables_data?: (number | string)[]; services?: string; + services_data?: (number | string)[]; links?: LinkStoryblok[]; body?: RichtextStoryblok; seo_title?: string; From 36b90f7a9fd323e47da3f942f5d6fa6d550fc40d Mon Sep 17 00:00:00 2001 From: kaaps Date: Wed, 6 Mar 2024 10:28:09 +0000 Subject: [PATCH 2/3] fix: filters --- src/components/pages/projects-index.svelte | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/pages/projects-index.svelte b/src/components/pages/projects-index.svelte index 242e4114..431357c3 100644 --- a/src/components/pages/projects-index.svelte +++ b/src/components/pages/projects-index.svelte @@ -15,13 +15,13 @@ let deliverables: string[] = []; $: { projects.forEach((project) => { - project.content.services?.split('\n').forEach((item) => { - if (!services.includes(item)) { + project.content.services_data?.forEach((item) => { + if (typeof item === 'string' && !services.includes(item)) { services.push(item); } }); - project.content.deliverables?.split('\n').forEach((item) => { - if (!deliverables.includes(item)) { + project.content.deliverables_data?.forEach((item) => { + if (typeof item === 'string' && !deliverables.includes(item)) { deliverables.push(item); } }); @@ -43,10 +43,10 @@ return filters.some((f) => { if (f.type === 'service') { - return p.content.services?.includes(f.value); + return p.content.services_data?.includes(f.value); } - return p.content.deliverables?.includes(f.value); + return p.content.deliverables_data?.includes(f.value); }); }); @@ -85,6 +85,7 @@
{#each items as item} f.value === item)} on:click={() => { From 082d23b0e0d9851bb10a7a9d99fc4ad7dae134c5 Mon Sep 17 00:00:00 2001 From: kaaps Date: Wed, 6 Mar 2024 10:33:08 +0000 Subject: [PATCH 3/3] fix: change name --- components.198185.json | 79 ++++++++++++---------- src/components/pages/project.svelte | 2 +- src/components/pages/projects-index.svelte | 8 +-- src/types/bloks.d.ts | 6 +- 4 files changed, 50 insertions(+), 45 deletions(-) diff --git a/components.198185.json b/components.198185.json index 1d655d96..adda1b9f 100644 --- a/components.198185.json +++ b/components.198185.json @@ -2741,24 +2741,27 @@ "name": "project", "display_name": null, "created_at": "2023-02-15T13:07:44.621Z", - "updated_at": "2024-03-05T15:29:32.672Z", + "updated_at": "2024-03-06T10:30:35.274Z", "id": 3442356, "schema": { "cover": { "type": "asset", "filetypes": ["images"], "asset_folder_id": 212286, - "pos": 0 + "pos": 0, + "key": "cover" }, "reel": { "type": "asset", "pos": 1, - "filetypes": ["videos"] + "filetypes": ["videos"], + "key": "reel" }, "reel_button": { "type": "section", "pos": 2, - "keys": ["reel_button_theme", "reel_button_label"] + "keys": ["reel_button_theme", "reel_button_label"], + "key": "reel_button" }, "reel_button_theme": { "type": "option", @@ -2778,79 +2781,78 @@ ], "default_value": "light", "description": "", - "display_name": "Reel Button Theme (optional)" + "display_name": "Reel Button Theme (optional)", + "key": "reel_button_theme" }, "reel_button_label": { "type": "text", "pos": 4, - "display_name": "Reel Button Label (optional)" + "display_name": "Reel Button Label (optional)", + "key": "reel_button_label" }, "thumbnail": { "type": "multiasset", "filetypes": ["images"], "required": true, "asset_folder_id": 212286, - "pos": 5 + "pos": 5, + "key": "thumbnail" }, "tagline": { "type": "text", "required": true, - "pos": 6 + "pos": 6, + "key": "tagline" }, "intro": { "type": "textarea", "required": true, - "pos": 7 + "pos": 7, + "key": "intro" }, "team": { "type": "options", "source": "internal_stories", "filter_content_type": ["team-member"], - "pos": 8 + "pos": 8, + "key": "team" }, "client": { "type": "text", "use_uuid": true, "source": "internal_stories", "filter_content_type": ["client"], - "pos": 9 + "pos": 9, + "key": "client" }, "deliverables": { - "type": "textarea", - "source": "internal_stories", - "filter_content_type": ["deliverable"], - "pos": 10 - }, - "deliverables_data": { "type": "options", - "pos": 11, + "pos": 10, "source": "internal", - "datasource_slug": "deliverables" + "datasource_slug": "deliverables", + "key": "deliverables" }, "services": { - "type": "textarea", - "source": "internal_stories", - "filter_content_type": ["service"], - "pos": 12 - }, - "services_data": { "type": "options", - "pos": 13, + "pos": 11, "source": "internal", - "datasource_slug": "services" + "datasource_slug": "services", + "key": "services_data" }, "links": { "type": "bloks", "restrict_type": "", "restrict_components": true, "component_whitelist": ["link"], - "pos": 14 + "pos": 12, + "key": "links" }, "tab-734adeb1-00ef-48e6-aa53-a3001ad39201": { "display_name": "Content", "keys": ["body"], - "pos": 15, - "type": "tab" + "pos": 13, + "type": "tab", + "key": "tab-734adeb1-00ef-48e6-aa53-a3001ad39201" }, "body": { "type": "richtext", @@ -2878,27 +2880,32 @@ "blok", "h4" ], - "pos": 16 + "pos": 14, + "key": "body" }, "tab-451d56bd-d365-4df0-8a61-2007b8b22aa9": { "display_name": "SEO", "keys": ["seo_title", "seo_description", "seo_og_image"], - "pos": 17, - "type": "tab" + "pos": 15, + "type": "tab", + "key": "tab-451d56bd-d365-4df0-8a61-2007b8b22aa9" }, "seo_title": { "type": "text", - "pos": 18 + "pos": 16, + "key": "seo_title" }, "seo_description": { "type": "text", - "pos": 19 + "pos": 17, + "key": "seo_description" }, "seo_og_image": { "type": "asset", "filetypes": ["images"], "asset_folder_id": 212286, - "pos": 20 + "pos": 18, + "key": "seo_og_image" } }, "image": null, diff --git a/src/components/pages/project.svelte b/src/components/pages/project.svelte index c64bfdea..8b2568a4 100644 --- a/src/components/pages/project.svelte +++ b/src/components/pages/project.svelte @@ -71,7 +71,7 @@
- {#each [{ title: t('services'), data: story.content.services_data }, { title: t('deliverables'), data: story.content.deliverables_data }, { title: t('links'), data: story.content.links }] as { title, data }} + {#each [{ title: t('services'), data: story.content.services }, { title: t('deliverables'), data: story.content.deliverables }, { title: t('links'), data: story.content.links }] as { title, data }} {#if data}

    {title}

    diff --git a/src/components/pages/projects-index.svelte b/src/components/pages/projects-index.svelte index 431357c3..fcb4e51f 100644 --- a/src/components/pages/projects-index.svelte +++ b/src/components/pages/projects-index.svelte @@ -15,12 +15,12 @@ let deliverables: string[] = []; $: { projects.forEach((project) => { - project.content.services_data?.forEach((item) => { + project.content.services?.forEach((item) => { if (typeof item === 'string' && !services.includes(item)) { services.push(item); } }); - project.content.deliverables_data?.forEach((item) => { + project.content.deliverables?.forEach((item) => { if (typeof item === 'string' && !deliverables.includes(item)) { deliverables.push(item); } @@ -43,10 +43,10 @@ return filters.some((f) => { if (f.type === 'service') { - return p.content.services_data?.includes(f.value); + return p.content.services?.includes(f.value); } - return p.content.deliverables_data?.includes(f.value); + return p.content.deliverables?.includes(f.value); }); }); diff --git a/src/types/bloks.d.ts b/src/types/bloks.d.ts index 7fabb533..712704dc 100644 --- a/src/types/bloks.d.ts +++ b/src/types/bloks.d.ts @@ -726,10 +726,8 @@ export interface ProjectStoryblok { intro: string; team?: (StoryblokStory | string)[]; client?: string; - deliverables?: string; - deliverables_data?: (number | string)[]; - services?: string; - services_data?: (number | string)[]; + deliverables?: (number | string)[]; + services?: (number | string)[]; links?: LinkStoryblok[]; body?: RichtextStoryblok; seo_title?: string;