From 1b77c259fd60a39a11d374913ef4cdb1a17ee702 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 22 Aug 2024 00:54:41 +0530 Subject: [PATCH 1/2] fix: Workspace - Submit button loads infinitely and is not deactivated while offline. Signed-off-by: krishna2323 --- src/components/FeedbackSurvey.tsx | 7 +++++-- .../Subscription/RequestEarlyCancellationPage/index.tsx | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/FeedbackSurvey.tsx b/src/components/FeedbackSurvey.tsx index a17cca5efae4..2cfc211b2ebe 100644 --- a/src/components/FeedbackSurvey.tsx +++ b/src/components/FeedbackSurvey.tsx @@ -43,9 +43,12 @@ type FeedbackSurveyProps = { /** Indicates whether a loading indicator should be shown */ isLoading?: boolean; + + /** Should the submit button be enabled when offline */ + enabledWhenOffline?: boolean; }; -function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerText, isNoteRequired, isLoading, formID}: FeedbackSurveyProps) { +function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerText, isNoteRequired, isLoading, formID, enabledWhenOffline = true}: FeedbackSurveyProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); const [draft, draftResults] = useOnyx(`${formID}Draft`); @@ -103,7 +106,7 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerTe onSubmit={handleSubmit} submitButtonText={translate('common.submit')} isSubmitButtonVisible={false} - enabledWhenOffline + enabledWhenOffline={enabledWhenOffline} > {title} diff --git a/src/pages/settings/Subscription/RequestEarlyCancellationPage/index.tsx b/src/pages/settings/Subscription/RequestEarlyCancellationPage/index.tsx index ab148f8d8edc..d74e126ff94e 100644 --- a/src/pages/settings/Subscription/RequestEarlyCancellationPage/index.tsx +++ b/src/pages/settings/Subscription/RequestEarlyCancellationPage/index.tsx @@ -107,6 +107,7 @@ function RequestEarlyCancellationPage() { footerText={{acknowledgementText}} isNoteRequired isLoading={isLoading} + enabledWhenOffline={false} /> ), [acknowledgementText, isLoading, styles.flex1, styles.mb2, styles.mt4, translate], From 85b6d1544c20279144e773c4e153c116393535d0 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 22 Aug 2024 01:19:00 +0530 Subject: [PATCH 2/2] minor update. Signed-off-by: krishna2323 --- src/components/FeedbackSurvey.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FeedbackSurvey.tsx b/src/components/FeedbackSurvey.tsx index 2cfc211b2ebe..3c677a7b0f6d 100644 --- a/src/components/FeedbackSurvey.tsx +++ b/src/components/FeedbackSurvey.tsx @@ -141,7 +141,7 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerTe onSubmit={handleSubmit} message={translate('common.error.pleaseCompleteForm')} buttonText={translate('common.submit')} - enabledWhenOffline + enabledWhenOffline={enabledWhenOffline} containerStyles={styles.mt3} isLoading={isLoading} />