Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Commit 65dda33

Browse files
Fix lint
1 parent b10aa26 commit 65dda33

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

src/components/display/formFooter/testConnectionResult.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function FormFooterTestConnectionResult({
4444
const newProgressValue = currentProgress + difference / 80;
4545
setProgress(newProgressValue);
4646

47-
intervalId.current = window.setTimeout(() => updateProgress(newProgressValue), 100);
47+
intervalId.current = globalThis.setTimeout(() => updateProgress(newProgressValue), 100);
4848
};
4949

5050
updateProgress(0);
@@ -65,7 +65,7 @@ export function FormFooterTestConnectionResult({
6565

6666
const handleTransitionEnd = () => {
6767
clearTimeout(timeoutId.current);
68-
timeoutId.current = window.setTimeout(() => {
68+
timeoutId.current = globalThis.setTimeout(() => {
6969
if (!hasTransitionEnded) {
7070
hasTransitionEnded = true;
7171
if (failureError) {

src/components/display/lightboxImage/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ function getFullImageUrl(imageUrl) {
6262

6363
// If the imageUrl starts with /, it is relative to the domain root
6464
if (imageUrl.startsWith('/')) {
65-
return `${window.location.origin}${imageUrl}`;
65+
return `${globalThis.location.origin}${imageUrl}`;
6666
}
6767

6868
// Otherwise, it is a relative path, append to the current URL path
69-
const currentUrl = window.location.href;
69+
const currentUrl = globalThis.location.href;
7070
const currentPath = currentUrl.slice(0, Math.max(0, currentUrl.lastIndexOf('/') + 1));
7171

7272
return `${currentPath}${imageUrl}`;

src/components/display/tree/node.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface TreeNodeProps extends ListItemProps {
1616
onSelect: () => void;
1717
}
1818

19-
const _TreeNode: FC<TreeNodeProps> = ({
19+
const InternalTreeNode: FC<TreeNodeProps> = ({
2020
children,
2121
isExpanded,
2222
isSelected,
@@ -62,4 +62,4 @@ const _TreeNode: FC<TreeNodeProps> = ({
6262
*
6363
* @public
6464
*/
65-
export const TreeNode = React.memo(_TreeNode);
65+
export const TreeNode = React.memo(InternalTreeNode);

src/components/form/controls/controlTableSelectorField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { usePluginContext } from '../../../context';
99
import { generatePluginTableList } from '../../../utils';
1010
import { TableSelector } from '../../inputs';
1111

12-
function _PluginTableSelector() {
12+
function InternalPluginTableSelector() {
1313
const {
1414
control,
1515
formState: { errors, submitCount },
@@ -70,4 +70,4 @@ function _PluginTableSelector() {
7070
*
7171
* @public
7272
*/
73-
export const ControlTableSelectorField = React.memo(_PluginTableSelector);
73+
export const ControlTableSelectorField = React.memo(InternalPluginTableSelector);

src/components/inputs/tableSelector/listItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface Props {
1616
disabled?: boolean;
1717
}
1818

19-
const _TableSelectorListItem: FC<Props> = ({
19+
const InternalTableSelectorListItem: FC<Props> = ({
2020
valuesRef,
2121
subscribeToTablesValueChange,
2222
onSelect,
@@ -95,4 +95,4 @@ const _TableSelectorListItem: FC<Props> = ({
9595
);
9696
};
9797

98-
export const TableSelectorListItem = React.memo(_TableSelectorListItem);
98+
export const TableSelectorListItem = React.memo(InternalTableSelectorListItem);

src/components/utils/cloudAppMock.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const formMessageHandler = new MessageHandler<
5555
FormMessagePayload,
5656
PluginUiMessageType,
5757
PluginUiMessagePayload
58-
>(formMessageTypes, pluginUiMessageTypes, window);
58+
>(formMessageTypes, pluginUiMessageTypes, globalThis);
5959

6060
/**
6161
* This component is used in the development mode of the custom plugin config UI
@@ -79,7 +79,7 @@ export function CloudAppMock({
7979
const [lightboxProps, setLightboxProps] = useState<
8080
PluginUiMessagePayload['show_lightbox'] & { isLoaded: boolean }
8181
>();
82-
const searchParams = useMemo(() => new URLSearchParams(window.location.search), []);
82+
const searchParams = useMemo(() => new URLSearchParams(globalThis.location.search), []);
8383

8484
const handleSubmit = async () => {
8585
formMessageHandler.sendMessage('validate');
@@ -336,23 +336,23 @@ export function CloudAppMock({
336336
FormMessagePayload
337337
>(pluginUiMessageTypes, formMessageTypes, window.opener);
338338

339-
window.localStorage.setItem(
339+
globalThis.localStorage.setItem(
340340
'authConnectorResult',
341341
JSON.stringify(Object.fromEntries(searchParams.entries())),
342342
);
343343

344344
pluginUIMessageHandler.sendMessage('close');
345345
} else {
346-
window.addEventListener('storage', () => {
347-
const authConnectorResult = window.localStorage.getItem('authConnectorResult');
346+
globalThis.addEventListener('storage', () => {
347+
const authConnectorResult = globalThis.localStorage.getItem('authConnectorResult');
348348

349349
if (!authConnectorResult) {
350350
return;
351351
}
352352

353353
try {
354354
const value = JSON.parse(authConnectorResult) as Record<string, string>;
355-
window.localStorage.removeItem('authConnectorResult');
355+
globalThis.localStorage.removeItem('authConnectorResult');
356356
formMessageHandler.sendMessage('auth_connector_result', value);
357357
} catch {
358358
return;

src/components/utils/devWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const CloudAppMockWrapper = (props: any) => (
1616

1717
const useCloudAppMock =
1818
(process.env.REACT_APP_USE_CLOUD_APP_MOCK === 'true' || process.env.NODE_ENV !== 'production') &&
19-
window.self === window.top;
19+
globalThis.self === window.top;
2020
const Wrapper = useCloudAppMock ? CloudAppMockWrapper : Fragment;
2121

2222
export function DevWrapper({

src/utils/scrollToFirstFormFieldError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
export function scrollToFirstFormFieldError(errorFieldNames: string[]) {
88
const elements = errorFieldNames
9-
.map((name) => document.getElementsByName(name)[0])
9+
.map((name) => document.querySelector(`[name="${name}"]`) as HTMLElement)
1010
.filter((el) => !!el);
1111
elements.sort((a, b) => a.getBoundingClientRect().top - b.getBoundingClientRect().top);
1212

0 commit comments

Comments
 (0)