PromucFlow_constructor/app/client/src/pages/AdminSettings/index.tsx
Valera Melnikov a2bfe450b6
chore: enable no-explicit-any rule (#35321)
## Description
-  Enabled the rule `@typescript-eslint/no-explicit-any`
- Suppressed errors with comment
```
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
```

Fixes #35308 

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10181176984>
> Commit: 7fc604e24fa234da7ab2ff56e0b1c715268796ee
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10181176984&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 31 Jul 2024 15:00:45 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No
2024-07-31 18:41:28 +03:00

65 lines
1.9 KiB
TypeScript

import React, { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
import PageWrapper from "pages/common/PageWrapper";
import { getSettingsLoadingState } from "selectors/settingsSelectors";
import styled from "styled-components";
import LeftPane from "pages/AdminSettings/LeftPane";
import Main from "pages/AdminSettings/Main";
import WithSuperUserHOC from "@appsmith/pages/AdminSettings/WithSuperUserHoc";
import { getCurrentUser } from "selectors/usersSelectors";
import bootIntercom from "utils/bootIntercom";
import { LoaderContainer } from "pages/AdminSettings/components";
import { useParams } from "react-router";
import AdminConfig from "@appsmith/pages/AdminSettings/config";
import { Spinner } from "design-system";
const FlexContainer = styled.div`
display: flex;
height: 100%;
`;
function Settings() {
const dispatch = useDispatch();
const user = useSelector(getCurrentUser);
const isLoading = useSelector(getSettingsLoadingState);
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const params = useParams() as any;
const { category, selected: subCategory } = params;
const isSavable = AdminConfig.savableCategories.includes(
subCategory ?? category,
);
useEffect(() => {
if (user?.isSuperUser) {
dispatch({
type: ReduxActionTypes.FETCH_ADMIN_SETTINGS,
});
}
}, []);
useEffect(() => {
bootIntercom(user);
}, [user?.email]);
return (
<PageWrapper isFixed isSavable={isSavable}>
<FlexContainer>
{isLoading ? (
<LoaderContainer>
<Spinner size="lg" />
</LoaderContainer>
) : (
<>
<LeftPane />
<Main />
</>
)}
</FlexContainer>
</PageWrapper>
);
}
export default WithSuperUserHOC(Settings);