Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+5
-1
@@ -9,6 +9,9 @@ import { useRootData } from "~/utils/data/useRootData";
|
||||
import { OnboardingBlockDto } from "./OnboardingBlockUtils";
|
||||
import { resolveOnboardingHref } from "./OnboardingLinkUtils";
|
||||
import OnboardingVariantModal from "./OnboardingVariantModal";
|
||||
import { useSaveToast } from "~/hooks/use-save-toast";
|
||||
|
||||
type OnboardingActionData = { error?: string };
|
||||
|
||||
export default function OnboardingBlock({
|
||||
session,
|
||||
@@ -22,11 +25,12 @@ export default function OnboardingBlock({
|
||||
onClose: () => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const fetcher = useFetcher();
|
||||
const fetcher = useFetcher<OnboardingActionData>();
|
||||
const navigate = useNavigate();
|
||||
const params = useParams();
|
||||
const appOrAdminData = useAppOrAdminData();
|
||||
const rootData = useRootData();
|
||||
useSaveToast(fetcher.data?.error ? { error: "onboarding.session.errors.saveFailed" } : undefined);
|
||||
|
||||
const errorModal = useRef<RefErrorModal>(null);
|
||||
|
||||
|
||||
+4
-1
@@ -44,7 +44,10 @@ export default function OnboardingBlockForm({ item, onUpdate }: { item?: Onboard
|
||||
title={t("onboarding.block.style")}
|
||||
value={state.style}
|
||||
setValue={(value) => setState({ ...state, style: value as OnboardingBlockStyle })}
|
||||
options={OnboardingBlockStyles.map((f) => f)}
|
||||
options={OnboardingBlockStyles.map((style) => ({
|
||||
value: style.value,
|
||||
name: t(`onboarding.object.types.${style.value}`),
|
||||
}))}
|
||||
/>
|
||||
|
||||
<InputSelector
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
import { Colors } from "~/application/enums/shared/Colors";
|
||||
import { t as i18nT } from "i18next";
|
||||
import { requestScopedT as i18nT } from "~/locale/request-scoped-t";
|
||||
import { OnboardingGridDto } from "./grid/OnboardingGridUtils";
|
||||
|
||||
export type OnboardingBlockDto = {
|
||||
@@ -53,7 +53,7 @@ interface OnboardingInputDto {
|
||||
options: OnboardingInputOptionDto[];
|
||||
}
|
||||
|
||||
export const OnboardingBlockStyles = [{ value: "modal", name: "Modal" }] as const;
|
||||
export const OnboardingBlockStyles = [{ value: "modal" }] as const;
|
||||
export type OnboardingBlockStyle = (typeof OnboardingBlockStyles)[number]["value"];
|
||||
|
||||
export const defaultOnboardingStepBlock: OnboardingStepBlockDto = {
|
||||
@@ -78,13 +78,13 @@ export const defaultOnboardingStepBlock: OnboardingStepBlockDto = {
|
||||
id: "",
|
||||
type: "image",
|
||||
title: i18nT("onboarding.block.defaults.gallery.image1"),
|
||||
src: "https://placehold.co/1000x600?text=Image%201",
|
||||
src: "/images/placeholder.svg",
|
||||
},
|
||||
{
|
||||
id: "",
|
||||
type: "image",
|
||||
title: i18nT("onboarding.block.defaults.gallery.image2"),
|
||||
src: "https://placehold.co/1000x600?text=Image%202",
|
||||
src: "/images/placeholder.svg",
|
||||
},
|
||||
],
|
||||
input: [
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
import { OnboardingStepBlockDto } from "../OnboardingBlockUtils";
|
||||
import { t as i18nT } from "i18next";
|
||||
import { requestScopedT as i18nT } from "~/locale/request-scoped-t";
|
||||
|
||||
export const defaultOnboardingStepBlocks: OnboardingStepBlockDto[] = [
|
||||
{
|
||||
@@ -58,15 +58,15 @@ export const defaultOnboardingStepBlocks: OnboardingStepBlockDto[] = [
|
||||
gallery: [
|
||||
{
|
||||
id: "1",
|
||||
type: "video",
|
||||
type: "image",
|
||||
title: i18nT("onboarding.block.samples.media.pageBlockBuilder"),
|
||||
src: "https://www.loom.com/embed/eccf927d35cd4ad3b4a1d512257cea53",
|
||||
src: "/images/placeholder.svg",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
type: "image",
|
||||
title: i18nT("onboarding.block.samples.media.adminPortal"),
|
||||
src: "https://placehold.co/1200x800?text=Admin+Portal",
|
||||
src: "/images/placeholder.svg",
|
||||
},
|
||||
],
|
||||
input: [],
|
||||
@@ -111,7 +111,7 @@ export const defaultOnboardingStepBlocks: OnboardingStepBlockDto[] = [
|
||||
title: i18nT("onboarding.block.samples.end.title"),
|
||||
description: "",
|
||||
links: [],
|
||||
gallery: [{ id: "1", type: "image", title: "", src: "https://www.gifcen.com/wp-content/uploads/2021/05/the-end-gif-13.gif" }],
|
||||
gallery: [{ id: "1", type: "image", title: "", src: "/images/placeholder.svg" }],
|
||||
input: [],
|
||||
icon: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6"> <path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z" /> </svg>',
|
||||
},
|
||||
|
||||
+2
@@ -15,6 +15,7 @@ describe("onboarding block form i18n", () => {
|
||||
const source = sourcePaths.map((sourcePath) => fs.readFileSync(sourcePath, "utf8")).join("\n");
|
||||
|
||||
expect(source).toContain("onboarding.block.canBeDismissed");
|
||||
expect(source).toContain("onboarding.object.types.${style.value}");
|
||||
expect(source).toContain("onboarding.block.stepsDescription");
|
||||
expect(source).toContain("onboarding.block.actions.addGalleryItem");
|
||||
expect(source).toContain("onboarding.block.defaultGalleryTitle");
|
||||
@@ -66,6 +67,7 @@ describe("onboarding block form i18n", () => {
|
||||
expect(source).not.toContain("ui.autogenerated");
|
||||
expect(source).not.toContain('text-red-600">?</span>');
|
||||
expect(source).not.toContain('title="target=_blank"');
|
||||
expect(source).not.toContain('name: "Modal"');
|
||||
expect(source).not.toContain('"Item "');
|
||||
expect(source).not.toContain("{block.links.length} links");
|
||||
expect(source).not.toContain("{block.gallery.length} gallery items");
|
||||
|
||||
Reference in new issue
Block a user