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

chore: Moving action settings from editor form to toolbar #36894

Merged
merged 17 commits into from
Oct 18, 2024

Conversation

ankitakinger
Copy link
Contributor

@ankitakinger ankitakinger commented Oct 16, 2024

Description

Moving action settings from editor form to toolbar to follow the new designs under action redesign project.

Fixes #35512 #34670 #35535

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11384449381
Commit: 027e2a3
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Thu, 17 Oct 2024 12:40:29 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced new components for managing API and query settings in the Plugin Action Settings.
    • Added functionality to open plugin action settings directly from the toolbar.
    • Implemented a settings popover interface for improved user interaction.
    • Added documentation links for QUERY_SETTINGS to enhance user guidance.
  • Improvements

    • Simplified rendering logic in the Plugin Action Form for better performance.
    • Updated form naming conventions for consistency across API and GraphQL editors.
    • Streamlined configuration settings by replacing subtitle with tooltipText for clarity.
    • Enhanced styling in Action Settings for better layout and user experience.
  • Bug Fixes

    • Corrected the navigation logic to open plugin action settings instead of debugger state.

These enhancements aim to improve user experience and streamline plugin action management.

Copy link
Contributor

coderabbitai bot commented Oct 16, 2024

Walkthrough

The pull request introduces several modifications across various components related to plugin action settings. Key changes include consolidating conditional rendering logic in the PluginActionForm, renaming constants in the APIEditorForm and GraphQLEditorForm, and adding new components for managing plugin action settings. Additionally, the PluginActionToolbar has been updated to integrate the new settings component, and Redux store functionalities have been enhanced to manage the state of these settings effectively.

Changes

File Path Change Summary
app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx Consolidated conditional rendering for UQIEditorForm.
app/client/src/PluginActionEditor/components/PluginActionForm/components/APIEditorForm.tsx
app/client/src/pages/Editor/APIEditor/RestAPIForm.tsx
app/client/src/pages/Editor/APIEditor/GraphQL/GraphQLEditorForm.tsx
app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/GraphQLEditorForm.tsx
Replaced local constant FORM_NAME with API_EDITOR_FORM_NAME in multiple components.
app/client/src/PluginActionEditor/components/PluginActionSettings/ApiSettings.tsx
app/client/src/PluginActionEditor/components/PluginActionSettings/QuerySettings.tsx
Introduced new components for Redux form functionality in PluginActionSettingsPopover.
app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx
app/client/src/PluginActionEditor/components/PluginActionSettings/index.tsx
Added PluginActionSettingsPopover component and updated index.tsx to render settings based on plugin properties.
app/client/src/PluginActionEditor/components/PluginActionToolbar.tsx Integrated PluginActionSettings component into the toolbar, replacing an existing button.
app/client/src/PluginActionEditor/store/pluginActionEditorActions.ts
app/client/src/PluginActionEditor/store/pluginActionEditorSelectors.ts
app/client/src/PluginActionEditor/store/pluginEditorReducer.ts
app/client/src/ce/constants/ReduxActionConstants.tsx
Added functionalities for managing plugin action settings, including new actions and state properties.
app/client/src/pages/Editor/QueryEditor/QueryResponseTab.tsx Renamed function setPluginActionEditorDebuggerState to openPluginActionSettings in the navigateToSettings callback.

Assessment against linked issues

Objective Addressed Explanation
Convert action settings to a popup and trigger point to a toggle (35512)

Possibly related PRs

Suggested labels

Enhancement

Suggested reviewers

  • AmanAgarwal041
  • ayushpahwa
  • hetunandu

🎉 In the realm of code, changes abound,
With settings and forms, new logic is found.
The toolbar now dances with settings in tow,
A pop-up for actions, watch how they glow!
So here’s to the updates, both clever and bright,
In the world of plugins, we soar to new heights! 🚀


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8dbb2fa and 027e2a3.

📒 Files selected for processing (2)
  • app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx (1 hunks)
  • app/client/src/pages/Editor/ActionSettings.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx
  • app/client/src/pages/Editor/ActionSettings.tsx

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@ankitakinger ankitakinger requested review from albinAppsmith and hetunandu and removed request for ayushpahwa October 16, 2024 04:33
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: 2

🧹 Outside diff range and nitpick comments (8)
app/client/src/PluginActionEditor/components/PluginActionSettings/ApiSettings.tsx (1)

1-5: Well done on your imports, class! Let's make a small improvement.

Your imports are looking good, and I'm pleased to see you're using type imports. However, let's tidy up a bit:

Consider grouping your imports by their origin:

import { reduxForm } from "redux-form";
import { API_EDITOR_FORM_NAME } from "ee/constants/forms";
import PluginActionSettingsPopover, {
  type SettingsProps,
} from "./SettingsPopover";

This organization makes it easier to distinguish between external libraries, internal modules, and local imports. Remember, a tidy codebase is a happy codebase!

app/client/src/PluginActionEditor/components/PluginActionSettings/QuerySettings.tsx (1)

7-10: Excellent work on your component export, students!

Let's break down what we're seeing here:

  1. We're using the reduxForm higher-order component to wrap our PluginActionSettingsPopover. This is like giving our component a special Redux Form backpack!
  2. We've set the form name using our constant. Remember, consistency is key in coding!
  3. We've enabled reinitialization. This means our form can update when its initial values change - very useful!

However, there's always room for improvement. Can anyone tell me what we could do better?

Consider replacing unknown with a more specific type for your form values. It's like labeling your lunchbox - the more specific, the better!

-export default reduxForm<unknown, SettingsProps>({
+export default reduxForm<YourFormValuesType, SettingsProps>({

Remember, class, specific types help us catch errors early and make our code easier to understand!

app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx (1)

22-25: Well done, class! This code consolidation deserves a gold star!

You've successfully simplified the conditional rendering of the UQIEditorForm. This change reduces code duplication and improves readability. Excellent work!

However, to make it even better, we could use the logical OR operator (||) instead of the current syntax. Here's a small homework assignment for you:

Try refactoring the condition like this:

-      {(plugin.uiComponent === UIComponentTypes.DbEditorForm ||
-        plugin.uiComponent === UIComponentTypes.UQIDbEditorForm) && (
+      {[UIComponentTypes.DbEditorForm, UIComponentTypes.UQIDbEditorForm].includes(plugin.uiComponent) && (
         <UQIEditorForm />
       )}

This approach is more concise and easier to extend if more UIComponentTypes need to be added in the future. Keep up the good work!

app/client/src/PluginActionEditor/store/pluginActionEditorActions.ts (1)

22-22: Here's a small homework assignment to make our code even better!

While your implementation is spot-on, we can always strive for excellence in documentation. Consider adding a brief comment above the function to explain its purpose. This will help your fellow students (I mean, developers) understand the function's role at a glance. Here's an example:

// Opens or closes the plugin action settings popup in the toolbar
export const openPluginActionSettings = (payload: boolean) => ({
  // ... rest of the function
});

Remember, clear documentation is like showing your work in math class - it helps others follow your thinking!

app/client/src/PluginActionEditor/store/pluginActionEditorSelectors.ts (1)

63-64: Well done, class! Let's review this new addition.

Good job on adding the isPluginActionSettingsOpen selector function. It follows the established pattern in our codebase and is placed appropriately at the end of the file. The function name clearly describes its purpose, which is excellent for readability.

For consistency with other selector functions in this file, consider using createSelector from the reselect library. This approach can help with memoization and potentially improve performance.

Here's a small homework assignment to improve your code:

-export const isPluginActionSettingsOpen = (state: AppState) =>
-  state.ui.pluginActionEditor.settingsOpen;
+export const isPluginActionSettingsOpen = createSelector(
+  (state: AppState) => state.ui.pluginActionEditor.settingsOpen,
+  (settingsOpen) => settingsOpen
+);

This change aligns your new function with the style of other selectors in this file. Keep up the good work!

app/client/src/PluginActionEditor/components/PluginActionToolbar.tsx (1)

55-55: A gold star for implementing the new settings component!

You've successfully integrated the PluginActionSettings component into our toolbar, which is precisely what we aimed for in our lesson plan. This change effectively moves the action settings from the editor form to the toolbar, as outlined in our project objectives.

To make your work even more exemplary, consider adding a brief comment above this line explaining the purpose of the PluginActionSettings component. This will help your classmates understand its role in the toolbar.

Here's a suggested comment to add above the component:

// Render the action settings component in the toolbar
<PluginActionSettings />
app/client/src/PluginActionEditor/store/pluginEditorReducer.ts (1)

175-182: Attention, class! We have a new action handler to discuss.

This new handler for OPEN_PLUGIN_ACTION_SETTINGS is like adding a new rule to our classroom. When this action is dispatched, it's as if a student has raised their hand to open or close the settings.

The implementation is correct and follows our established patterns. However, to make it even clearer for future students (I mean, developers), we could add a small comment explaining the purpose of this handler.

Here's a suggested improvement:

[ReduxActionTypes.OPEN_PLUGIN_ACTION_SETTINGS]: (
  state: PluginActionEditorState,
  action: ReduxAction<{ settingsOpen: boolean }>,
) => {
  // Update the visibility state of the plugin action settings
  const { settingsOpen } = action.payload;
  state.settingsOpen = settingsOpen;
},

Remember, clear code is like a well-explained lesson - it helps everyone understand and learn!

app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx (1)

25-25: Remember to Address the TODO Comment Regarding Custom Width

Please ensure to remove the SettingsWrapper component after the custom width issue is resolved on the server side, as noted in the TODO comment. It's important to keep the codebase clean and up-to-date to maintain readability and maintainability.

If you need assistance with this task or would like me to open a new GitHub issue to track it, please let me know.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 16c4a27 and b010259.

📒 Files selected for processing (15)
  • app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/APIEditorForm.tsx (2 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/GraphQLEditorForm.tsx (2 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionSettings/ApiSettings.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionSettings/QuerySettings.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionSettings/index.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionToolbar.tsx (2 hunks)
  • app/client/src/PluginActionEditor/store/pluginActionEditorActions.ts (1 hunks)
  • app/client/src/PluginActionEditor/store/pluginActionEditorSelectors.ts (1 hunks)
  • app/client/src/PluginActionEditor/store/pluginEditorReducer.ts (3 hunks)
  • app/client/src/ce/constants/ReduxActionConstants.tsx (1 hunks)
  • app/client/src/pages/Editor/APIEditor/GraphQL/GraphQLEditorForm.tsx (3 hunks)
  • app/client/src/pages/Editor/APIEditor/RestAPIForm.tsx (3 hunks)
  • app/client/src/pages/Editor/QueryEditor/QueryResponseTab.tsx (2 hunks)
🧰 Additional context used
🔇 Additional comments (30)
app/client/src/PluginActionEditor/components/PluginActionSettings/ApiSettings.tsx (1)

7-10: Excellent work on your Redux form configuration! Let's refine it further.

Your use of reduxForm is spot on, and I'm thrilled to see you're using the constant for the form name. The enableReinitialize option is a smart choice too!

However, let's make your code even more robust:

export default reduxForm<FormData, SettingsProps>({
  form: API_EDITOR_FORM_NAME,
  enableReinitialize: true,
})(PluginActionSettingsPopover);

Replace unknown with FormData, where FormData is an interface representing the structure of your form data. This will provide better type safety and make your code more self-documenting. Remember, clear types are like clear handwriting - they make everything easier to understand!

Let's check if FormData is already defined:

If FormData isn't defined yet, consider adding it to improve your type definitions. Keep up the good work!

✅ Verification successful

Great job identifying the issue with the previous search attempt! Let's refine our approach to successfully locate the FormData interface.

This script adjusts the --type flag to ts, which is the correct identifier for TypeScript files in ripgrep. Execute this script to verify whether the FormData interface is defined within your codebase.


Great effort in enhancing the type safety of your Redux form configuration!

However, it appears that the FormData interface isn't defined in your codebase. Instead, there's an existing FormDataState interface that you can utilize for better type safety.

  • Update the generic type parameter from unknown to FormDataState:

    export default reduxForm<FormDataState, SettingsProps>({
      form: API_EDITOR_FORM_NAME,
      enableReinitialize: true,
    })(PluginActionSettingsPopover);

This change will provide clearer type definitions and improve the maintainability of your code.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for FormData interface definition

# Test: Search for FormData interface. Expect: Definition of FormData interface.
rg --type typescript 'interface FormData'

Length of output: 78


Script:

#!/bin/bash
# Description: Check for FormData interface definition using the correct TypeScript file type

# Test: Search for FormData interface in TypeScript files. Expect: Definition of FormData interface.
rg 'interface FormData' --type ts

Length of output: 128

app/client/src/PluginActionEditor/components/PluginActionSettings/QuerySettings.tsx (1)

1-5: Well done on your imports, class!

Let's review what we've learned here:

  1. We're using a constant for our form name. This is excellent practice, children!
  2. We're importing the reduxForm higher-order component. This will be crucial for our form management.
  3. We're bringing in our PluginActionSettingsPopover and its props type. Remember, types are our friends in TypeScript!

These imports set us up nicely for the rest of our code. Good job!

app/client/src/PluginActionEditor/components/PluginActionSettings/index.tsx (2)

1-9: Well done on your import statements, class!

You've done a splendid job importing all the necessary modules and components. It's like you've packed your backpack with all the right books for the day's lessons!


24-24: Excellent job on your export statement!

You've correctly exported your PluginActionSettings component as the default export. It's like putting your name at the top of your homework - it lets everyone know exactly what to expect from this file. Keep up the good work!

app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx (1)

Line range hint 1-30: Class, let's discuss how this change relates to our project goals!

While this code improvement is commendable, I noticed it doesn't directly address our main objective of moving action settings from the editor form to the toolbar. Let's have a quick pop quiz:

  1. How does this change contribute to our overall goal?
  2. Are there any other files where we're implementing the toolbar changes?

Remember, it's important to keep our eyes on the prize! Let's make sure all our changes are working towards our main objective.

To help us understand the bigger picture, let's do a little research:

This will help us see if there are other files where the main changes are being implemented. Let's review the results together in our next class!

✅ Verification successful

Toolbar Implementation Verified

Great job! The toolbar changes are successfully implemented in the PluginActionToolbar.tsx file, ensuring that our main objective of moving action settings to the toolbar is achieved.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for files that might be implementing the toolbar changes

echo "Files potentially related to toolbar implementation:"
rg --type typescript --type tsx -l 'toolbar|PluginActionToolbar'

echo "\nFiles with recent changes related to plugin actions:"
git diff --name-only HEAD~5 | grep -i 'pluginaction'

Length of output: 1271

app/client/src/PluginActionEditor/store/pluginActionEditorActions.ts (3)

22-27: Excellent work, class! This new function is a fine addition to our Redux action creators.

The openPluginActionSettings function is well-implemented and aligns perfectly with our lesson on moving action settings to a popup in the toolbar. It follows the standard Redux action creator pattern, which we've been studying all semester. The naming is clear, and the implementation is concise. Well done!


22-28: A gold star for maintaining consistency and organization!

Class, take note of how well this new function integrates with our existing code. It's placed logically after the imports and before other action creators, maintaining our file's neat structure. The implementation style matches our other action creators perfectly, showing excellent adherence to our coding standards. This is a textbook example of how to add new functionality while preserving code consistency.


22-28: Class dismissed with high marks!

Overall, this addition to our codebase is exemplary. The new openPluginActionSettings function is well-implemented, properly integrated, and aligns perfectly with our lesson plan (PR objectives). You've demonstrated a strong grasp of Redux concepts and maintained excellent code quality. With just a small touch-up on documentation, this will be a model example for future lessons. Keep up the great work!

app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/GraphQLEditorForm.tsx (3)

31-31: Well done, class! Let's discuss this change.

Children, notice how we've replaced FORM_NAME with API_EDITOR_FORM_NAME. This is an excellent example of reducing redundancy in our code. By using the imported constant directly, we've made our code cleaner and more maintainable. Remember, in programming, as in life, it's important to keep things simple and avoid unnecessary repetition.


37-37: Excellent consistency, students!

Just like we saw earlier, we've updated the formName prop here as well. This is a prime example of maintaining consistency throughout our code. Remember, class, consistency is key in programming. It makes our code easier to understand and maintain. Keep up the good work!


47-50: Pay attention, class! This is an important change.

In this final modification, we've updated our Redux form configuration. By changing form: FORM_NAME to form: API_EDITOR_FORM_NAME, we ensure that our form is correctly registered with Redux. This is crucial for proper state management in our application.

Think of it like assigning the correct name to your homework. If it's not labeled properly, it might get lost or mixed up with someone else's work. Similarly, in Redux, the correct form name ensures that our form data is stored and retrieved correctly.

Excellent job on maintaining consistency throughout the component!

app/client/src/PluginActionEditor/components/PluginActionForm/components/APIEditorForm.tsx (2)

44-44: Excellent work on updating the formName prop, class!

I'm pleased to see you've updated the formName prop to use the API_EDITOR_FORM_NAME constant. This change enhances code consistency and makes it easier for your classmates to understand the purpose of this form. Keep up the good work!


59-62: Well done on updating the reduxForm configuration!

I'm impressed by your attention to detail in updating the reduxForm configuration. By using the API_EDITOR_FORM_NAME constant here as well, you've ensured consistency throughout the component. This change will help prevent confusion and potential bugs in the future. Remember, class, consistency is key in programming!

app/client/src/PluginActionEditor/components/PluginActionToolbar.tsx (1)

14-14: Excellent addition of the new import, class!

The import of PluginActionSettings is a step in the right direction for our lesson on moving action settings to the toolbar. Well done on following the proper import syntax!

app/client/src/pages/Editor/APIEditor/RestAPIForm.tsx (3)

35-35: Well done, class! This change gets an A+.

You've successfully simplified the code by directly using the API_EDITOR_FORM_NAME constant. This promotes consistency and reduces unnecessary variables. Keep up the good work!


49-49: Excellent work on maintaining consistency!

You've shown great attention to detail by updating the formValueSelector to use API_EDITOR_FORM_NAME directly. This change aligns perfectly with the previous modification. Your code is becoming more coherent and easier to understand. Keep up this level of consistency!


107-107: Outstanding job on completing the refactoring!

You've successfully updated the form property in the reduxForm function to use API_EDITOR_FORM_NAME directly. This change completes the consistent use of the imported constant throughout the file. Let's recap the lesson:

  1. You've removed the unnecessary FORM_NAME constant.
  2. You've directly used API_EDITOR_FORM_NAME in all relevant places.
  3. These changes have made the code more consistent and easier to maintain.

Your refactoring skills are improving! Remember, clean and consistent code is easier to read and maintain. Keep up the excellent work!

app/client/src/pages/Editor/APIEditor/GraphQL/GraphQLEditorForm.tsx (4)

37-37: Good job, class! Let's review this change.

Children, notice how we've replaced FORM_NAME with API_EDITOR_FORM_NAME. This is like when we change the label on our pencil box to make it clearer what's inside. It helps us keep our code organized and easy to understand.


42-42: Well done! Let's examine this change together.

Class, do you see how we've made the same change here in the Pagination component? It's like when we use the same color crayon to underline all the important words in our notebook. This consistency helps us avoid confusion and keeps our code neat and tidy.


102-102: Excellent work! Let's discuss this final change.

Now, children, this last change is very important. It's like writing our name on the front of our assignment before we hand it in. By using API_EDITOR_FORM_NAME here, we're telling Redux (our helper in managing data) exactly which form we're talking about. This ensures that all our form data stays organized and easy to find.


Line range hint 37-102: Class, let's summarize what we've learned today!

We've seen three important changes in our code:

  1. In the GraphQLEditorForm component
  2. In the Pagination component
  3. In the Redux form configuration

By consistently using API_EDITOR_FORM_NAME, we've made our code clearer and easier to understand. It's like using the same label for all the boxes that belong together in our classroom. This helps us keep everything organized and makes it easier for other developers (or your classmates) to understand our code.

Remember, consistency is key in coding, just like in handwriting practice!

app/client/src/PluginActionEditor/store/pluginEditorReducer.ts (2)

31-31: Class, let's examine this new addition to our interface!

The settingsOpen property is a welcome addition to our PluginActionEditorState interface. It's like adding a new chapter to our book of state management. This boolean flag will help us keep track of whether the settings are open or closed, which is crucial for our new toolbar design.

Remember, students, optional properties (denoted by the ?) are like extra credit questions on a test - they're there if you need them, but not required for everyone.


46-46: Now, class, let's turn our attention to the initial state!

Just as we start each school day with a clean chalkboard, our initialState now includes settingsOpen: false. This is like setting the default position of our classroom door - closed until someone decides to open it.

This initialization is crucial, as it ensures that our application starts with a consistent state. Remember, in the world of state management, a well-defined initial state is like a strong foundation for a building - it supports everything that comes after.

app/client/src/pages/Editor/QueryEditor/QueryResponseTab.tsx (3)

41-41: Class, let's examine this import statement change.

Good job on updating the import statement! This change reflects our move towards a more intuitive user interface. By replacing setPluginActionEditorDebuggerState with openPluginActionSettings, we're shifting from manipulating a debugger state to directly opening settings. This aligns perfectly with our lesson plan of relocating action settings to the toolbar.

Remember, children, in programming as in life, clear and direct actions often lead to better user experiences!


221-221: Now, class, let's turn our attention to this function call.

Excellent work on updating the function call! By replacing setPluginActionEditorDebuggerState with openPluginActionSettings(true), we've simplified our code and improved user accessibility. This change means that when a user interacts with this part of the interface, they'll be taken directly to the plugin action settings.

Think of it like this: instead of giving directions to the library (setting a state), we're now opening the library door for our users (directly opening settings). This is a prime example of how small changes can greatly enhance user experience.

Keep up the good work, and remember: in coding as in the classroom, clarity and directness are key to success!


Line range hint 1-368: Class, let's summarize today's lesson on code changes.

Well done on these modifications! You've successfully updated both the import statement and the corresponding function call. These changes are like updating our classroom layout - they make it easier for our "students" (the users) to access important "learning materials" (the plugin action settings).

These alterations, while small, significantly contribute to our goal of moving action settings from the editor form to the toolbar. This new approach will provide a more intuitive and accessible interface for our users.

Remember, class, sometimes the most impactful changes are the simplest ones. Keep up this attention to detail and user-focused thinking in your future code "assignments"!

app/client/src/ce/constants/ReduxActionConstants.tsx (2)

502-502: Well done, class! This addition looks splendid!

I'm pleased to see you've added a new action type OPEN_PLUGIN_ACTION_SETTINGS to our IDEActionTypes object. This is a fine example of expanding our application's capabilities. Remember, children, every new action type we add is like a new tool in our coding toolbox. It allows us to create more interactive and feature-rich experiences for our users.

Keep up the good work, and don't forget to update any relevant documentation to reflect this new action type!


Line range hint 1-1134: Class, let's recap our lesson for today!

We've made a small but significant addition to our Redux action types. The new OPEN_PLUGIN_ACTION_SETTINGS action type in the IDEActionTypes object is like adding a new vocabulary word to our coding language. It will help us communicate more effectively with our application, specifically when dealing with plugin action settings in the IDE.

Remember, every line of code we write has a purpose. This new action type will likely be used to trigger the opening of plugin action settings, enhancing the functionality of our IDE.

As we move forward, keep in mind that maintaining clear and organized constants like these is crucial for a well-structured application. It's like keeping your desk tidy – it helps you find what you need when you need it!

Great job on this addition. Keep up the excellent work, and don't forget to use this new action type appropriately in your future assignments!

app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx (2)

42-47: Verify Popover Closing Behavior

In your useEffect hook, you open the popover whenever openSettings is true. However, when openSettings becomes false, the popover remains open unless manually closed. Ensure this behavior aligns with the desired user experience.

To confirm, please check if the popover should automatically close when openSettings changes to false.


59-90: Excellent Component Structure and Logic

Your PluginActionSettingsPopover component is well-structured and follows best practices. The handling of state, effects, and event callbacks is clear and effective. Great job integrating the various UI components to achieve the desired functionality.

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions github-actions bot added IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Task A simple Todo labels Oct 16, 2024
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11358959512.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36894.
recreate: .

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

hetunandu
hetunandu previously approved these changes Oct 16, 2024
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Oct 16, 2024
Copy link

Deploy-Preview-URL: https://ce-36894.dp.appsmith.com

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

@ankitakinger ankitakinger added the ok-to-test Required label for CI label Oct 16, 2024
@ankitakinger ankitakinger removed the ok-to-test Required label for CI label Oct 16, 2024
Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

@alex-golovanov alex-golovanov self-requested a review October 16, 2024 08:08
@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

Deploy-Preview-URL: https://ce-36894.dp.appsmith.com

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 2, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11384354695.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36894.
recreate: .

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11384454351.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36894.
recreate: .

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 2, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

Copy link

Deploy-Preview-URL: https://ce-36894.dp.appsmith.com

@ankitakinger ankitakinger merged commit faed301 into release Oct 18, 2024
51 checks passed
@ankitakinger ankitakinger deleted the chore/move-action-settings branch October 18, 2024 05:48
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Nov 20, 2024
…g#36894)

## Description

Moving action settings from editor form to toolbar to follow the new
designs under action redesign project.

Fixes [appsmithorg#35512](appsmithorg#35512)
[appsmithorg#34670](appsmithorg#34670)
[appsmithorg#35535](appsmithorg#35535)

## Automation

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

### 🔍 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/11384449381>
> Commit: 027e2a3
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11384449381&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Thu, 17 Oct 2024 12:40:29 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

## Release Notes

- **New Features**
- Introduced new components for managing API and query settings in the
Plugin Action Settings.
- Added functionality to open plugin action settings directly from the
toolbar.
- Implemented a settings popover interface for improved user
interaction.
- Added documentation links for QUERY_SETTINGS to enhance user guidance.

- **Improvements**
- Simplified rendering logic in the Plugin Action Form for better
performance.
- Updated form naming conventions for consistency across API and GraphQL
editors.
- Streamlined configuration settings by replacing `subtitle` with
`tooltipText` for clarity.
- Enhanced styling in Action Settings for better layout and user
experience.

- **Bug Fixes**
- Corrected the navigation logic to open plugin action settings instead
of debugger state.

These enhancements aim to improve user experience and streamline plugin
action management.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Nov 20, 2024
…g#36894)

## Description

Moving action settings from editor form to toolbar to follow the new
designs under action redesign project.

Fixes [appsmithorg#35512](appsmithorg#35512)
[appsmithorg#34670](appsmithorg#34670)
[appsmithorg#35535](appsmithorg#35535)

## Automation

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

### 🔍 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/11384449381>
> Commit: 027e2a3
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11384449381&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Thu, 17 Oct 2024 12:40:29 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

## Release Notes

- **New Features**
- Introduced new components for managing API and query settings in the
Plugin Action Settings.
- Added functionality to open plugin action settings directly from the
toolbar.
- Implemented a settings popover interface for improved user
interaction.
- Added documentation links for QUERY_SETTINGS to enhance user guidance.

- **Improvements**
- Simplified rendering logic in the Plugin Action Form for better
performance.
- Updated form naming conventions for consistency across API and GraphQL
editors.
- Streamlined configuration settings by replacing `subtitle` with
`tooltipText` for clarity.
- Enhanced styling in Action Settings for better layout and user
experience.

- **Bug Fixes**
- Corrected the navigation logic to open plugin action settings instead
of debugger state.

These enhancements aim to improve user experience and streamline plugin
action management.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task] Convert action settings to a popup and trigger point to a toggle
4 participants