From e89fb0c2e41bef1c982d813d7d186c3cf6839c9d Mon Sep 17 00:00:00 2001 From: Rudraprasad Das Date: Fri, 20 Sep 2024 19:49:39 +0800 Subject: [PATCH] fix: loading state for pull (#36363) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fixes issue of missing loader when pulling changes from remote Fixes https://github.com/appsmithorg/appsmith/issues/36273 Fixes https://github.com/appsmithorg/appsmith/issues/31308 ## Automation /ok-to-test tags="@tag.Git" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 4b8a1175b3728c6c743f46b08998ce74e3308bbc > Cypress dashboard. > Tags: `@tag.Git` > Spec: >
Fri, 20 Sep 2024 11:44:27 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Introduced a new selector to track the progress of pull operations. - Enhanced loading state logic to reflect multiple concurrent Git operations. - **Bug Fixes** - Improved accuracy of loading state for pull actions and discard operations. --- .../src/pages/Editor/gitSync/QuickGitActions/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx b/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx index 582ba3f798..30c4be2b90 100644 --- a/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx +++ b/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx @@ -36,6 +36,7 @@ import { getIsFetchingGitStatus, getIsGitConnected, getIsPollingAutocommit, + getIsPullingProgress, getPullFailed, protectedModeSelector, } from "selectors/gitSyncSelectors"; @@ -306,9 +307,11 @@ export default function QuickGitActions() { const { disabled: pullDisabled, message: pullTooltipMessage } = getPullBtnStatus(gitStatus, !!pullFailed, isProtectedMode); - const isPullInProgress = useSelector(getIsDiscardInProgress); + const isDiscardInProgress = useSelector(getIsDiscardInProgress); + const isPullInProgress = useSelector(getIsPullingProgress); const isFetchingGitStatus = useSelector(getIsFetchingGitStatus); - const showPullLoadingState = isPullInProgress || isFetchingGitStatus; + const showPullLoadingState = + isDiscardInProgress || isPullInProgress || isFetchingGitStatus; const changesToCommit = useSelector(getCountOfChangesToCommit); const isAutocommitFeatureEnabled = useFeatureFlag(