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

Allow adding a data store at the top level #1004

Merged
merged 3 commits into from
Feb 8, 2024
Merged

Allow adding a data store at the top level #1004

merged 3 commits into from
Feb 8, 2024

Conversation

jbirddog
Copy link
Contributor

@jbirddog jbirddog commented Feb 8, 2024

This adds the UI support for creating a top level global data store.

Summary by CodeRabbit

  • New Features
    • Added a button to add new data stores in the process group list.
    • Enhanced layout to support data store functionality.

Copy link
Contributor

coderabbitai bot commented Feb 8, 2024

Walkthrough

Walkthrough

The recent updates introduce enhancements to the frontend, particularly focusing on data store functionality. A new component, DataStoreListTiles, has been added, and the ProcessGroupList layout has been revised to incorporate data store features, including a new button for adding data stores. These changes aim to improve user interaction and experience by seamlessly integrating data store management within the application's interface.

Changes

File Path Changes
.../DataStoreListTiles.tsx Added component for data store listing.
.../ProcessGroupList.tsx - Added Stack and DataStoreListTiles component imports.
- Added a button for adding a data store.
- Modified layout to include data store functionality.

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

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.

Review Status

Actionable comments generated: 1

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 886f1f5 and c28dc52.
Files selected for processing (2)
  • spiffworkflow-frontend/src/components/DataStoreListTiles.tsx (1 hunks)
  • spiffworkflow-frontend/src/routes/ProcessGroupList.tsx (4 hunks)
Additional comments: 4
spiffworkflow-frontend/src/routes/ProcessGroupList.tsx (3)
  • 17-17: The import of DataStoreListTiles is correctly placed. Ensure that the component is utilized appropriately within this file.
  • 28-28: Adding permissions for dataStoreListPath and processGroupListPath is a good practice for security. Verify that these permissions are correctly implemented in the backend.
  • 75-100: The layout modifications to include data store functionality are well-implemented. However, ensure that the Stack component's orientation and gap properties align with the design requirements. Also, verify that the href in the "Add a data store" button correctly handles the case when a parent group ID should be specified.
spiffworkflow-frontend/src/components/DataStoreListTiles.tsx (1)
  • 44-46: The update to construct queryParams with processGroup?.id is correctly implemented using optional chaining and nullish coalescing. This ensures that the query parameter includes the process group ID if available, providing a fallback to an empty string otherwise. Verify that the backend correctly handles the case when process_group_identifier is an empty string.

@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import {
Button,
Stack,
Copy link
Contributor

@coderabbitai coderabbitai bot Feb 8, 2024

Choose a reason for hiding this comment

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

Ensure the Stack import is grouped with other component imports from @carbon/react for better readability, following the consideration for future refactor mentioned by the user in a previous PR.

-  Stack,
+  // Other imports from @carbon/react
+  Stack

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Stack,
// Other imports from @carbon/react
Stack

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which pr comment are you referring to?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jbirddog: The comment I referred to is from a previous PR discussion in PR #919, where there was a consideration for future refactor regarding the suggestion to group related imports together in the ProcessInstanceListTable component for better readability. This was mentioned by the user jasquat and is captured in our learnings to ensure consistency in future reviews.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know, thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jbirddog: You're welcome! If you have any more questions or need further assistance, feel free to ask.

  /\_/\
 ( o.o )
 > ^ <

if (processGroup) {
queryParams = `${queryParams}&process_group_identifier=${processGroup.id}`;
}
const queryParams = `?per_page=1000&process_group_identifier=${
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe if you have a quick minute to omit process_group_identifier completely when id is not there, otherwise can merge this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly it needs to be there, at least until I port the typeahead data store to have a location, since we still have to support requests coming in with no location vs the "" empty top level location...

@burnettk burnettk merged commit b6bdd97 into main Feb 8, 2024
22 checks passed
@burnettk burnettk deleted the tlds branch February 8, 2024 19:50
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.

None yet

2 participants