diff --git a/components/form-builder/app/ResponseDelivery.tsx b/components/form-builder/app/ResponseDelivery.tsx
index 87e9cc5f2f..08b899e4ae 100644
--- a/components/form-builder/app/ResponseDelivery.tsx
+++ b/components/form-builder/app/ResponseDelivery.tsx
@@ -1,40 +1,19 @@
-import React, { useRef, useEffect } from "react";
-import { useSession } from "next-auth/react";
+import React, { useEffect } from "react";
+
import { useTranslation } from "next-i18next";
import { SetResponseDelivery } from "./SetResponseDelivery";
import { SettingsLoggedOut } from "./SettingsLoggedOut";
import { useTemplateContext } from "../hooks";
-import { useTemplateStore } from "../store/useTemplateStore";
export const ResponseDelivery = () => {
const { t } = useTranslation("form-builder");
- const { status } = useSession();
const { saveForm } = useTemplateContext();
- const saved = useRef(false);
-
- const { id, setId } = useTemplateStore((s) => ({
- id: s.id,
- setId: s.setId,
- }));
// auto save form if authenticated and not saved
useEffect(() => {
- if (status === "authenticated" && !saved.current && !id) {
- const save = async () => {
- const result = await saveForm();
- if (result) {
- setId(result);
- }
- };
-
- save();
-
- return () => {
- saved.current = true;
- };
- }
- }, [status, id, saveForm, setId]);
+ saveForm();
+ }, [saveForm]);
return (
<>
diff --git a/components/form-builder/app/ShareModalUnauthenticated.tsx b/components/form-builder/app/ShareModalUnauthenticated.tsx
index 2b5b52c09f..491bf92cd6 100644
--- a/components/form-builder/app/ShareModalUnauthenticated.tsx
+++ b/components/form-builder/app/ShareModalUnauthenticated.tsx
@@ -52,12 +52,9 @@ export const ShareModalUnauthenticated = ({
>
-
-
- {t("share.unauthenticated.description")}
-
-
-
+
+ {t("share.unauthenticated.description")}
+
{t("share.unauthenticated.instructions")}
diff --git a/components/form-builder/app/Template.tsx b/components/form-builder/app/Template.tsx
index c817de45fc..568fac1bef 100644
--- a/components/form-builder/app/Template.tsx
+++ b/components/form-builder/app/Template.tsx
@@ -55,9 +55,8 @@ export const PageTemplate = ({
autoWidth?: boolean;
}) => {
const { t, i18n } = useTranslation("form-builder");
- const { hasHydrated, form, setLang } = useTemplateStore((s) => ({
- form: s.form,
- hasHydrated: s._hasHydrated,
+ const { hasHydrated, setLang } = useTemplateStore((s) => ({
+ hasHydrated: s.hasHydrated,
setLang: s.setLang,
email: s.deliveryOption?.emailAddress,
}));
@@ -74,22 +73,20 @@ export const PageTemplate = ({
{leftNav &&
}
<>
- {form && (
-
-
-
{title}
-
-
- {navigation}
- {children}
-
-
- )}
+
+
+
{title}
+
+
+ {navigation}
+ {children}
+
+
>
diff --git a/components/form-builder/app/branding/options.ts b/components/form-builder/app/branding/options.ts
index b5d271402d..f1e01782ae 100644
--- a/components/form-builder/app/branding/options.ts
+++ b/components/form-builder/app/branding/options.ts
@@ -4,7 +4,7 @@ export const options = [
urlEn: "https://www.oag-bvg.gc.ca/internet/English/admin_e_41.html",
urlFr: "https://www.oag-bvg.gc.ca/internet/Francais/admin_f_41.html",
logoEn: "/img/branding/oag-en.svg",
- logoFr: "/img/branding/oag-fr.png",
+ logoFr: "/img/branding/oag-fr.svg",
logoTitleEn: "Office of the Auditor General of Canada",
logoTitleFr: "Bureau du vérificateur général du Canada",
},
@@ -13,7 +13,7 @@ export const options = [
urlEn: "https://irb.gc.ca/en",
urlFr: "https://irb.gc.ca/fr",
logoEn: "/img/branding/irb-en.svg",
- logoFr: "/img/branding/irb-fr.png",
+ logoFr: "/img/branding/irb-fr.svg",
logoTitleEn: "Immigration and Refugee Board of Canada",
logoTitleFr: "Commission de l'immigration et du statut de réfugié du Canada",
},
@@ -22,7 +22,7 @@ export const options = [
urlEn: "https://www.ccbn-nbc.gc.ca/en/",
urlFr: "https://www.ccbn-nbc.gc.ca/en/",
logoEn: "/img/branding/nbc-en.svg",
- logoFr: "/img/branding/nbc-fr.png",
+ logoFr: "/img/branding/nbc-fr.svg",
logoTitleEn: "The National Battlefields Commission",
logoTitleFr: "Commission des champs de bataille nationaux",
},
@@ -49,7 +49,7 @@ export const options = [
urlEn: "https://digital.canada.ca",
urlFr: "https://numerique.canada.ca",
logoEn: "/img/branding/cds-en.svg",
- logoFr: "/img/branding/cds-fr.png",
+ logoFr: "/img/branding/cds-fr.svg",
logoTitleEn: "Canadian Digital Service",
logoTitleFr: "Service numérique canadien",
},
diff --git a/components/form-builder/app/edit/Edit.tsx b/components/form-builder/app/edit/Edit.tsx
index c29cad1938..00a6c1a035 100644
--- a/components/form-builder/app/edit/Edit.tsx
+++ b/components/form-builder/app/edit/Edit.tsx
@@ -8,6 +8,7 @@ import { RefsProvider } from "./RefsContext";
import { RichTextLocked } from "./elements";
import { Input } from "../shared";
import { useTemplateStore } from "../../store";
+import { getQuestionNumber } from "../../util";
export const Edit = () => {
const { t } = useTranslation("form-builder");
@@ -46,6 +47,9 @@ export const Edit = () => {
100
);
+ // grab only the data we need to render the question number
+ const elementTypes = elements.map((element) => ({ id: element.id, type: element.type }));
+
const updateValue = useCallback(
(e: React.ChangeEvent