chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### Test Plan
> Add Testsmith test cases links that relate to this PR
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
import type { RefObject } from "react";
|
2024-05-04 00:16:37 +00:00
|
|
|
import React, {
|
|
|
|
|
useCallback,
|
|
|
|
|
useEffect,
|
|
|
|
|
useMemo,
|
|
|
|
|
useRef,
|
|
|
|
|
useState,
|
|
|
|
|
} from "react";
|
2022-05-19 13:13:51 +00:00
|
|
|
import { connect, useDispatch, useSelector } from "react-redux";
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### Test Plan
> Add Testsmith test cases links that relate to this PR
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
import type { RouteComponentProps } from "react-router";
|
|
|
|
|
import { withRouter } from "react-router";
|
2021-09-08 17:32:22 +00:00
|
|
|
import styled from "styled-components";
|
2023-04-10 12:59:14 +00:00
|
|
|
import { every, includes } from "lodash";
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### Test Plan
> Add Testsmith test cases links that relate to this PR
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
import type { AppState } from "@appsmith/reducers";
|
|
|
|
|
import type { JSEditorRouteParams } from "constants/routes";
|
2021-09-08 17:32:22 +00:00
|
|
|
import {
|
|
|
|
|
createMessage,
|
2023-04-10 12:59:14 +00:00
|
|
|
DEBUGGER_ERRORS,
|
2024-02-29 06:23:57 +00:00
|
|
|
DEBUGGER_LOGS,
|
2021-09-08 17:32:22 +00:00
|
|
|
EXECUTING_FUNCTION,
|
2022-04-28 16:51:02 +00:00
|
|
|
NO_JS_FUNCTION_RETURN_VALUE,
|
2022-05-19 13:13:51 +00:00
|
|
|
UPDATING_JS_COLLECTION,
|
2022-02-11 18:08:46 +00:00
|
|
|
} from "@appsmith/constants/messages";
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### Test Plan
> Add Testsmith test cases links that relate to this PR
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
import type { EditorTheme } from "./CodeEditor/EditorConfig";
|
2021-09-08 17:32:22 +00:00
|
|
|
import DebuggerLogs from "./Debugger/DebuggerLogs";
|
|
|
|
|
import Resizer, { ResizerCSS } from "./Debugger/Resizer";
|
2023-12-09 14:54:43 +00:00
|
|
|
import type { JSAction } from "entities/JSCollection";
|
2021-09-08 17:32:22 +00:00
|
|
|
import ReadOnlyEditor from "components/editorComponents/ReadOnlyEditor";
|
2023-05-19 18:37:06 +00:00
|
|
|
import { Text } from "design-system";
|
2021-09-08 17:32:22 +00:00
|
|
|
import LoadingOverlayScreen from "components/editorComponents/LoadingOverlayScreen";
|
2023-12-13 10:46:27 +00:00
|
|
|
import type { JSCollectionData } from "@appsmith/reducers/entityReducers/jsActionsReducer";
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### Test Plan
> Add Testsmith test cases links that relate to this PR
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
import type { EvaluationError } from "utils/DynamicBindingUtils";
|
2021-10-07 06:53:58 +00:00
|
|
|
import { DEBUGGER_TAB_KEYS } from "./Debugger/helpers";
|
2024-02-29 06:23:57 +00:00
|
|
|
import type { BottomTab } from "./EntityBottomTabs";
|
2021-10-07 06:53:58 +00:00
|
|
|
import EntityBottomTabs from "./EntityBottomTabs";
|
2023-01-23 03:50:47 +00:00
|
|
|
import { TAB_MIN_HEIGHT } from "design-system-old";
|
2022-04-28 16:51:02 +00:00
|
|
|
import { CodeEditorWithGutterStyles } from "pages/Editor/JSEditor/constants";
|
2022-05-19 13:13:51 +00:00
|
|
|
import { getIsSavingEntity } from "selectors/editorSelectors";
|
|
|
|
|
import { getJSResponseViewState } from "./utils";
|
2024-02-29 06:23:57 +00:00
|
|
|
import { getFilteredErrors } from "selectors/debuggerSelectors";
|
2022-10-20 12:08:48 +00:00
|
|
|
import { ActionExecutionResizerHeight } from "pages/Editor/APIEditor/constants";
|
2023-04-10 12:59:14 +00:00
|
|
|
import {
|
2023-05-19 18:37:06 +00:00
|
|
|
NoResponse,
|
2023-04-10 12:59:14 +00:00
|
|
|
ResponseTabErrorContainer,
|
|
|
|
|
ResponseTabErrorContent,
|
|
|
|
|
} from "./ApiResponseView";
|
|
|
|
|
import LogHelper from "./Debugger/ErrorLogs/components/LogHelper";
|
|
|
|
|
import LOG_TYPE from "entities/AppsmithConsole/logtype";
|
|
|
|
|
import type { SourceEntity, Log } from "entities/AppsmithConsole";
|
chore: Import debugger fixes (#31080)
## Description
To add debugger error for import path for module instance on EE, this PR
enables code to be extended on EE
#### PR fixes following issue(s)
Fixes # (issue number)
> 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
> Please delete options that are not relevant.
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Chore (housekeeping or task changes that don't impact user perception)
- This change requires a documentation update
>
>
>
## 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
- [ ] Manual
- [ ] JUnit
- [ ] Jest
- [ ] Cypress
>
>
#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### 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
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] 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/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] 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
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Refactor**
- Updated import paths and references for `ENTITY_TYPE` to
`EntityTypeValue` across various components and utilities for improved
code consistency.
- Reorganized import statements related to `AppsmithConsole` utilities
and constants to enhance code maintainability.
- Adjusted usage of enums and types, specifically for entity and
platform error handling, to align with updated import paths.
- **New Features**
- Introduced utility functions for handling entity types and platform
errors in AppsmithConsole, including new constants and error retrieval
functions.
- Added a new enum value `MISSING_MODULE` to better categorize log types
in debugging scenarios.
- **Bug Fixes**
- Implemented changes to error logging and handling mechanisms,
including the addition of new case handling for
`LOG_TYPE.MISSING_MODULE` in debugger logs, to improve the debugging
experience.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-14 06:30:18 +00:00
|
|
|
import { ENTITY_TYPE } from "@appsmith/entities/AppsmithConsole/utils";
|
2023-05-19 18:37:06 +00:00
|
|
|
import { CloseDebugger } from "./Debugger/DebuggerTabs";
|
2024-02-29 06:23:57 +00:00
|
|
|
import { getJsPaneDebuggerState } from "selectors/jsPaneSelectors";
|
|
|
|
|
import { setJsPaneDebuggerState } from "actions/jsPaneActions";
|
|
|
|
|
import { getIDEViewMode } from "selectors/ideSelectors";
|
|
|
|
|
import { EditorViewMode } from "@appsmith/entities/IDE/constants";
|
|
|
|
|
import ErrorLogs from "./Debugger/Errors";
|
2024-05-04 00:16:37 +00:00
|
|
|
import { isBrowserExecutionAllowed } from "@appsmith/utils/actionExecutionUtils";
|
|
|
|
|
import JSRemoteExecutionView from "@appsmith/components/JSRemoteExecutionView";
|
2021-09-08 17:32:22 +00:00
|
|
|
|
|
|
|
|
const ResponseContainer = styled.div`
|
2023-05-19 18:37:06 +00:00
|
|
|
${ResizerCSS};
|
2021-09-08 17:32:22 +00:00
|
|
|
width: 100%;
|
|
|
|
|
// Minimum height of bottom tabs as it can be resized
|
2022-04-28 16:51:02 +00:00
|
|
|
min-height: ${TAB_MIN_HEIGHT};
|
2023-05-19 18:37:06 +00:00
|
|
|
background-color: var(--ads-v2-color-bg);
|
2022-10-20 12:08:48 +00:00
|
|
|
height: ${ActionExecutionResizerHeight}px;
|
2023-12-09 14:54:43 +00:00
|
|
|
border-top: 1px solid var(--ads-v2-color-border);
|
2021-09-08 17:32:22 +00:00
|
|
|
|
2023-05-19 18:37:06 +00:00
|
|
|
.ads-v2-tabs__panel {
|
|
|
|
|
${CodeEditorWithGutterStyles};
|
2022-04-28 16:51:02 +00:00
|
|
|
overflow-y: auto;
|
|
|
|
|
height: calc(100% - ${TAB_MIN_HEIGHT});
|
2021-09-08 17:32:22 +00:00
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const ResponseTabWrapper = styled.div`
|
|
|
|
|
display: flex;
|
|
|
|
|
width: 100%;
|
2023-10-24 06:15:43 +00:00
|
|
|
height: 100%;
|
2023-05-19 18:37:06 +00:00
|
|
|
|
2021-09-21 06:02:45 +00:00
|
|
|
&.disable * {
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
}
|
2021-11-08 06:49:22 +00:00
|
|
|
.response-run {
|
|
|
|
|
margin: 0 10px;
|
|
|
|
|
}
|
2021-09-08 17:32:22 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const TabbedViewWrapper = styled.div`
|
2021-10-04 11:08:02 +00:00
|
|
|
height: 100%;
|
2021-09-08 17:32:22 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const ResponseViewer = styled.div`
|
2022-04-28 16:51:02 +00:00
|
|
|
width: 100%;
|
2023-05-19 18:37:06 +00:00
|
|
|
padding: 0 var(--ads-v2-spaces-7);
|
2021-09-08 17:32:22 +00:00
|
|
|
`;
|
2021-09-28 07:31:46 +00:00
|
|
|
|
2022-04-28 16:51:02 +00:00
|
|
|
const NoReturnValueWrapper = styled.div`
|
|
|
|
|
padding-left: ${(props) => props.theme.spaces[12]}px;
|
|
|
|
|
padding-top: ${(props) => props.theme.spaces[6]}px;
|
|
|
|
|
`;
|
|
|
|
|
|
2022-05-19 13:13:51 +00:00
|
|
|
export enum JSResponseState {
|
2022-04-28 16:51:02 +00:00
|
|
|
IsExecuting = "IsExecuting",
|
|
|
|
|
IsDirty = "IsDirty",
|
2022-05-19 13:13:51 +00:00
|
|
|
IsUpdating = "IsUpdating",
|
2022-04-28 16:51:02 +00:00
|
|
|
NoResponse = "NoResponse",
|
|
|
|
|
ShowResponse = "ShowResponse",
|
|
|
|
|
NoReturnValue = "NoReturnValue",
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-08 17:32:22 +00:00
|
|
|
interface ReduxStateProps {
|
2023-12-09 14:54:43 +00:00
|
|
|
errorCount: number;
|
2021-09-08 17:32:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Props = ReduxStateProps &
|
|
|
|
|
RouteComponentProps<JSEditorRouteParams> & {
|
2022-04-28 16:51:02 +00:00
|
|
|
currentFunction: JSAction | null;
|
2021-09-08 17:32:22 +00:00
|
|
|
theme?: EditorTheme;
|
2021-09-21 06:02:45 +00:00
|
|
|
errors: Array<EvaluationError>;
|
2022-04-28 16:51:02 +00:00
|
|
|
disabled: boolean;
|
|
|
|
|
isLoading: boolean;
|
|
|
|
|
onButtonClick: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
2023-12-09 14:54:43 +00:00
|
|
|
jsCollectionData: JSCollectionData | undefined;
|
2021-09-08 17:32:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function JSResponseView(props: Props) {
|
2022-04-28 16:51:02 +00:00
|
|
|
const {
|
|
|
|
|
currentFunction,
|
|
|
|
|
disabled,
|
2023-04-10 12:59:14 +00:00
|
|
|
errorCount,
|
2022-04-28 16:51:02 +00:00
|
|
|
errors,
|
|
|
|
|
isLoading,
|
2023-12-09 14:54:43 +00:00
|
|
|
jsCollectionData,
|
2022-04-28 16:51:02 +00:00
|
|
|
onButtonClick,
|
|
|
|
|
} = props;
|
|
|
|
|
const [responseStatus, setResponseStatus] = useState<JSResponseState>(
|
|
|
|
|
JSResponseState.NoResponse,
|
|
|
|
|
);
|
2023-12-09 14:54:43 +00:00
|
|
|
const jsObject = jsCollectionData?.config;
|
|
|
|
|
const responses = (jsCollectionData && jsCollectionData.data) || {};
|
|
|
|
|
const isDirty = (jsCollectionData && jsCollectionData.isDirty) || {};
|
|
|
|
|
const isExecuting = (jsCollectionData && jsCollectionData.isExecuting) || {};
|
2021-09-08 17:32:22 +00:00
|
|
|
const panelRef: RefObject<HTMLDivElement> = useRef(null);
|
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
const response =
|
2022-04-28 16:51:02 +00:00
|
|
|
currentFunction && currentFunction.id && currentFunction.id in responses
|
|
|
|
|
? responses[currentFunction.id]
|
2021-09-08 17:32:22 +00:00
|
|
|
: "";
|
2022-05-19 10:57:49 +00:00
|
|
|
// parse error found while trying to execute function
|
|
|
|
|
const hasExecutionParseErrors = responseStatus === JSResponseState.IsDirty;
|
|
|
|
|
// error found while trying to parse JS Object
|
|
|
|
|
const hasJSObjectParseError = errors.length > 0;
|
2022-05-19 13:13:51 +00:00
|
|
|
const isSaving = useSelector(getIsSavingEntity);
|
2022-04-28 16:51:02 +00:00
|
|
|
useEffect(() => {
|
2022-05-19 13:13:51 +00:00
|
|
|
setResponseStatus(
|
|
|
|
|
getJSResponseViewState(
|
|
|
|
|
currentFunction,
|
|
|
|
|
isDirty,
|
|
|
|
|
isExecuting,
|
|
|
|
|
isSaving,
|
|
|
|
|
responses,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}, [responses, isExecuting, currentFunction, isSaving, isDirty]);
|
2023-04-10 12:59:14 +00:00
|
|
|
|
|
|
|
|
const filteredErrors = useSelector(getFilteredErrors);
|
|
|
|
|
let errorMessage: string | undefined;
|
|
|
|
|
let errorType = "ValidationError";
|
|
|
|
|
|
2024-05-04 00:16:37 +00:00
|
|
|
const localExecutionAllowed = useMemo(() => {
|
|
|
|
|
return isBrowserExecutionAllowed(
|
|
|
|
|
jsCollectionData?.config,
|
|
|
|
|
currentFunction || undefined,
|
|
|
|
|
);
|
|
|
|
|
}, [jsCollectionData?.config, currentFunction]);
|
|
|
|
|
|
2023-04-10 12:59:14 +00:00
|
|
|
// action source for analytics.
|
|
|
|
|
let actionSource: SourceEntity = {
|
|
|
|
|
type: ENTITY_TYPE.JSACTION,
|
|
|
|
|
name: "",
|
|
|
|
|
id: "",
|
|
|
|
|
};
|
|
|
|
|
try {
|
|
|
|
|
let errorObject: Log | undefined;
|
|
|
|
|
//get JS execution error from redux store.
|
|
|
|
|
if (
|
2023-12-09 14:54:43 +00:00
|
|
|
jsCollectionData &&
|
|
|
|
|
jsCollectionData.config &&
|
|
|
|
|
jsCollectionData.activeJSActionId
|
2023-04-10 12:59:14 +00:00
|
|
|
) {
|
|
|
|
|
every(filteredErrors, (error) => {
|
|
|
|
|
if (
|
|
|
|
|
includes(
|
|
|
|
|
error.id,
|
2023-12-09 14:54:43 +00:00
|
|
|
jsCollectionData?.config.id +
|
2023-04-10 12:59:14 +00:00
|
|
|
"-" +
|
2023-12-09 14:54:43 +00:00
|
|
|
jsCollectionData?.activeJSActionId,
|
2023-04-10 12:59:14 +00:00
|
|
|
)
|
|
|
|
|
) {
|
|
|
|
|
errorObject = error;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// update error message.
|
|
|
|
|
if (errorObject) {
|
|
|
|
|
if (errorObject.source) {
|
|
|
|
|
// update action source.
|
|
|
|
|
actionSource = errorObject.source;
|
|
|
|
|
}
|
|
|
|
|
if (errorObject.messages) {
|
|
|
|
|
// update error message.
|
|
|
|
|
errorMessage =
|
|
|
|
|
errorObject.messages[0].message.name +
|
|
|
|
|
": " +
|
|
|
|
|
errorObject.messages[0].message.message;
|
|
|
|
|
errorType = errorObject.messages[0].message.name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {}
|
2024-02-29 06:23:57 +00:00
|
|
|
|
|
|
|
|
const ideViewMode = useSelector(getIDEViewMode);
|
|
|
|
|
|
|
|
|
|
const tabs: BottomTab[] = [
|
2021-09-08 17:32:22 +00:00
|
|
|
{
|
2022-06-30 07:21:20 +00:00
|
|
|
key: "response",
|
2021-09-08 17:32:22 +00:00
|
|
|
title: "Response",
|
|
|
|
|
panelComponent: (
|
2021-09-21 06:02:45 +00:00
|
|
|
<>
|
2023-04-10 12:59:14 +00:00
|
|
|
{(hasExecutionParseErrors ||
|
|
|
|
|
(hasJSObjectParseError && errorMessage)) && (
|
|
|
|
|
<ResponseTabErrorContainer>
|
|
|
|
|
<ResponseTabErrorContent>
|
|
|
|
|
<div className="t--js-response-parse-error-call-out">
|
|
|
|
|
{errorMessage}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<LogHelper
|
|
|
|
|
logType={LOG_TYPE.EVAL_ERROR}
|
|
|
|
|
name={errorType}
|
|
|
|
|
source={actionSource}
|
|
|
|
|
/>
|
|
|
|
|
</ResponseTabErrorContent>
|
|
|
|
|
</ResponseTabErrorContainer>
|
2022-04-28 16:51:02 +00:00
|
|
|
)}
|
|
|
|
|
<ResponseTabWrapper className={errors.length ? "disable" : ""}>
|
|
|
|
|
<ResponseViewer>
|
2021-09-21 06:02:45 +00:00
|
|
|
<>
|
2024-05-04 00:16:37 +00:00
|
|
|
{localExecutionAllowed && (
|
|
|
|
|
<>
|
|
|
|
|
{responseStatus === JSResponseState.NoResponse && (
|
|
|
|
|
<NoResponse
|
|
|
|
|
isButtonDisabled={disabled}
|
|
|
|
|
isQueryRunning={isLoading}
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
onRunClick={onButtonClick}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
{responseStatus === JSResponseState.IsExecuting && (
|
|
|
|
|
<LoadingOverlayScreen theme={props.theme}>
|
|
|
|
|
{createMessage(EXECUTING_FUNCTION)}
|
|
|
|
|
</LoadingOverlayScreen>
|
|
|
|
|
)}
|
|
|
|
|
{responseStatus === JSResponseState.NoReturnValue && (
|
|
|
|
|
<NoReturnValueWrapper>
|
|
|
|
|
<Text kind="body-m">
|
|
|
|
|
{createMessage(
|
|
|
|
|
NO_JS_FUNCTION_RETURN_VALUE,
|
|
|
|
|
currentFunction?.name,
|
|
|
|
|
)}
|
|
|
|
|
</Text>
|
|
|
|
|
</NoReturnValueWrapper>
|
|
|
|
|
)}
|
|
|
|
|
{responseStatus === JSResponseState.ShowResponse && (
|
|
|
|
|
<ReadOnlyEditor
|
|
|
|
|
folding
|
|
|
|
|
height={"100%"}
|
|
|
|
|
input={{
|
|
|
|
|
value: response as string,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
2022-04-28 16:51:02 +00:00
|
|
|
)}
|
2024-05-04 00:16:37 +00:00
|
|
|
{!localExecutionAllowed && (
|
|
|
|
|
<JSRemoteExecutionView collectionData={jsCollectionData} />
|
2022-04-28 16:51:02 +00:00
|
|
|
)}
|
2022-05-19 13:13:51 +00:00
|
|
|
{responseStatus === JSResponseState.IsUpdating && (
|
|
|
|
|
<LoadingOverlayScreen theme={props.theme}>
|
|
|
|
|
{createMessage(UPDATING_JS_COLLECTION)}
|
|
|
|
|
</LoadingOverlayScreen>
|
|
|
|
|
)}
|
2021-09-21 06:02:45 +00:00
|
|
|
</>
|
2022-04-28 16:51:02 +00:00
|
|
|
</ResponseViewer>
|
2021-09-21 06:02:45 +00:00
|
|
|
</ResponseTabWrapper>
|
|
|
|
|
</>
|
2021-09-08 17:32:22 +00:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-10-07 06:53:58 +00:00
|
|
|
key: DEBUGGER_TAB_KEYS.LOGS_TAB,
|
2021-09-08 17:32:22 +00:00
|
|
|
title: createMessage(DEBUGGER_LOGS),
|
|
|
|
|
panelComponent: <DebuggerLogs searchQuery={jsObject?.name} />,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
2024-02-29 06:23:57 +00:00
|
|
|
if (ideViewMode === EditorViewMode.FullScreen) {
|
|
|
|
|
tabs.push({
|
|
|
|
|
key: DEBUGGER_TAB_KEYS.ERROR_TAB,
|
|
|
|
|
title: createMessage(DEBUGGER_ERRORS),
|
|
|
|
|
count: errorCount,
|
|
|
|
|
panelComponent: <ErrorLogs />,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-10 12:59:14 +00:00
|
|
|
// get the selected tab from the store.
|
2024-02-29 06:23:57 +00:00
|
|
|
const { open, responseTabHeight, selectedTab } = useSelector(
|
|
|
|
|
getJsPaneDebuggerState,
|
|
|
|
|
);
|
|
|
|
|
|
2023-04-10 12:59:14 +00:00
|
|
|
// set the selected tab in the store.
|
2022-10-17 15:16:38 +00:00
|
|
|
const setSelectedResponseTab = useCallback((selectedTab: string) => {
|
2024-02-29 06:23:57 +00:00
|
|
|
dispatch(setJsPaneDebuggerState({ selectedTab }));
|
2022-10-17 15:16:38 +00:00
|
|
|
}, []);
|
2023-04-10 12:59:14 +00:00
|
|
|
// set the height of the response pane on resize.
|
2022-10-17 15:16:38 +00:00
|
|
|
const setResponseHeight = useCallback((height: number) => {
|
2024-02-29 06:23:57 +00:00
|
|
|
dispatch(setJsPaneDebuggerState({ responseTabHeight: height }));
|
2022-10-17 15:16:38 +00:00
|
|
|
}, []);
|
|
|
|
|
|
2023-04-10 12:59:14 +00:00
|
|
|
// close the debugger
|
2024-02-29 06:23:57 +00:00
|
|
|
const onClose = () => dispatch(setJsPaneDebuggerState({ open: false }));
|
2023-05-12 05:47:26 +00:00
|
|
|
|
|
|
|
|
// Do not render if header tab is selected in the bottom bar.
|
2024-02-29 06:23:57 +00:00
|
|
|
return open && selectedTab ? (
|
2022-10-20 12:08:48 +00:00
|
|
|
<ResponseContainer
|
|
|
|
|
className="t--js-editor-bottom-pane-container"
|
|
|
|
|
ref={panelRef}
|
|
|
|
|
>
|
2022-10-17 15:16:38 +00:00
|
|
|
<Resizer
|
|
|
|
|
initialHeight={responseTabHeight}
|
|
|
|
|
onResizeComplete={setResponseHeight}
|
|
|
|
|
panelRef={panelRef}
|
|
|
|
|
/>
|
2021-09-08 17:32:22 +00:00
|
|
|
<TabbedViewWrapper>
|
2022-04-28 16:51:02 +00:00
|
|
|
<EntityBottomTabs
|
2022-10-20 12:08:48 +00:00
|
|
|
expandedHeight={`${ActionExecutionResizerHeight}px`}
|
2022-10-17 15:16:38 +00:00
|
|
|
onSelect={setSelectedResponseTab}
|
2024-02-29 06:23:57 +00:00
|
|
|
selectedTabKey={selectedTab}
|
2022-04-28 16:51:02 +00:00
|
|
|
tabs={tabs}
|
|
|
|
|
/>
|
2023-04-10 12:59:14 +00:00
|
|
|
|
2023-05-19 18:37:06 +00:00
|
|
|
<CloseDebugger
|
2023-04-10 12:59:14 +00:00
|
|
|
className="close-debugger t--close-debugger"
|
2023-05-19 18:37:06 +00:00
|
|
|
isIconButton
|
|
|
|
|
kind="tertiary"
|
2023-04-10 12:59:14 +00:00
|
|
|
onClick={onClose}
|
2023-05-19 18:37:06 +00:00
|
|
|
size="md"
|
|
|
|
|
startIcon="close-modal"
|
2023-04-10 12:59:14 +00:00
|
|
|
/>
|
2021-09-08 17:32:22 +00:00
|
|
|
</TabbedViewWrapper>
|
|
|
|
|
</ResponseContainer>
|
2023-05-12 05:47:26 +00:00
|
|
|
) : null;
|
2021-09-08 17:32:22 +00:00
|
|
|
}
|
|
|
|
|
|
2023-12-09 14:54:43 +00:00
|
|
|
const mapStateToProps = (state: AppState) => {
|
2023-04-10 12:59:14 +00:00
|
|
|
const errorCount = state.ui.debugger.context.errorCount;
|
2021-09-08 17:32:22 +00:00
|
|
|
return {
|
2023-04-10 12:59:14 +00:00
|
|
|
errorCount,
|
2021-09-08 17:32:22 +00:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(withRouter(JSResponseView));
|