From f587ac14ca23fc9d3df001fd61b4682797ad9a6f Mon Sep 17 00:00:00 2001 From: Ken Date: Wed, 18 Sep 2024 13:45:11 +0800 Subject: [PATCH 1/2] chore: add comments clarifying potentially confusing terms --- .../template/UseTemplateModal/UseTemplateWizardProvider.tsx | 6 ++++++ frontend/src/features/admin-form/template/mutation.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx b/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx index 3b876c58dd..9287bb7e76 100644 --- a/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx +++ b/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx @@ -116,6 +116,12 @@ interface UseTemplateWizardProviderProps { children: React.ReactNode } +/** + * Note: "Use Template" is Application feature / terminology that the users do. + * The "use" in "UseTemplateWizardProvider" is not referring to hooks or React's "use" convention. + * @param param0 + * @returns + */ export const UseTemplateWizardProvider = ({ formId, children, diff --git a/frontend/src/features/admin-form/template/mutation.ts b/frontend/src/features/admin-form/template/mutation.ts index 2ba1cd5016..41dbbccc01 100644 --- a/frontend/src/features/admin-form/template/mutation.ts +++ b/frontend/src/features/admin-form/template/mutation.ts @@ -53,6 +53,12 @@ const useCommonHooks = () => { } } +/** + * Note: "Use Template" is Application feature / terminology that the users do. + * The "use" in "useUseTemplateMutations" is not referring to hooks or React's "use" convention. + * @param param0 + * @returns + */ export const useUseTemplateMutations = () => { const { handleSuccess, handleError } = useCommonHooks() From acdc3bf56c13e209859c73cdc84fa5592798ce06 Mon Sep 17 00:00:00 2001 From: Kevin Foong Date: Fri, 20 Sep 2024 16:13:09 +0800 Subject: [PATCH 2/2] feat: remove undocumented param and return --- .../template/UseTemplateModal/UseTemplateModal.tsx | 4 ++++ .../template/UseTemplateModal/UseTemplateWizardProvider.tsx | 6 ++---- frontend/src/features/admin-form/template/mutation.ts | 6 ++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateModal.tsx b/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateModal.tsx index 91a58ddede..3d374e9b5a 100644 --- a/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateModal.tsx +++ b/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateModal.tsx @@ -16,6 +16,10 @@ export type UseTemplateModalProps = Pick< 'onClose' | 'isOpen' > & { formId: string } +/** + * Note: The word "Use" in "UseTemplateModal" is not referring to React's "use" convention for hooks. + * "UseTemplate" is a FormSG functionality referring to the FormSG feature of utilising another form as a starting template. + */ export const UseTemplateModal = ({ formId, isOpen, diff --git a/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx b/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx index 9287bb7e76..8a0a9779da 100644 --- a/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx +++ b/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx @@ -117,10 +117,8 @@ interface UseTemplateWizardProviderProps { } /** - * Note: "Use Template" is Application feature / terminology that the users do. - * The "use" in "UseTemplateWizardProvider" is not referring to hooks or React's "use" convention. - * @param param0 - * @returns + * Note: The word "Use" in "UseTemplateWizardProvider" is not referring to React's "use" convention for hooks. + * "UseTemplate" is a FormSG functionality referring to the FormSG feature of utilising another form as a starting template. */ export const UseTemplateWizardProvider = ({ formId, diff --git a/frontend/src/features/admin-form/template/mutation.ts b/frontend/src/features/admin-form/template/mutation.ts index 41dbbccc01..edfb4af283 100644 --- a/frontend/src/features/admin-form/template/mutation.ts +++ b/frontend/src/features/admin-form/template/mutation.ts @@ -54,10 +54,8 @@ const useCommonHooks = () => { } /** - * Note: "Use Template" is Application feature / terminology that the users do. - * The "use" in "useUseTemplateMutations" is not referring to hooks or React's "use" convention. - * @param param0 - * @returns + * Note: The word "Use" in "useUseTemplateWizardProvider" is not referring to React's "use" convention for hooks. + * "UseTemplate" is a FormSG functionality referring to the FormSG feature of utilising another form as a starting template. */ export const useUseTemplateMutations = () => { const { handleSuccess, handleError } = useCommonHooks()