Skip to content

Commit

Permalink
Move email and sms providers to a main catagory
Browse files Browse the repository at this point in the history
  • Loading branch information
bhagyasakalanka committed Nov 20, 2023
1 parent 6d26987 commit 06bd344
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 40 deletions.
4 changes: 2 additions & 2 deletions apps/console/src/extensions/i18n/models/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ export interface Extensions {
};
};
emailProviders: {
configureEmailProvider: string;
configureEmailTemplates: string;
heading: string;
subHeading: string;
description: string;
Expand Down Expand Up @@ -1857,7 +1857,7 @@ export interface Extensions {
}
};
};
notificationChannel: {
emailAndSMS: {
heading: {
heading: string;
onlySMSProvider: string;
Expand Down
14 changes: 7 additions & 7 deletions apps/console/src/extensions/i18n/resources/en-US/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1989,14 +1989,14 @@ export const extensions: Extensions = {
}
},
emailProviders: {
configureEmailProvider: "Configure Email Provider",
configureEmailTemplates: "Configure Email Templates",
heading: "Custom Email Provider",
subHeading: "Configure a custom SMTP server to send emails to your users with your own email address.",
description: "Configure the email provider settings according to your SMTP server.",
info: "You can customize the email content using <1>Email Templates</1>.",
updateButton: "Update",
sendTestMailButton: "Send Test Email",
goBack: "Go back to Channels",
goBack: "Go back to Email & SMS",
confirmationModal: {
assertionHint: "Please confirm your action.",
content: "If you delete this configuration, the emails will be sent from the Asgardeo Email Address. " +
Expand Down Expand Up @@ -2089,19 +2089,19 @@ export const extensions: Extensions = {
}
}
},
notificationChannel: {
emailAndSMS: {
heading: {
heading: "SMS / Email Providers",
heading: "Email & SMS Providers",
onlySMSProvider: "SMS Provider",
onlyEmailProvider: "Email Provider"
},
title: {
heading: "SMS / Email Providers",
heading: "Email & SMS Providers",
onlySMSProvider: "SMS Provider",
onlyEmailProvider: "Email Provider"
},
description: {
description: "Configure the SMS and Email providers for your organization.",
description: "Configure the Email and SMS providers for your organization.",
onlySMSProvider: "Configure the SMS provider for your organization.",
onlyEmailProvider: "Configure the Email provider for your organization."
}
Expand All @@ -2113,7 +2113,7 @@ export const extensions: Extensions = {
info: "You can customize the SMS content using <1>SMS Templates</1>.",
updateButton: "Update",
sendTestSMSButton: "Send Test SMS",
goBack: "Go back to Channels",
goBack: "Go back to Email & SMS",
confirmationModal: {
assertionHint: "Please confirm your action.",
content: "If you delete this configuration, you will not receive SMS." +
Expand Down
14 changes: 7 additions & 7 deletions apps/console/src/extensions/i18n/resources/fr-FR/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2022,14 +2022,14 @@ export const extensions: Extensions = {
}
},
emailProviders: {
configureEmailProvider: "Configurer le fournisseur de messagerie",
configureEmailTemplates: "Configurer les modèles d'e-mail",
heading: "Fournisseur de messagerie personnalisé",
subHeading: "Configurez des serveurs SMTP personnalisés pour envoyer des e-mails avec votre propre adresse e-mail.",
description: "Configurez les paramètres du fournisseur de messagerie en fonction de votre serveur SMTP.",
info: "Vous pouvez personnaliser le contenu des e-mails à l'aide de <1>Modèles d'e-mails</1>.",
updateButton: "Mise à jour",
sendTestMailButton: "Envoyer un e-mail test",
goBack: "Revenir aux chaînes",
goBack: "Revenir à E-mail et SMS",
confirmationModal: {
assertionHint: "Veuillez confirmer votre action.",
content: "Si vous supprimez cette configuration, les e-mails seront envoyés à partir de l'adresse e-mail Asgardeo. " +
Expand Down Expand Up @@ -2123,21 +2123,21 @@ export const extensions: Extensions = {
}
}
},
notificationChannel: {
emailAndSMS: {
heading: {
heading: "SMS / fournisseurs de courriels",
heading: "Fournisseurs Email & SMS",
onlySMSProvider: "Fournisseur de SMS",
onlyEmailProvider: "Fournisseur de messagerie"
},
title: {
heading: "SMS / fournisseurs de courriels",
heading: "Fournisseurs Email & SMS",
onlySMSProvider: "Fournisseur de SMS",
onlyEmailProvider: "Fournisseur de messagerie"
},
description: {
description: "Configurez les SMS et les fournisseurs de messagerie pour votre organisation.",
onlySMSProvider: "Configurez le fournisseur SMS pour votre organisation.",
onlyEmailProvider: "Configurez le fournisseur de messagerie pour votre organisation."
onlyEmailProvider: "Configurez les fournisseurs Email et SMS pour votre organisation."
}
},
smsProviders: {
Expand All @@ -2147,7 +2147,7 @@ export const extensions: Extensions = {
info: "Vous pouvez personnaliser le contenu du SMS à l'aide des <1>Modèles de SMS</1>.",
updateButton: "Mise à jour",
sendTestSMSButton: "Envoyer un SMS test",
goBack: "Revenir aux chaînes",
goBack: "RRevenir à E-mail et SMS",
confirmationModal: {
assertionHint: "Veuillez confirmer votre action.",
content: "Si vous supprimez cette configuration, vous ne recevrez pas de SMS." +
Expand Down
14 changes: 7 additions & 7 deletions apps/console/src/extensions/i18n/resources/si-LK/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1964,14 +1964,14 @@ export const extensions: Extensions = {
}
},
emailProviders: {
configureEmailProvider: "පණිවුඩකරණ සැපයුම්කරු වින්යාස කරන්න",
configureEmailTemplates: "විද්‍යුත් තැපැල් සැකිලි වින්‍යාස කරන්න",
heading: "අභිරුචි ඊමේල් සපයන්නා",
subHeading: "ඔබගේම ඊමේල් ලිපිනය සමඟ තැපැල් යැවීමට අභිරුචි SMTP සේවාදායකයන් වින්‍යාස කරන්න.",
description: "ඔබගේ SMTP සේවාදායකයට අනුව විද්‍යුත් තැපැල් සැපයුම්කරු සැකසුම් වින්‍යාස කරන්න.",
info: "ඔබට <1>ඊමේල් සැකිලි</1> භාවිතයෙන් ඊමේල් අන්තර්ගතය අභිරුචිකරණය කළ හැක.",
updateButton: "යාවත්කාලීන කරන්න",
sendTestMailButton: "පරීක්ෂණ විද්‍යුත් තැපෑල යවන්න",
goBack: "නාලිකා වෙත ආපසු යන්න",
goBack: "ඊමේල් සහ කෙටි පණිවුඩ වෙත ආපසු යන්න",
confirmationModal: {
assertionHint: "කරුණාකර ඔබගේ ක්‍රියාව තහවුරු කරන්න.",
content: "ඔබ මෙම වින්‍යාසය මකා දැමුවහොත්, ඊමේල් Asgardeo විද්‍යුත් තැපැල් ලිපිනයෙන් යවනු ලැබේ. කරුණාකර ප්‍රවේශමෙන් ඉදිරියට යන්න.",
Expand Down Expand Up @@ -2062,19 +2062,19 @@ export const extensions: Extensions = {
}
}
},
notificationChannel: {
emailAndSMS: {
heading: {
heading: "කෙටි පණිවුඩ / ඊමේල් සැපයුම්කරුවන්",
heading: "ඊමේල් / කෙටි පණිවුඩ සැපයුම්කරුවන්",
onlySMSProvider: "කෙටි පණිවුඩ සැපයුම්කරු",
onlyEmailProvider: "විද්යුත් තැපැල් සැපයුම්කරු"
},
title: {
heading: "කෙටි පණිවුඩ / ඊමේල් සැපයුම්කරුවන්",
heading: "ඊමේල් / කෙටි පණිවුඩ සැපයුම්කරුවන්",
onlySMSProvider: "කෙටි පණිවුඩ සැපයුම්කරු",
onlyEmailProvider: "විද්යුත් තැපැල් සැපයුම්කරු"
},
description: {
description: "ඔබේ සංවිධානය සඳහා කෙටි පණිවුඩ සහ විද්යුත් තැපැල් සපයන්නන් වින්‍යාස කරන්න.",
description: "ඔබේ සංවිධානය සඳහා විද්යුත් තැපැල් සහ කෙටි පණිවුඩ සපයන්නන් වින්‍යාස කරන්න.",
onlySMSProvider: "ඔබේ සංවිධානය සඳහා කෙටි පණිවුඩ සැපයුම්කරු වින්‍යාස කරන්න.",
onlyEmailProvider: "ඔබේ සංවිධානය සඳහා විද්යුත් තැපැල් සැපයුම්කරු වින්‍යාස කරන්න."
}
Expand All @@ -2086,7 +2086,7 @@ export const extensions: Extensions = {
info: "ඔබට <1>SMS සැකිලි</1> භාවිතයෙන් SMS අන්තර්ගතය අභිරුචිකරණය කළ හැක.",
updateButton: "යාවත්කාලීන කරන්න",
sendTestSMSButton: "පරීක්ෂණ SMS යවන්න",
goBack: "නාලිකා වෙත ආපසු යන්න",
goBack: "ඊමේල් සහ කෙටි පණිවුඩ වෙත ආපසු යන්න",
confirmationModal: {
assertionHint: "කරුණාකර ඔබගේ ක්‍රියාව තහවුරු කරන්න.",
content: "ඔබ මෙම වින්‍යාසය මකා දැමුවහොත්, ඔබට SMS නොලැබෙනු ඇත. කරුණාකර ප්‍රවේශමෙන් ඉදිරියට යන්න.",
Expand Down
8 changes: 4 additions & 4 deletions apps/console/src/features/core/configs/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,14 @@ export const getAppViewRoutes = (useExtendedRoutes: boolean = false): RouteInter
{
category: "extensions:develop.sidePanel.categories.branding",
component: lazy(() =>
import("../../../features/notification-channels/" + "pages/notification-channels")
import("../../../features/email-and-sms/" + "pages/email-and-sms")
),
exact: true,
icon: { icon: <EnvelopeGearIcon fill="black" className="icon" /> },
id: "notification-channels",
name: "Channels",
id: "email-and-sms",
name: "Email & SMS",
order: 15,
path: `${ AppConstants.getDeveloperViewBasePath() }/channels`,
path: `${ AppConstants.getDeveloperViewBasePath() }/email-and-sms`,
protected: true,
showOnSidePanel: true
},
Expand Down
7 changes: 3 additions & 4 deletions apps/console/src/features/core/utils/route-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,11 @@ export class RouteUtils {
parent: branding
},
{
category: build,
id: "notification-channels",
parent: branding,
category: settings,
id: "email-and-sms",
selected: history.location.pathname === AppConstants.getPaths().get("EMAIL_PROVIDER") ||
history.location.pathname === AppConstants.getPaths().get("SMS_PROVIDER") ||
history.location.pathname === `${ AppConstants.getDeveloperViewBasePath() }/channels`
history.location.pathname === `${ AppConstants.getDeveloperViewBasePath() }/email-and-sms`
},
{
category: settings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ import { SettingsSection } from "../settings/settings-section";
/**
* Props for the Server Configurations page.
*/
type NotificationChannelPageInterface = IdentifiableComponentInterface;
type EmailAndSMSPageInterface = IdentifiableComponentInterface;

/**
* Governance connector listing page.
*
* @param props - Props injected to the component.
* @returns Governance connector listing page component.
*/
export const NotificationChannelPage: FunctionComponent<NotificationChannelPageInterface> = (
props: NotificationChannelPageInterface
export const EmailAndSMSPage: FunctionComponent<EmailAndSMSPageInterface> = (
props: EmailAndSMSPageInterface
): ReactElement => {
const { ["data-componentid"]: componentid } = props;

Expand Down Expand Up @@ -73,7 +73,7 @@ export const NotificationChannelPage: FunctionComponent<NotificationChannelPageI
const handleEmailSelection = (): void => {
history.push(AppConstants.getPaths().get("EMAIL_PROVIDER"));
};

/**
* Get the page details based on the enabled providers.
*/
Expand Down Expand Up @@ -105,6 +105,9 @@ export const NotificationChannelPage: FunctionComponent<NotificationChannelPageI

return (
<PageLayout
pageTitle={ t("extensions:develop.emailAndSMS.heading") }
title={ t("extensions:develop.emailAndSMS.title") }
description={ t("extensions:develop.emailAndSMS.description") }
pageTitle={ getPageDetails().pageTitle }
title={ getPageDetails().title }
description={ getPageDetails().description }
Expand Down Expand Up @@ -148,13 +151,13 @@ export const NotificationChannelPage: FunctionComponent<NotificationChannelPageI
/**
* Default props for the component.
*/
NotificationChannelPage.defaultProps = {
"data-componentid": "notification-channel-page"
EmailAndSMSPage.defaultProps = {
"data-componentid": "email-and-sms-page"
};

/**
* A default export was added to support React.lazy.
* TODO: Change this to a named export once react starts supporting named exports for code splitting.
* @see {@link https://reactjs.org/docs/code-splitting.html#reactlazy}
*/
export default NotificationChannelPage;
export default EmailAndSMSPage;
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
EmphasizedSegment,
PageLayout,
PrimaryButton,
SecondaryButton,
useDocumentation
} from "@wso2is/react-components";
import { FormValidation } from "@wso2is/validation";
Expand Down Expand Up @@ -427,7 +428,11 @@ const EmailProvidersPage: FunctionComponent<EmailProvidersPageInterface> = (
};

const handleBackButtonClick = () => {
history.push(`${ AppConstants.getDeveloperViewBasePath() }/channels`);
history.push(`${ AppConstants.getDeveloperViewBasePath() }/email-and-sms`);
};

const goToEmailTemplates = () => {
history.push(`${AppConstants.getDeveloperViewBasePath() }/email-management`);
};

return (
Expand All @@ -442,6 +447,17 @@ const EmailProvidersPage: FunctionComponent<EmailProvidersPageInterface> = (
onClick: handleBackButtonClick,
text: t("extensions:develop.emailProviders.goBack")
} }
action={
featureConfig.emailProviders?.enabled &&
(
<SecondaryButton
onClick={ goToEmailTemplates }
data-componentId="email-templates-configure-button"
>
{ t("extensions:develop.emailProviders.configureEmailTemplates") }
</SecondaryButton>
)
}
data-componentid={ `${ componentId }-form-layout` }
>
<Ref innerRef={ pageContextRef }>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ const SMSProviders: FunctionComponent<SMSProviderPageInterface> = (
};

const handleBackButtonClick = () => {
history.push(`${ AppConstants.getDeveloperViewBasePath() }/channels`);
history.push(`${ AppConstants.getDeveloperViewBasePath() }/email-and-sms`);
};

return (
Expand Down

0 comments on commit 06bd344

Please sign in to comment.