Skip to content

Commit

Permalink
Add self signup URL text to the branding.
Browse files Browse the repository at this point in the history
  • Loading branch information
Achintha Isuru committed Nov 7, 2023
1 parent c8f0b50 commit 07f71bb
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/console/src/extensions/i18n/models/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,11 @@ export interface Extensions {
label: string;
placeholder: string;
};
selfSignUpURL: {
hint: string;
label: string;
placeholder: string;
};
termsOfUseURL: {
hint: string;
label: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,11 @@ export const extensions: Extensions = {
label: "Privacy Policy",
placeholder: "https://myapp.com/{{locale}}/privacy-policy"
},
selfSignUpURL: {
hint: "Link to your organization's Self Signup webpage. You can use placeholders like <1>{{lang}}</1>, <3>{{country}}</3>, or <5>{{locale}}</5> to customize the URL for different regions or languages.",
label: "Self Signup",
placeholder: "https://myapp.com/self-signup"
},
termsOfUseURL: {
hint: "Link to an agreement that your customers must agree to and abide by in order to use your organization's applications or other services. You can use placeholders like <1>{{lang}}</1>, <3>{{country}}</3>, or <5>{{locale}}</5> to customize the URL for different regions or languages.",
label: "Terms of Service",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,11 @@ export const extensions: Extensions = {
label: "politique de confidentialité",
placeholder: "https://myapp.com/{{locale}}/privacy-policy"
},
selfSignUpURL: {
hint: "Lien vers la page Web d'auto-inscription de votre organisation. Vous pouvez utiliser des espaces réservés comme <1>{{lang}}</1>, <3>{{country}}</3>, ou <5>{{locale}}</5> pour personnaliser l'URL pour différentsrégions ou langues.",
label: "Auto-inscription",
placeholder: "https://myapp.com/self-signup"
},
termsOfUseURL: {
hint: "Lien vers un accord que vos clients doivent accepter et respecter afin d'utiliser les applications ou d'autres services de votre organisation.Vous pouvez utiliser des espaces réservés comme <1>{{lang}}</1>, <3>{{country}}</3>, ou <5>{{locale}}</5> pour personnaliser l'URL pour différentsrégions ou langues.",
label: "Conditions d'utilisation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,11 @@ export const extensions: Extensions = {
label: "රහස්යතා ප්රතිපත්තිය",
placeholder: "https://myapp.com/{{locale}}/privacy-policy"
},
selfSignUpURL: {
hint: "ඔබේ සංවිධානයේ ස්වයං ලියාපදිංචි වීමේ වෙබ් පිටුවට සම්බන්ධ වන්න. විවිධ කලාප හෝ භාෂා සඳහා URL අභිරුචිකරණය කිරීමට <1>{{lang}}</1>, <3>{{country}}</3>, හෝ <5>{{locale}}</5> placeholders භාවිතා කළ හැකිය.",
label: "ස්වයං ලියාපදිංචි වීම",
placeholder: "https://myapp.com/self-signup"
},
termsOfUseURL: {
hint: "ඔබේ ආයෝජන යෙදුම් හෝ වෙනත් සේවාවන් භාවිතා කිරීම සඳහා ඔබේ ගනුදෙනුකරුවන් ඊට එකඟ වී පිළිපැදිය යුතු ගිවිසුමකට සම්බන්ධ වන්න. විවිධ කලාප හෝ භාෂා සඳහා URL අභිරුචිකරණය කිරීමට <1>{{lang}}</1>, <3>{{country}}</3>, හෝ <5>{{locale}}</5> placeholders භාවිතා කළ හැකිය.",
label: "සේවා කොන්දේසි",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export const AdvanceForm: FunctionComponent<AdvanceFormPropsInterface> = forward
const [ privacyPolicyURL, setPrivacyPolicyURL ] = useState<string>(initialValues.urls.privacyPolicyURL);
const [ termsOfUseURL, setTermsOfUseURL ] = useState<string>(initialValues.urls.termsOfUseURL);
const [ cookiePolicyURL, setCookiePolicyURL ] = useState<string>(initialValues.urls.cookiePolicyURL);
const [ selfSignUpURL, setSelfSignUpURL ] = useState<string>(initialValues.urls.selfSignUpURL);

/**
* Broadcast values to the outside when internals change.
Expand All @@ -107,6 +108,7 @@ export const AdvanceForm: FunctionComponent<AdvanceFormPropsInterface> = forward
...initialValues.urls,
cookiePolicyURL: cookiePolicyURL,
privacyPolicyURL: privacyPolicyURL,
selfSignUpURL: selfSignUpURL,
termsOfUseURL: termsOfUseURL
}
});
Expand Down Expand Up @@ -258,6 +260,33 @@ export const AdvanceForm: FunctionComponent<AdvanceFormPropsInterface> = forward
data-testid={ `${ componentId }-cookie-policy-url` }
validation={ validateTemplatableURLs }
/>
<Field.Input
ariaLabel="Branding preference self signup URL"
inputType="url"
name="urls.selfSignUpURL"
label={ t("extensions:develop.branding.forms.advance.links.fields.selfSignUpURL.label") }
placeholder={
t("extensions:develop.branding.forms.advance.links.fields.selfSignUpURL.placeholder")
}
hint={ (
<Trans
i18nKey="extensions:develop.branding.forms.advance.links.fields.selfSignUpURL.hint"
>
Link to your organization&apos;s Self Signup webpage. You can use placeholders like
<Code>&#123;&#123;lang&#125;&#125;</Code>, <Code>&#123;&#123;country&#125;&#125;</Code>,
or <Code>&#123;&#123;locale&#125;&#125;</Code> to customize the URL for different
regions or languages.
</Trans>
) }
required={ false }
value={ initialValues.urls.selfSignUpURL }
readOnly={ readOnly }
maxLength={ BrandingPreferencesConstants.ADVANCE_FORM_FIELD_CONSTRAINTS.COOKIE_POLICY_URL_MAX_LENGTH }
minLength={ BrandingPreferencesConstants.ADVANCE_FORM_FIELD_CONSTRAINTS.COOKIE_POLICY_URL_MIN_LENGTH }
listen={ (value: string) => setSelfSignUpURL(value) }
width={ 16 }
data-testid={ `${ componentId }-self-signup-url` }
/>
</Form>
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export const BrandingPreferenceTabs: FunctionComponent<BrandingPreferenceTabsInt
urls: {
cookiePolicyURL: brandingPreference.urls?.cookiePolicyURL,
privacyPolicyURL: brandingPreference.urls?.privacyPolicyURL,
selfSignUpURL: brandingPreference.urls?.selfSignUpURL,
termsOfUseURL: brandingPreference.urls?.termsOfUseURL
}
} }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ export interface BrandingPreferenceURLInterface {
* Link for Cookie Policy.
*/
cookiePolicyURL: string;
/**
* Link for Self Sign Up.
*/
selfSignUpURL?: string;
}

/**
Expand Down

0 comments on commit 07f71bb

Please sign in to comment.