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

Feature/update extension docs #1028

Merged
merged 10 commits into from
Feb 13, 2024
Merged

Feature/update extension docs #1028

merged 10 commits into from
Feb 13, 2024

Conversation

jasquat
Copy link
Contributor

@jasquat jasquat commented Feb 13, 2024

This adds documentation for extensions and updates extensions to use components over the top level keys for form submission.

Summary by CodeRabbit

  • New Features

    • Enhanced extension documentation and functionalities, including permission specifications, UI access, and expanded use cases like time tracking and custom reports.
    • Introduced customizable submit button text for forms in the UI.
    • Added new configurations and enums for extension UI schema, supporting a wide range of components and actions.
  • Refactor

    • Updated workflow triggers for Docker image builds.
    • Simplified logic for filtering process models and handling extension UI elements.
  • Documentation

    • Updated extension documentation to reflect new features and use cases.

Copy link
Contributor

coderabbitai bot commented Feb 13, 2024

Walkthrough

Walkthrough

The recent changes encompass a comprehensive update to streamline extension development and integration within the application. This includes refining UI schema configurations, optimizing backend service logic, and enhancing frontend components. The primary focus is on improving extension creation processes, user interaction through customized UI elements, and building a more dynamic extension ecosystem.

Changes

File Path Change Summary
.github/workflows/docker_image_for_main_builds.yml Updated the triggering branches in the workflow from feature/background-proc-with-celery to feature/update-extension-docs.
docs/Building_Diagrams/Extensions.md Updated extension functionality in the process model repository, including access permissions, UI accessibility, creation process, and expanded use cases such as time tracking, custom reports, custom pages integration, tailor-made APIs, and rendering API outputs.
spiffworkflow-backend/.../process_model_service.py Modified the get_process_models_for_api function to filter process models based only on filter_runnable_by_user.
spiffworkflow-frontend/.../CustomForm.tsx Added a new prop submitButtonText to customize the submit button text in the CustomForm component.
spiffworkflow-frontend/.../ExtensionUxElementForDisplay.tsx Revised element mapping and filtering based on display_location, simplifying logic for handling callbacks and not found scenarios.
spiffworkflow-frontend/.../extension_ui_schema_interfaces.ts Introduced configurations for extension UI schema, enums for display locations and persistence levels, supported components, actions for form submissions and API calls, page components and definitions, and types for API interactions.
spiffworkflow-frontend/.../Extension.tsx Enhanced form submission handling, argument processing for CustomForm, API path handling, and updated component rendering logic.

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: 0

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between a32ccf8 and 0519e02.
Files selected for processing (7)
  • .github/workflows/docker_image_for_main_builds.yml (1 hunks)
  • docs/Building_Diagrams/Extensions.md (2 hunks)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py (1 hunks)
  • spiffworkflow-frontend/src/components/CustomForm.tsx (5 hunks)
  • spiffworkflow-frontend/src/components/ExtensionUxElementForDisplay.tsx (1 hunks)
  • spiffworkflow-frontend/src/extension_ui_schema_interfaces.ts (2 hunks)
  • spiffworkflow-frontend/src/routes/Extension.tsx (10 hunks)
Additional comments: 28
spiffworkflow-frontend/src/components/ExtensionUxElementForDisplay.tsx (3)
  • 21-25: Ensure the filtering logic correctly matches the display_location with the provided displayLocation. This is crucial for displaying the correct UI elements.
  • 26-28: The mapping logic to execute elementCallback for each filtered element is appropriate. Confirm that elementCallback handles all necessary UI rendering or actions for the elements.
  • 31-31: The handling of the scenario where no elements match the displayLocation and an elementCallbackIfNotFound is provided is correctly implemented. This ensures a fallback action or rendering when no elements are found.
docs/Building_Diagrams/Extensions.md (5)
  • 8-12: The introduction to extensions, including implementation details and access setup via permissions, is clear and informative. Ensure all necessary details for setting up and configuring extensions are included.
  • 26-26: The documentation on setting the environment variable for enabling extensions is clear. Verify that the variable name and value are correctly specified.
  • 33-37: The steps for creating an extension are well-detailed. Ensure the process model repository navigation and file creation instructions are accurate and easy to follow.
  • 41-47: The example extension provided is helpful for understanding how to implement specific features using extensions. Confirm that the example is complete and the GitHub link is accessible.
  • 53-61: The use cases section effectively illustrates the versatility of extensions. Ensure that the examples given are relevant and demonstrate practical applications of extensions.
spiffworkflow-frontend/src/extension_ui_schema_interfaces.ts (10)
  • 1-8: The introduction and comments provide a clear overview of the configurations for the extension UI schema. Ensure the documentation is comprehensive and understandable.
  • 10-24: The UiSchemaDisplayLocation enum is well-defined, covering all possible display locations for extensions. Confirm that all locations are relevant and correctly named.
  • 28-31: The UiSchemaPersistenceLevel enum clearly defines the persistence levels for process instances. Ensure the descriptions are accurate and the enum values are appropriate.
  • 37-49: The UiSchemaPageComponentList enum lists supported components for pages. Verify that all components are included and correctly named.
  • 51-56: The UiSchemaLocationSpecificConfig interface specifies configs for certain display locations. Ensure the interface is correctly defined and covers all necessary configurations.
  • 1-63: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [60-75]

The interfaces for defining UX elements, forms, and actions are well-structured and provide clear guidelines for configuring extensions. Confirm that all properties are necessary and correctly typed.

  • 119-147: The interfaces for page components and definitions are comprehensive, covering various aspects of extension UI configuration. Ensure the definitions are complete and accurately reflect the intended functionality.
  • 150-183: The UiSchemaPageDefinition and UiSchemaPage interfaces are correctly structured to define pages and their components. Verify that all attributes are appropriately used and named.
  • 191-201: The ExtensionUiSchema top-level object interface is well-documented and structured. Confirm that it accurately represents the extension UI schema configuration.
  • 204-221: The API call types and response interfaces are clearly defined. Ensure they align with the backend API specifications and correctly handle the data exchange.
.github/workflows/docker_image_for_main_builds.yml (1)
  • 34-34: The branch triggering the workflow has been updated to feature/update-extension-docs. Confirm that this branch name aligns with the project's feature development and naming conventions.
spiffworkflow-frontend/src/components/CustomForm.tsx (2)
  • 30-30: The addition of the submitButtonText prop to CustomForm allows for customizable submit button text. Ensure the prop is optional and correctly handled in the component's logic.
  • 363-370: The conditional rendering of the submit button based on the submitButtonText prop is correctly implemented. Verify that the button is appropriately styled and accessible.
spiffworkflow-frontend/src/routes/Extension.tsx (6)
  • 13-13: Import of makeid from '../helpers' is added. Ensure that this function is used appropriately and that the import is necessary.
  • 46-46: Variable _processModel is renamed to processModel. Verify that all instances of _processModel have been updated to processModel to maintain consistency.
  • 71-71: CustomForm is added to supportedComponents. Ensure that CustomForm is implemented correctly and that its inclusion aligns with the intended functionality of the extension.
  • 278-300: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [219-297]

Updates to processSubmitResult and handleFormSubmit functions include additional parameters and logic enhancements. Ensure that these changes are correctly implemented, do not introduce any regressions, and improve the functionality as intended. Specifically, verify the handling of API paths and the processing of form submission results.

  • 308-342: Enhancements to renderComponentArguments function to handle arguments for components, especially for CustomForm. Verify that the logic correctly processes component arguments and integrates with the rest of the component rendering process.
  • 376-386: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [379-411]

Updated usage of handleFormSubmit and renderComponentArguments in component rendering. Ensure that these updates are correctly applied and that they integrate seamlessly with the existing component rendering logic.

spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py (1)
  • 252-252: Modification to the logic for filtering process models based on filter_runnable_by_user or filter_runnable_as_extension to only consider filter_runnable_by_user. Ensure this change aligns with the intended functionality and does not inadvertently exclude necessary filtering conditions.

@jasquat jasquat merged commit 6f0e594 into main Feb 13, 2024
19 checks passed
@jasquat jasquat deleted the feature/update-extension-docs branch February 13, 2024 21:48
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: 0

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 0519e02 and ef48033.
Files selected for processing (4)
  • spiffworkflow-frontend/src/components/ReactFormBuilder/ReactFormBuilder.tsx (1 hunks)
  • spiffworkflow-frontend/src/extension_ui_schema_interfaces.ts (2 hunks)
  • spiffworkflow-frontend/src/routes/Extension.tsx (11 hunks)
  • spiffworkflow-frontend/src/routes/ProcessModelShow.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • spiffworkflow-frontend/src/components/ReactFormBuilder/ReactFormBuilder.tsx
Files skipped from review as they are similar to previous changes (1)
  • spiffworkflow-frontend/src/extension_ui_schema_interfaces.ts
Additional comments: 6
spiffworkflow-frontend/src/routes/Extension.tsx (6)
  • 12-12: Consider verifying the usage of makeid from '../helpers' to ensure it's utilized correctly within this file.
  • 45-45: Renaming _processModel to processModel aligns with naming conventions. Ensure all references to this variable are updated accordingly.
  • 70-70: Adding CustomForm to supportedComponents is appropriate for extending functionality. Confirm that CustomForm is implemented correctly and integrates well with existing components.
  • 273-295: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [218-292]

The modifications in processSubmitResult and handleFormSubmit functions, including the addition of an extra parameter and updated logic, require thorough testing to ensure they handle form submissions as expected, especially with the new CustomForm component.

  • 304-338: The enhancements in renderComponentArguments for handling arguments, particularly for CustomForm, improve modularity and flexibility. Verify that these changes do not introduce any regressions in how components are rendered and interact with user inputs.
  • 367-371: Ensure that the updated usage of handleFormSubmit and renderComponentArguments in component rendering does not negatively impact the user experience or introduce any performance issues.

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