Skip to content

Commit 84e989b

Browse files
vid277skeptrunedev
authored andcommitted
feature: add video link field to public page settings + ts sdk
1 parent 6d1ea18 commit 84e989b

File tree

6 files changed

+83
-16
lines changed

6 files changed

+83
-16
lines changed

clients/ts-sdk/src/types.gen.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2082,6 +2082,7 @@ export type PublicPageParameters = {
20822082
type?: (string) | null;
20832083
useGroupSearch?: (boolean) | null;
20842084
zIndex?: (number) | null;
2085+
videoLink?: (string) | null;
20852086
};
20862087

20872088
export type PublicPageSearchOptions = {

frontends/dashboard/src/pages/dataset/PublicPageSettings.tsx

+17
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,23 @@ const PublicPageControls = () => {
625625
options={Object.keys(HeroPatterns)}
626626
/>
627627
</div>
628+
<div class="grow">
629+
<div class="flex items-center gap-1">
630+
<label class="block">Video Link</label>
631+
<Tooltip
632+
tooltipText="Text shown in the search box before user input"
633+
body={<FaRegularCircleQuestion class="h-3 w-3 text-black" />}
634+
/>
635+
</div>
636+
<input
637+
placeholder="Insert video link..."
638+
value={extraParams.videoLink || ""}
639+
onInput={(e) => {
640+
setExtraParams("videoLink", e.currentTarget.value);
641+
}}
642+
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"
643+
/>
644+
</div>
628645
</div>
629646
<Show when={extraParams["heroPattern"]?.heroPatternName !== "Blank"}>
630647
<div class="flex flex-row items-center justify-start gap-4 pt-4">

server/src/data/models.rs

+3
Original file line numberDiff line numberDiff line change
@@ -3198,6 +3198,9 @@ impl DatasetConfigurationDTO {
31983198
z_index: page_parameters_self
31993199
.z_index
32003200
.or(page_parameters_curr.z_index),
3201+
video_link: page_parameters_self
3202+
.video_link
3203+
.or(page_parameters_curr.video_link),
32013204
}),
32023205
},
32033206
DISABLE_ANALYTICS: self

server/src/handlers/page_handler.rs

+2
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ pub struct PublicPageParameters {
246246
pub brand_font_family: Option<String>,
247247
#[serde(skip_serializing_if = "Option::is_none")]
248248
pub z_index: Option<i32>,
249+
#[serde(skip_serializing_if = "Option::is_none")]
250+
pub video_link: Option<String>,
249251
}
250252

251253
#[utoipa::path(

server/src/public/page.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
strokeWidth: 2,
402402
roughness: 3,
403403
bowing: 3,
404-
}
404+
},
405405
);
406406

407407
const arrowSize = 10;
@@ -413,7 +413,7 @@
413413
{
414414
stroke: window.paramsData.brandColor || "black",
415415
strokeWidth: 2,
416-
}
416+
},
417417
);
418418
rc.line(
419419
startOpenX - 5,
@@ -423,7 +423,7 @@
423423
{
424424
stroke: window.paramsData.brandColor || "black",
425425
strokeWidth: 2,
426-
}
426+
},
427427
);
428428

429429
let endRecX = 0;
@@ -444,7 +444,7 @@
444444
strokeWidth: 2,
445445
roughness: 3,
446446
bowing: 3,
447-
}
447+
},
448448
);
449449

450450
rc.line(
@@ -455,7 +455,7 @@
455455
{
456456
stroke: window.paramsData.brandColor || "black",
457457
strokeWidth: 2,
458-
}
458+
},
459459
);
460460
rc.line(
461461
startRecX - 5,
@@ -465,7 +465,7 @@
465465
{
466466
stroke: window.paramsData.brandColor || "black",
467467
strokeWidth: 2,
468-
}
468+
},
469469
);
470470
}
471471

server/static/output.css

+54-10
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@ video {
571571
margin-bottom: -1rem;
572572
}
573573

574+
.mx-4 {
575+
margin-left: 1rem;
576+
margin-right: 1rem;
577+
}
578+
574579
.mx-auto {
575580
margin-left: auto;
576581
margin-right: auto;
@@ -580,10 +585,6 @@ video {
580585
margin-top: -0.5rem;
581586
}
582587

583-
.mr-4 {
584-
margin-right: 1rem;
585-
}
586-
587588
.mt-0\.5 {
588589
margin-top: 0.125rem;
589590
}
@@ -604,10 +605,6 @@ video {
604605
margin-top: 1rem;
605606
}
606607

607-
.mt-40 {
608-
margin-top: 10rem;
609-
}
610-
611608
.mt-6 {
612609
margin-top: 1.5rem;
613610
}
@@ -616,13 +613,25 @@ video {
616613
margin-top: 2rem;
617614
}
618615

616+
.mr-4 {
617+
margin-right: 1rem;
618+
}
619+
620+
.mt-40 {
621+
margin-top: 10rem;
622+
}
623+
619624
.line-clamp-1 {
620625
overflow: hidden;
621626
display: -webkit-box;
622627
-webkit-box-orient: vertical;
623628
-webkit-line-clamp: 1;
624629
}
625630

631+
.block {
632+
display: block;
633+
}
634+
626635
.flex {
627636
display: flex;
628637
}
@@ -707,6 +716,10 @@ video {
707716
cursor: not-allowed;
708717
}
709718

719+
.resize {
720+
resize: both;
721+
}
722+
710723
.flex-col {
711724
flex-direction: column;
712725
}
@@ -858,6 +871,14 @@ video {
858871
padding-left: 0.125rem;
859872
}
860873

874+
.pt-16 {
875+
padding-top: 4rem;
876+
}
877+
878+
.pr-4 {
879+
padding-right: 1rem;
880+
}
881+
861882
.text-center {
862883
text-align: center;
863884
}
@@ -934,7 +955,8 @@ video {
934955
}
935956

936957
@media (min-width: 640px) {
937-
.sm\:mr-6 {
958+
.sm\:mx-6 {
959+
margin-left: 1.5rem;
938960
margin-right: 1.5rem;
939961
}
940962

@@ -946,6 +968,10 @@ video {
946968
margin-top: 1.5rem;
947969
}
948970

971+
.sm\:mr-6 {
972+
margin-right: 1.5rem;
973+
}
974+
949975
.sm\:max-h-\[30rem\] {
950976
max-height: 30rem;
951977
}
@@ -967,6 +993,11 @@ video {
967993
column-gap: 1.5rem;
968994
}
969995

996+
.sm\:px-0 {
997+
padding-left: 0px;
998+
padding-right: 0px;
999+
}
1000+
9701001
.sm\:px-6 {
9711002
padding-left: 1.5rem;
9721003
padding-right: 1.5rem;
@@ -977,6 +1008,14 @@ video {
9771008
padding-bottom: 6rem;
9781009
}
9791010

1011+
.sm\:pt-24 {
1012+
padding-top: 6rem;
1013+
}
1014+
1015+
.sm\:pr-0 {
1016+
padding-right: 0px;
1017+
}
1018+
9801019
.sm\:text-3xl {
9811020
font-size: 1.875rem;
9821021
line-height: 2.25rem;
@@ -990,14 +1029,19 @@ video {
9901029
}
9911030

9921031
@media (min-width: 1024px) {
993-
.lg\:mr-8 {
1032+
.lg\:mx-8 {
1033+
margin-left: 2rem;
9941034
margin-right: 2rem;
9951035
}
9961036

9971037
.lg\:mt-0 {
9981038
margin-top: 0px;
9991039
}
10001040

1041+
.lg\:mr-8 {
1042+
margin-right: 2rem;
1043+
}
1044+
10011045
.lg\:flex {
10021046
display: flex;
10031047
}

0 commit comments

Comments
 (0)