diff --git a/.changeset/perfect-tips-work.md b/.changeset/perfect-tips-work.md new file mode 100644 index 00000000000..b42a6100ed7 --- /dev/null +++ b/.changeset/perfect-tips-work.md @@ -0,0 +1,5 @@ +--- +"@wso2is/admin.sms-providers.v1": patch +--- + +Add loading state to sms provider form diff --git a/features/admin.sms-providers.v1/pages/custom-sms-provider.tsx b/features/admin.sms-providers.v1/pages/custom-sms-provider.tsx index 71fe24048e5..f335671af3f 100644 --- a/features/admin.sms-providers.v1/pages/custom-sms-provider.tsx +++ b/features/admin.sms-providers.v1/pages/custom-sms-provider.tsx @@ -29,6 +29,7 @@ import { Divider, Grid } from "semantic-ui-react"; import { SMSProviderConstants } from "../constants"; interface CustomSMSProviderPageInterface extends IdentifiableComponentInterface { + isLoading?: boolean; isReadOnly: boolean; "data-componentid": string; onSubmit: (values: any) => void; @@ -40,6 +41,7 @@ const CustomSMSProvider: FunctionComponent = ( const { ["data-componentid"]: componentId, + isLoading, isReadOnly, onSubmit } = props; @@ -228,6 +230,7 @@ const CustomSMSProvider: FunctionComponent = ( onClick={ onSubmit } ariaLabel="SMS provider form update button" data-componentid={ `${componentId}-update-button` } + loading={ isLoading } > { "Submit" } diff --git a/features/admin.sms-providers.v1/pages/sms-providers.tsx b/features/admin.sms-providers.v1/pages/sms-providers.tsx index ec7d438ab90..4a5b3fff520 100644 --- a/features/admin.sms-providers.v1/pages/sms-providers.tsx +++ b/features/admin.sms-providers.v1/pages/sms-providers.tsx @@ -603,6 +603,7 @@ const SMSProviders: FunctionComponent = ( SMSProviderConstants.CUSTOM_SMS_PROVIDER && ( <> = ( { smsProviderSettings?.selectedProvider === SMSProviderConstants.TWILIO_SMS_PROVIDER && ( = ( { smsProviderSettings?.selectedProvider === SMSProviderConstants.VONAGE_SMS_PROVIDER && ( void; } @@ -41,6 +42,7 @@ const TwilioSMSProvider: FunctionComponent = ( const { ["data-componentid"]: componentId, onSubmit, + isLoading, isReadOnly } = props; const { t } = useTranslation(); @@ -171,6 +173,7 @@ const TwilioSMSProvider: FunctionComponent = ( onClick={ onSubmit } ariaLabel="SMS provider form update button" data-componentid={ `${componentId}-update-button` } + loading={ isLoading } > { "Submit" } diff --git a/features/admin.sms-providers.v1/pages/vonage-sms-provider.tsx b/features/admin.sms-providers.v1/pages/vonage-sms-provider.tsx index 5b98ef49553..c94b4ebbe7d 100644 --- a/features/admin.sms-providers.v1/pages/vonage-sms-provider.tsx +++ b/features/admin.sms-providers.v1/pages/vonage-sms-provider.tsx @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). + * Copyright (c) 2023-2024, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -31,6 +31,7 @@ import { SMSProviderConstants } from "../constants"; interface VonageSMSProviderPageInterface extends IdentifiableComponentInterface { "data-componentid": string; + isLoading?: boolean; isReadOnly: boolean; onSubmit: (values: any) => void; } @@ -40,6 +41,7 @@ const VonageSMSProvider: FunctionComponent = ( ): ReactElement => { const { ["data-componentid"]: componentId, + isLoading, isReadOnly, onSubmit } = props; @@ -171,6 +173,7 @@ const VonageSMSProvider: FunctionComponent = ( onClick={ onSubmit } ariaLabel="SMS provider form update button" data-componentid={ `${componentId}-update-button` } + loading={ isLoading } > { "Submit" }