PromucFlow_constructor/app/client/src/pages/utils.ts
sneha122 54484c81a5
fix: gsheet file picker background issue fixed (#24049)
## Description
This PR fixes:
- When creating google sheets datasource with specific sheets modality,
the file picker is being shown on blank page, but before we see file
picker, we see appsmith page for a bit and then see the blank page, this
creates the illusion that file picker is being opened outside of
appsmith.



https://github.com/appsmithorg/appsmith/assets/30018882/616fd98f-7193-47ce-b09a-00cf4a690ae1

- Issue fixed looks like below:



https://github.com/appsmithorg/appsmith/assets/30018882/515f8ba3-997f-4f7c-9f3b-b3c16bbff086


#### PR fixes following issue(s)
Fixes #24046 
> if no issue exists, please create an issue and ask the maintainers
about this first
>
>
#### Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video
>
>
#### Type of change
- Bug fix (non-breaking change which fixes an issue)
>
>
>
## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [x] Manual
- [ ] Jest
- [ ] Cypress
>
>
#### Test Plan
1) Check on the scope of the permission
2) Check on the file picker is appearing 
3) Check if the header of app smith is visible when the file picker is
displayed to the user

#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [x] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed

---------

Co-authored-by: “sneha122” <“sneha@appsmith.com”>
2023-06-08 14:58:29 +05:30

30 lines
844 B
TypeScript

import { getSearchQuery } from "utils/helpers";
import type { Location } from "history";
export const getIsBranchUpdated = (
prevLocation: Location<unknown>,
currentLocation: Location<unknown>,
) => {
const { search: search1 } = prevLocation;
const { search: search2 } = currentLocation;
const branch1 = getSearchQuery(search1, "branch");
const branch2 = getSearchQuery(search2, "branch");
return branch1 !== branch2;
};
export const addClassToDocumentRoot = (className: string) => {
const element: HTMLElement | null = document.querySelector("#root");
if (!!element) {
element.classList.add(className);
}
};
export const removeClassFromDocumentRoot = (className: string) => {
const element: HTMLElement | null = document.querySelector("#root");
if (!!element) {
element.classList.remove(className);
}
};