Skip to content

Commit

Permalink
feature: add video link field to public page settings + ts sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
vid277 committed Dec 17, 2024
1 parent e3b9d8c commit e4b0b25
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
1 change: 1 addition & 0 deletions clients/ts-sdk/src/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,7 @@ export type PublicPageParameters = {
theme?: ((PublicPageTheme) | null);
type?: (string) | null;
useGroupSearch?: (boolean) | null;
videoLink?: (string) | null;
};

export type PublicPageSearchOptions = {
Expand Down
17 changes: 17 additions & 0 deletions frontends/dashboard/src/pages/dataset/PublicPageSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,23 @@ const PublicPageControls = () => {
options={Object.keys(HeroPatterns)}
/>
</div>
<div class="grow">
<div class="flex items-center gap-1">
<label class="block">Video Link</label>
<Tooltip
tooltipText="Text shown in the search box before user input"
body={<FaRegularCircleQuestion class="h-3 w-3 text-black" />}
/>
</div>
<input
placeholder="Insert video link..."
value={extraParams.videoLink || ""}
onInput={(e) => {
setExtraParams("videoLink", e.currentTarget.value);
}}
class="block w-full rounded border border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
/>
</div>
</div>
<Show when={extraParams["heroPattern"]?.heroPatternName !== "Blank"}>
<div class="flex flex-row items-center justify-start gap-4 pt-4">
Expand Down
3 changes: 3 additions & 0 deletions server/src/data/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3192,6 +3192,9 @@ impl DatasetConfigurationDTO {
brand_font_family: page_parameters_self
.brand_font_family
.or(page_parameters_curr.brand_font_family),
video_link: page_parameters_self
.video_link
.or(page_parameters_curr.video_link),
}),
},
DISABLE_ANALYTICS: self
Expand Down
2 changes: 2 additions & 0 deletions server/src/handlers/page_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ pub struct PublicPageParameters {
pub creator_linked_in_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub brand_font_family: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub video_link: Option<String>,
}

#[utoipa::path(
Expand Down
20 changes: 10 additions & 10 deletions server/src/public/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@
<main>
<div class="basic">
<div id="root" class="min-h-[36px]"></div>
{% if params.singleProductOptions and params.singleProductOptions.productName %} {% include
"product.html" %} {% endif %} {% if tabs|length > 0 %} {% include
"tabs.html" %} {% else %} {% include "search-component-code.html" %} {%
endif %}
{% if params.singleProductOptions and
params.singleProductOptions.productName %} {% include "product.html" %}
{% endif %} {% if tabs|length > 0 %} {% include "tabs.html" %} {% else
%} {% include "search-component-code.html" %} {% endif %}
</div>
</main>
{% if logged_in %}
Expand Down Expand Up @@ -375,7 +375,7 @@
strokeWidth: 2,
roughness: 3,
bowing: 3,
}
},
);

const arrowSize = 10;
Expand All @@ -387,7 +387,7 @@
{
stroke: window.paramsData.brandColor || "black",
strokeWidth: 2,
}
},
);
rc.line(
startOpenX - 5,
Expand All @@ -397,7 +397,7 @@
{
stroke: window.paramsData.brandColor || "black",
strokeWidth: 2,
}
},
);

let endRecX = 0;
Expand All @@ -418,7 +418,7 @@
strokeWidth: 2,
roughness: 3,
bowing: 3,
}
},
);

rc.line(
Expand All @@ -429,7 +429,7 @@
{
stroke: window.paramsData.brandColor || "black",
strokeWidth: 2,
}
},
);
rc.line(
startRecX - 5,
Expand All @@ -439,7 +439,7 @@
{
stroke: window.paramsData.brandColor || "black",
strokeWidth: 2,
}
},
);
}

Expand Down

0 comments on commit e4b0b25

Please sign in to comment.