Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix operator prompt hidden for executing, output, and error #4445

Merged
merged 6 commits into from
Jun 4, 2024

Conversation

imanjra
Copy link
Contributor

@imanjra imanjra commented May 31, 2024

What changes are proposed in this pull request?

fix operator prompt hidden for executing, output, and error stages of operator execution

How is this patch tested? If it is not, please explain why.

Manually in the app and E2E

Release Notes

Is this a user-facing change that should be mentioned in the release notes?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release
    notes for FiftyOne users.

Fixed issue where operator prompt is now shown for executing, output, and error stages of operator execution

What areas of FiftyOne does this PR affect?

  • App: FiftyOne application changes
  • Build: Build and test infrastructure changes
  • Core: Core fiftyone Python library changes
  • Documentation: FiftyOne documentation changes
  • Other

Summary by CodeRabbit

  • New Features

    • Added new operators for E2E tests: e2e_say_hello_in_modal, e2e_say_hello_in_drawer, and e2e_progress.
  • Improvements

    • Enhanced operator prompts with additional testing attributes for better testability.
    • Introduced new variables to improve control flow and logic within operator prompt configurations.
    • Added new test cases for interacting with prompt dialogs and drawers in the operators' browser interface.
  • Bug Fixes

    • Removed unused imports and declarations in test files to streamline the codebase.

Copy link
Contributor

coderabbitai bot commented May 31, 2024

Walkthrough

This update enhances the operator prompt interface by adding new data attributes for testing, introducing new control variables in utility functions, and updating end-to-end test scripts. It also includes new classes and configurations for E2E tests, enabling more robust and detailed testing of prompt dialogs and drawers in the operators' browser interface.

Changes

Files/Paths Change Summaries
app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx Added a Box component with data-cy attribute around OperatorPromptBody.
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx Introduced dialogProps with PaperProps containing data-cy attribute.
app/packages/operators/src/utils.ts Added new variables (loading, disableSubmit, disabledReason, and onClose) to getOperatorPromptConfigs.
e2e-pw/src/oss/poms/operators/operators-prompt.ts Introduced OperatorsPromptPom class with methods for prompt interactions and OperatorsPromptAsserter for assertions.
e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts Removed HistogramPom import and histogramPanel declaration.
e2e-pw/src/oss/specs/operators/prompt.spec.ts Added test cases for interacting with prompt dialogs and drawers, including canceling, executing actions, and checking progress indicators.
e2e-pw/src/shared/assets/plugins/e2e/__init__.py Introduced classes E2ESayHelloInModal, E2ESayHelloInDrawer, and E2EProgress for E2E tests, with methods for input resolution, execution, and output resolution.
e2e-pw/src/shared/assets/plugins/e2e/fiftyone.yml Expanded functionality to include new operators for E2E tests: e2e_say_hello_in_modal, e2e_say_hello_in_drawer, and e2e_progress.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant OperatorsPromptPom
    participant OperatorsBrowserPom
    participant E2EProgress

    User->>OperatorsBrowserPom: Initiate Prompt
    OperatorsBrowserPom->>OperatorsPromptPom: Open Modal/Drawer
    OperatorsPromptPom->>E2EProgress: Execute Action
    E2EProgress-->>OperatorsPromptPom: Return Progress
    OperatorsPromptPom-->>OperatorsBrowserPom: Display Progress
    User-->>OperatorsPromptPom: Interact with Prompt
    OperatorsPromptPom-->>User: Provide Feedback
Loading

Poem

In the land of code so bright,
Prompts now shine with testing light,
Modals, drawers, all in view,
Operators' tasks are clear and true.
With progress bars and actions neat,
Our tests ensure the code's complete.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@imanjra imanjra force-pushed the bugfix/missing-operator-prompt branch from d0d0c56 to 3fd57c3 Compare May 31, 2024 20:19
@imanjra imanjra changed the base branch from develop to release/v0.24.1 May 31, 2024 20:19
@imanjra imanjra marked this pull request as ready for review May 31, 2024 23:39
@imanjra imanjra requested review from a team and removed request for a team May 31, 2024 23:39
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Outside diff range and nitpick comments (2)
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1)

Line range hint 26-27: Consider using template literals for better readability and maintainability.

- "Cannot execute operator with validation errors\n\n" + validationErrorsStr
+ `Cannot execute operator with validation errors\n\n${validationErrorsStr}`
app/packages/operators/src/OperatorPrompt/index.tsx (1)

Line range hint 18-20: Remove the unnecessary else clause to simplify the control flow, as the if condition already returns early.

- } else {
-   return null;
- }
+ return null;
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5bf793e and 750be0a.

Files selected for processing (9)
  • app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx (2 hunks)
  • app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1 hunks)
  • app/packages/operators/src/OperatorPrompt/OperatorViewModal.tsx (1 hunks)
  • app/packages/operators/src/OperatorPrompt/index.tsx (1 hunks)
  • e2e-pw/src/oss/poms/operators/operators-prompt.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/prompt.spec.ts (1 hunks)
  • e2e-pw/src/shared/assets/plugins/e2e/init.py (2 hunks)
  • e2e-pw/src/shared/assets/plugins/e2e/fiftyone.yml (1 hunks)
Files skipped from review due to trivial changes (2)
  • app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx
  • app/packages/operators/src/OperatorPrompt/OperatorViewModal.tsx
Additional context used
Path-based instructions (5)
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/poms/operators/operators-prompt.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

app/packages/operators/src/OperatorPrompt/index.tsx (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/specs/operators/prompt.spec.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Biome
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx

[error] 26-27: Template literals are preferred over string concatenation.

e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts

[error] 6-6: Do not use template literals if interpolation and special-character handling are not needed.

e2e-pw/src/oss/poms/operators/operators-prompt.ts

[error] 13-13: Template literals are preferred over string concatenation.

app/packages/operators/src/OperatorPrompt/index.tsx

[error] 18-20: This else clause can be omitted because previous branches break early.

e2e-pw/src/oss/specs/operators/prompt.spec.ts

[error] 6-6: Do not use template literals if interpolation and special-character handling are not needed.

Additional comments not posted (6)
e2e-pw/src/shared/assets/plugins/e2e/fiftyone.yml (1)

8-10: The addition of new E2E operators is consistent with the PR's objectives to enhance testing capabilities.

app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1)

31-31: Adding dialogProps with data-cy attribute enhances testability by providing a way to select this component in E2E tests.

e2e-pw/src/shared/assets/plugins/e2e/__init__.py (1)

26-101: The introduction of new E2E operator classes (E2ESayHelloInModal, E2ESayHelloInDrawer, E2EProgress) is consistent with the PR's objectives to enhance testing capabilities.

e2e-pw/src/oss/specs/operators/prompt.spec.ts (3)

57-69: The test case for canceling the modal prompt is well-structured and covers the necessary interactions.


90-101: The test case for canceling the drawer prompt is well-structured and covers the necessary interactions.


122-140: The test case for checking progress updates in a prompt is well-structured and covers the necessary interactions.

e2e-pw/src/oss/specs/operators/prompt.spec.ts Outdated Show resolved Hide resolved
e2e-pw/src/oss/specs/operators/prompt.spec.ts Outdated Show resolved Hide resolved
e2e-pw/src/oss/specs/operators/prompt.spec.ts Outdated Show resolved Hide resolved
e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts Outdated Show resolved Hide resolved
e2e-pw/src/oss/poms/operators/operators-prompt.ts Outdated Show resolved Hide resolved
@@ -21,5 +23,79 @@ def execute(self, ctx):
return {}


class E2ESayHelloInModal(foo.Operator):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍨

@imanjra imanjra force-pushed the bugfix/missing-operator-prompt branch from 750be0a to fc56d4c Compare June 2, 2024 17:53
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (1)
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1)

Line range hint 26-27: Consider using template literals for constructing dynamic strings to enhance readability.

- "Cannot execute operator with validation errors\n\n" +
-   validationErrorsStr
+ `Cannot execute operator with validation errors\n\n${validationErrorsStr}`
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 750be0a and fc56d4c.

Files selected for processing (8)
  • app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx (2 hunks)
  • app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1 hunks)
  • app/packages/operators/src/OperatorPrompt/OperatorViewModal.tsx (1 hunks)
  • e2e-pw/src/oss/poms/operators/operators-prompt.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/prompt.spec.ts (1 hunks)
  • e2e-pw/src/shared/assets/plugins/e2e/init.py (2 hunks)
  • e2e-pw/src/shared/assets/plugins/e2e/fiftyone.yml (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • app/packages/operators/src/OperatorPrompt/OperatorViewModal.tsx
  • e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts
  • e2e-pw/src/oss/specs/operators/prompt.spec.ts
  • e2e-pw/src/shared/assets/plugins/e2e/init.py
  • e2e-pw/src/shared/assets/plugins/e2e/fiftyone.yml
Additional context used
Path-based instructions (3)
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/poms/operators/operators-prompt.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Biome
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx

[error] 26-27: Template literals are preferred over string concatenation.


[error] 3-4: All these imports are only used as types.

app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx

[error] 7-8: All these imports are only used as types.

e2e-pw/src/oss/poms/operators/operators-prompt.ts

[error] 1-1: Some named imports are only used as types.

Additional comments not posted (5)
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1)

31-31: Ensure the data-cy attribute is consistently used across all test environments.

app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx (2)

35-35: Ensure the data-cy attribute is consistently used across all test environments.


46-48: Adding a data-cy attribute to the Box component enhances the testability of the operator prompt drawer content.

e2e-pw/src/oss/poms/operators/operators-prompt.ts (2)

13-13: Using template literals for constructing dynamic strings enhances readability and maintainability.


1-1: Ensure that named imports are used correctly and consistently across the project.

Verification successful

The verification script successfully identified multiple instances of named imports from "src/oss/fixtures". The imports are consistently using named imports, including the specific case in operators-prompt.ts.

  • e2e-pw/src/oss/poms/operators/operators-prompt.ts:import { Locator, Page, expect } from "src/oss/fixtures";

This confirms that the named imports are used correctly and consistently across the project.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that named imports are used correctly in the project.

# Test: Search for incorrect usage of named imports. Expect: No occurrences of incorrect usage.
rg --type typescript $'import {.*} from "src/oss/fixtures";'

Length of output: 188



Script:

#!/bin/bash
# Description: Verify that named imports are used correctly in the project.

# Test: Search for incorrect usage of named imports. Expect: No occurrences of incorrect usage.
rg --type typescript 'import \{.*\} from "src/oss/fixtures";'

Length of output: 98



Script:

#!/bin/bash
# Description: Verify that named imports are used correctly in the project.

# Test: Search for incorrect usage of named imports. Expect: No occurrences of incorrect usage.
rg --type ts 'import \{.*\} from "src/oss/fixtures";'

Length of output: 6019

Tools
Biome

[error] 1-1: Some named imports are only used as types.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fc56d4c and b16142f.

Files selected for processing (5)
  • app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx (3 hunks)
  • app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1 hunks)
  • app/packages/operators/src/utils.ts (2 hunks)
  • e2e-pw/src/oss/poms/operators/operators-prompt.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/prompt.spec.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • e2e-pw/src/oss/specs/operators/prompt.spec.ts
Additional context used
Path-based instructions (4)
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/poms/operators/operators-prompt.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

app/packages/operators/src/utils.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Biome
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx

[error] 3-4: All these imports are only used as types.

app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx

[error] 7-8: All these imports are only used as types.

e2e-pw/src/oss/poms/operators/operators-prompt.ts

[error] 1-1: Some named imports are only used as types.

app/packages/operators/src/utils.ts

[error] 57-57: Declare variables separately


[error] 57-57: This variable implicitly has the any type.


[error] 59-59: Use === instead of ==.
== is only allowed when comparing against null


[error] 83-83: Template literals are preferred over string concatenation.


[error] 1-2: All these imports are only used as types.


[error] 2-3: Some named imports are only used as types.

Additional comments not posted (5)
app/packages/operators/src/OperatorPrompt/OperatorModalPrompt.tsx (1)

14-14: Added dialogProps to enhance testing capabilities. Ensure it integrates well with existing props.

app/packages/operators/src/OperatorPrompt/OperatorDrawerPrompt.tsx (2)

35-35: Added data-cy attribute to enhance testing capabilities. Ensure it integrates well with existing props.


46-60: Ensure that the new data-cy attributes on the Box and Stack components are correctly utilized in tests.

Verification successful

The data-cy attributes operators-prompt-drawer-content and operators-prompt-drawer-footer are correctly utilized in the test file e2e-pw/src/oss/poms/operators/operators-prompt.ts.

  • e2e-pw/src/oss/poms/operators/operators-prompt.ts:
    • return this.locator.getByTestId("operators-prompt-drawer-content");
    • return this.locator.getByTestId("operators-prompt-drawer-footer");
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that new `data-cy` attributes are utilized in tests.

# Test: Search for the usage of these attributes in test files. Expect: Proper usage in test assertions.
rg --type typescript $'operators-prompt-drawer-content|operators-prompt-drawer-footer'

Length of output: 122



Script:

#!/bin/bash
# Description: Verify that new `data-cy` attributes are utilized in tests.

# Test: Search for the usage of these attributes in test files. Expect: Proper usage in test assertions.
rg --type ts 'operators-prompt-drawer-content|operators-prompt-drawer-footer'
rg --type tsx 'operators-prompt-drawer-content|operators-prompt-drawer-footer'

Length of output: 668

e2e-pw/src/oss/poms/operators/operators-prompt.ts (1)

13-13: Good use of template literals for constructing dynamic strings, enhancing readability and maintainability.

app/packages/operators/src/utils.ts (1)

Line range hint 80-111: Refactored getOperatorPromptConfigs to handle new conditions and states. Ensure all new variables are properly integrated and tested.

Verification successful

The new variables loading, disableSubmit, disabledReason, and onClose are properly integrated and used across multiple files in the codebase. This confirms that the refactored getOperatorPromptConfigs function handles these new conditions and states correctly.

  • loading is used in various contexts, including state management and UI components.
  • disableSubmit and disabledReason are used in components related to form submission and validation.
  • onClose is used in components handling modal or dialog closures.

These usages indicate that the new variables are well-integrated and their handling is consistent with the application's logic.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all new variables in `getOperatorPromptConfigs` are properly integrated.

# Test: Search for the usage of new variables in the application. Expect: Proper integration and handling.
rg --type typescript $'loading|disableSubmit|disabledReason|onClose'

Length of output: 104



Script:

#!/bin/bash
# Description: Verify that all new variables in `getOperatorPromptConfigs` are properly integrated.

# Test: Search for the usage of new variables in the application. Expect: Proper integration and handling.
rg --type ts 'loading|disableSubmit|disabledReason|onClose'

Length of output: 23842

Tools
Biome

[error] 83-83: Template literals are preferred over string concatenation.

validationErrorsStr,
...otherConfigs
} = getOperatorPromptConfigs(prompt);
const promptConfig = getOperatorPromptConfigs(prompt);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Ensure getOperatorPromptConfigs handles the new dialogProps correctly.

The getOperatorPromptConfigs function does not currently handle dialogProps. The function definition and its usage in the codebase do not show any reference to dialogProps. Additionally, the OperatorPromptType does not include dialogProps, and the useOperatorPrompt hook, which defines OperatorPromptType, does not handle dialogProps.

  • app/packages/operators/src/utils.ts: Definition of getOperatorPromptConfigs.
  • app/packages/operators/src/types.ts: Definition of OperatorPromptType.
  • app/packages/operators/src/state.ts: Definition of useOperatorPrompt.

Please update the getOperatorPromptConfigs function and related types to handle dialogProps.

Analysis chain

Ensure getOperatorPromptConfigs handles the new dialogProps correctly.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that `getOperatorPromptConfigs` is updated to handle `dialogProps`.

# Test: Search for the function definition and usage. Expect: Proper handling of `dialogProps`.
rg --type typescript $'getOperatorPromptConfigs'

Length of output: 82



Script:

#!/bin/bash
# Description: Verify that `getOperatorPromptConfigs` is updated to handle `dialogProps`.

# Test: Search for the function definition and usage. Expect: Proper handling of `dialogProps`.
rg --type ts,tsx 'getOperatorPromptConfigs'

Length of output: 74



Script:

#!/bin/bash
# Description: Verify that `getOperatorPromptConfigs` is updated to handle `dialogProps`.

# Test: Search for the function definition and usage. Expect: Proper handling of `dialogProps`.
rg --type ts 'getOperatorPromptConfigs'
rg --type tsx 'getOperatorPromptConfigs'

Length of output: 946



Script:

#!/bin/bash
# Description: Extract the definition of `getOperatorPromptConfigs` to verify handling of `dialogProps`.

# Extract the function definition from `utils.ts`.
rg --type ts --context 10 'export function getOperatorPromptConfigs' app/packages/operators/src/utils.ts

Length of output: 849



Script:

#!/bin/bash
# Description: Verify if `dialogProps` is part of `OperatorPromptType`.

# Search for the definition of `OperatorPromptType`.
rg --type ts 'type OperatorPromptType' --context 10

Length of output: 1992



Script:

#!/bin/bash
# Description: Verify if `dialogProps` is included in the return type of `useOperatorPrompt`.

# Search for the implementation of `useOperatorPrompt`.
rg --type ts,tsx 'function useOperatorPrompt' --context 20

Length of output: 91



Script:

#!/bin/bash
# Description: Verify if `dialogProps` is included in the return type of `useOperatorPrompt`.

# Search for the implementation of `useOperatorPrompt`.
rg --type ts 'function useOperatorPrompt' --context 20
rg --type tsx 'function useOperatorPrompt' --context 20

Length of output: 142



Script:

#!/bin/bash
# Description: Locate custom hooks in the codebase to find the `useOperatorPrompt` function.

# Search for custom hooks in the codebase.
rg --type ts,tsx 'function use' --context 20

Length of output: 77



Script:

#!/bin/bash
# Description: Locate custom hooks in the codebase to find the `useOperatorPrompt` function.

# Search for custom hooks in `.ts` files.
rg --type ts 'function use' --context 20

# Search for custom hooks in `.tsx` files.
rg --type tsx 'function use' --context 20

Length of output: 164647



Script:

#!/bin/bash
# Description: Locate the `useOperatorPrompt` function in `.ts` files to verify handling of `dialogProps`.

# Search for the `useOperatorPrompt` function in `.ts` files.
rg --type ts 'useOperatorPrompt' --context 20

Length of output: 19100

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b16142f and 5bd31d8.

Files selected for processing (2)
  • e2e-pw/src/oss/poms/operators/operators-prompt.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/prompt.spec.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • e2e-pw/src/oss/poms/operators/operators-prompt.ts
  • e2e-pw/src/oss/specs/operators/prompt.spec.ts

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5bd31d8 and b202aa0.

Files selected for processing (2)
  • e2e-pw/src/oss/poms/operators/operators-prompt.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/prompt.spec.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • e2e-pw/src/oss/poms/operators/operators-prompt.ts
  • e2e-pw/src/oss/specs/operators/prompt.spec.ts

Copy link
Contributor

@benjaminpkane benjaminpkane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀 Specs and POMs look awesome! I moved validation to the asserter based on best practices from @sashankaryal. But somewhat subjective, minor detail

const loading = resolving || pendingResolve;
const disableSubmit = hasValidationErrors || resolving || pendingResolve;
const disabledReason = hasValidationErrors
? "Cannot execute operator with validation errors\n\n" + validationErrorsStr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be helpful to put these messages as const variables somewhere. Not important for this PR

@benjaminpkane benjaminpkane merged commit d2ca5f7 into release/v0.24.1 Jun 4, 2024
16 checks passed
@benjaminpkane benjaminpkane deleted the bugfix/missing-operator-prompt branch June 4, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants