From 301aea41b7099f518b26c35aa85104dcbcfdb697 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 5 Sep 2024 11:02:15 +0530 Subject: [PATCH 1/4] fix: Advanced approval - RHP turns to not here page while dismissing after deleting the workflow. Signed-off-by: krishna2323 --- .../approvals/WorkspaceWorkflowsApprovalsEditPage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx index dcd9eb912972..1a13bcc72a98 100644 --- a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx +++ b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx @@ -1,7 +1,8 @@ import type {StackScreenProps} from '@react-navigation/stack'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; // eslint-disable-next-line no-restricted-imports -import type {ScrollView} from 'react-native'; +import {InteractionManager} from 'react-native'; +import {type ScrollView} from 'react-native'; import {useOnyx} from 'react-native-onyx'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import ConfirmModal from '@components/ConfirmModal'; @@ -57,9 +58,11 @@ function WorkspaceWorkflowsApprovalsEditPage({policy, isLoadingReportData = true } // Remove the approval workflow using the initial data as it could be already edited - Workflow.removeApprovalWorkflow(route.params.policyID, initialApprovalWorkflow); setIsDeleteModalVisible(false); Navigation.dismissModal(); + InteractionManager.runAfterInteractions(() => { + Workflow.removeApprovalWorkflow(route.params.policyID, initialApprovalWorkflow); + }); }, [initialApprovalWorkflow, route.params.policyID]); const {currentApprovalWorkflow, defaultWorkflowMembers, usedApproverEmails} = useMemo(() => { From 6087456375e286cc48ac19abf8b23c964dc3ffe7 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 5 Sep 2024 11:06:53 +0530 Subject: [PATCH 2/4] minor fix. Signed-off-by: krishna2323 --- .../workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx index 1a13bcc72a98..f93c397c06d3 100644 --- a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx +++ b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx @@ -1,8 +1,8 @@ import type {StackScreenProps} from '@react-navigation/stack'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; // eslint-disable-next-line no-restricted-imports -import {InteractionManager} from 'react-native'; import {type ScrollView} from 'react-native'; +import {InteractionManager} from 'react-native'; import {useOnyx} from 'react-native-onyx'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import ConfirmModal from '@components/ConfirmModal'; From 082563df64609b03ae880dc4b5866ab753816310 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 5 Sep 2024 11:08:46 +0530 Subject: [PATCH 3/4] lint fix. Signed-off-by: krishna2323 --- .../workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx index f93c397c06d3..5aea39d3b8c9 100644 --- a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx +++ b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx @@ -1,7 +1,7 @@ import type {StackScreenProps} from '@react-navigation/stack'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; // eslint-disable-next-line no-restricted-imports -import {type ScrollView} from 'react-native'; +import type {ScrollView} from 'react-native'; import {InteractionManager} from 'react-native'; import {useOnyx} from 'react-native-onyx'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; From 801f715516a94a944663fbbd76fd5c7753293419 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 5 Sep 2024 15:52:05 +0530 Subject: [PATCH 4/4] minor fix. Signed-off-by: krishna2323 --- .../workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx index 5aea39d3b8c9..cea33c0c5dff 100644 --- a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx +++ b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx @@ -57,10 +57,10 @@ function WorkspaceWorkflowsApprovalsEditPage({policy, isLoadingReportData = true return; } - // Remove the approval workflow using the initial data as it could be already edited setIsDeleteModalVisible(false); Navigation.dismissModal(); InteractionManager.runAfterInteractions(() => { + // Remove the approval workflow using the initial data as it could be already edited Workflow.removeApprovalWorkflow(route.params.policyID, initialApprovalWorkflow); }); }, [initialApprovalWorkflow, route.params.policyID]);