Skip to content

Conversation

@ElayAharoni
Copy link
Collaborator

@ElayAharoni ElayAharoni commented Jul 16, 2025

https://issues.redhat.com/browse/MTA-5245
Resolves: #2287

Update the inventory table, detail drawer, and create/edit modal to support new data and actions needed to implement

Work needed:

  • Model / API
    • Update application models to hub current
  • Application inventory table
  • Detail drawer
    • Platform Tab
      • Source platform details
      • Source platform coordinates (view, modal to edit)
      • Source platform discovery manifest view (just a json/yaml document view)
      • Assets repository details
  • Application form (add/edit)
    • Source platform dropdown
    • Source platform coordinates with SchemaDefinedFields
    • Asset repository fields (kind, url, branch, path)

Summary by CodeRabbit

  • New Features

    • Introduced a detailed application drawer with tabbed views for Details, Tags, Reports, Reviews, Tasks, and Platform information.
    • Added support for managing source platform and asset repository data in the application form.
    • Enhanced bulk and per-application actions in the applications table, including new actions for changing source platform, retrieving configurations, and generating assets.
    • Added schema-driven platform coordinates support and related UI components.
    • Introduced new hooks for fetching schemas and platform-specific schema data.
    • Added a multi-section application form with dynamic validation and platform-specific coordinates support.
    • Added new translation keys for actions and terms related to configurations, source platform, and assets.
  • Improvements

    • Expanded application metadata and UI to display and edit additional platform, repository, and business service details.
    • Refined component structure and naming for clarity and maintainability.
    • Improved handling of empty states and localization throughout the UI.
    • Disabled automatic refetch and retries for application manifest fetching by default to improve performance.
    • Enhanced form validation and submission logic with improved data mapping and error handling.
    • Improved bulk action dropdown styling and conditional enabling based on selection.
    • Updated notification handling for application create and update actions.
  • Bug Fixes

    • Ensured platform lists are always returned as arrays to prevent undefined errors.
  • Refactor

    • Reorganized and consolidated UI components, removing deprecated or redundant files and updating import paths.
    • Converted schema-defined field components to controlled components with improved accessibility IDs.
    • Replaced local repository details component with a shared version for consistency.
    • Split application actions column into primary and secondary actions for better UX.
    • Renamed several status components for consistency.
    • Replaced single form hook with separate hooks for form data and form logic.
    • Centralized exports for detail drawer components.
  • Tests

    • Updated application form tests to account for new platform data and improved validation synchronization.
  • Style

    • Added new styles for the drawer tab container and its content.

@coderabbitai
Copy link

coderabbitai bot commented Jul 16, 2025

Walkthrough

This change set enhances the application inventory table, detail drawer, and create/edit modal to support platform awareness and asset generation features. It introduces new translation keys, updates API models, adds new UI components for drawer tabs and repository details, modifies application form logic, and reorganizes and extends table actions and detail views. Several files are added, removed, or refactored to accommodate these enhancements.

Changes

Cohort / File(s) Change Summary
Translation Keys
client/public/locales/en/translation.json
Added new action and term translation keys; removed "manifest" key.
API Models
client/src/app/api/models.ts
Added Document interface; extended Application with platform, repository, coordinates, and related fields.
Application Table Enhancements
client/src/app/pages/applications/applications-table/applications-table.tsx,
client/src/app/pages/applications/applications-table/components/column-analysis-status.tsx,
client/src/app/pages/applications/applications-table/components/column-assessment-status.tsx,
client/src/app/pages/applications/applications-table/components/column-review-status.tsx
Refactored action columns, added new actions (retrieve configurations, generate assets, change source platform), reordered actions, renamed status column components.
Application Detail Drawer Refactor
client/src/app/pages/applications/application-detail-drawer/application-detail-drawer.tsx,
client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx,
client/src/app/pages/applications/application-detail-drawer/tab-platform-content.tsx,
client/src/app/pages/applications/application-detail-drawer/tab-reports-contents.tsx,
client/src/app/pages/applications/application-detail-drawer/tab-tags-content.tsx,
client/src/app/pages/applications/application-detail-drawer/tab-tasks-content.tsx
Replaced old drawer with new tabbed drawer UI; added platform, manifest, repository, tags, reports, and tasks tabs; modularized tab content.
Drawer UI Components
client/src/app/components/detail-drawer/drawer-tabs-container.tsx,
client/src/app/components/detail-drawer/drawer-tabs-container.css,
client/src/app/components/detail-drawer/repository-details.tsx,
client/src/app/components/detail-drawer/index.tsx
Added new components and styles for tabbed drawer layouts and repository details; centralized exports.
Application Form Enhancements
client/src/app/pages/applications/application-form/application-form.tsx,
client/src/app/pages/applications/application-form/__tests__/application-form.test.tsx
Extended form to support source platform, asset repository, and coordinates fields; updated validation and submission logic; improved test synchronization.
Application Decorator and Queries
client/src/app/pages/applications/useDecoratedApplications.ts,
client/src/app/queries/platforms.ts,
client/src/app/queries/applications.ts
Decorated applications with new readiness flags and business service; ensured platform queries always return arrays; reordered mutation cache invalidation.
Platform Coordinates Provider
client/src/app/pages/applications/usePlatformCoordinatesProvider.ts
Added hook to provide schema and sample for platform coordinates.
Empty Text Message
client/src/app/components/EmptyTextMessage.tsx
Made message prop optional; added default translation fallback.
Refactor/Remove Redundant Components
client/src/app/pages/applications/components/application-business-service.tsx,
client/src/app/pages/applications/application-detail-drawer/application-detail-drawer.tsx,
client/src/app/pages/applications/components/application-tags/index.ts,
client/src/app/pages/applications/components/import-applications-form/index.ts,
client/src/app/pages/applications/components/application-assessment-status/index.ts
Removed old or redundant components and barrel exports.
Miscellaneous
client/src/app/pages/applications/application-identity-form/field-names.ts,
client/src/app/pages/applications/application-detail-drawer/components/application-tags.tsx,
client/src/app/pages/asset-generators/components/generator-detail-drawer.tsx
Minor import path updates, newline addition, and switched to shared repository details component.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ApplicationsTable
    participant ApplicationDetailDrawer
    participant ApplicationForm
    participant API

    User->>ApplicationsTable: Selects application(s)
    ApplicationsTable->>ApplicationsTable: Shows actions (retrieve configs, generate assets, change platform)
    User->>ApplicationsTable: Triggers action (e.g., retrieve configs)
    ApplicationsTable->>API: Calls backend for action
    User->>ApplicationsTable: Clicks application row
    ApplicationsTable->>ApplicationDetailDrawer: Opens detail drawer
    ApplicationDetailDrawer->>API: Fetches application details, manifest, repository, platform
    User->>ApplicationDetailDrawer: Views tabs (Details, Tags, Reports, Platform, Tasks)
    User->>ApplicationDetailDrawer: Clicks edit
    ApplicationDetailDrawer->>ApplicationForm: Opens form with platform/repo fields
    ApplicationForm->>API: Submits updated application data
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Assessment against linked issues

Objective Addressed Explanation
Platform awareness: associate app to source platform, add coordinates, view manifest, view source platform, add retrieve configurations action (2287)
Asset generation: associate app to asset repository, add generate assets action, and view asset repository (2287)
Table: update toolbar and record actions order, add new actions, update columns as described (2287)
Detail drawer: add platform, coordinates, manifest, asset repository views; enable verification (2287)
Add/edit modal: add source platform dropdown, coordinates field, asset repository fields, validation, and logic (2287)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Minor import path update for ItemTagLabel (application-detail-drawer/components/application-tags.tsx) This is a refactor for import consistency and not directly related to the objectives, but it is non-functional and does not affect feature scope.
Addition of newline in application-identity-form/field-names.ts This is a trivial formatting change and not related to any objectives, but also does not affect functional scope.

Possibly related PRs

  • #2368: Introduces a comprehensive source platforms page and related UI, API, and translation changes, directly related to platform awareness features.
  • #2432: Adds schema-defined fields components and utilities supporting the new platform coordinates and manifest UI in this PR.
  • #2424: Adds manifest translation keys, API, and UI for manifest viewing, overlapping with manifest-related enhancements in this PR.

Suggested reviewers

  • ibolton336
  • rszwajko

Poem

A rabbit hopped through fields of code,
Bringing platforms, assets, all bestowed.
Drawers with tabs, forms anew,
Actions for configs and assets too!
With translations fresh and models neat,
This feature set is quite a feat.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this 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.

CodeRabbit Configuration 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.

Copy link

@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: 3

🔭 Outside diff range comments (1)
client/src/app/pages/applications/applications-table/applications-table.tsx (1)

696-780: Bulk actions added for source platform management.

The implementation follows existing patterns with proper access controls and disabled states. However, the onClick handlers are placeholder implementations.

Issues to address:

  1. Lines 744, 752, 760: Placeholder console.log statements need actual implementation
  2. Line 743: The "change source platform" action requires at least 2 selected items, which is appropriate for bulk operations
  3. Lines 751, 759: The other actions require at least 1 selected item, which is correct

Replace the placeholder onClick handlers with actual implementations:

-onClick={() => console.log("change source platform")}
+onClick={() => handleChangeSourcePlatform(selectedRows)}
-onClick={() => console.log("retrieve configurations")}
+onClick={() => handleRetrieveConfigurations(selectedRows)}
-onClick={() => console.log("generate assets")}
+onClick={() => handleGenerateAssets(selectedRows)}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b23c51 and 25a4a54.

📒 Files selected for processing (8)
  • client/public/locales/en/translation.json (2 hunks)
  • client/src/app/components/schema-defined-fields/SchemaDefinedFields.tsx (2 hunks)
  • client/src/app/pages/applications/applications-table/applications-table.tsx (4 hunks)
  • client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx (5 hunks)
  • client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx (3 hunks)
  • client/src/app/pages/applications/components/application-form/application-form.tsx (11 hunks)
  • client/src/app/pages/applications/usePlatformCoordinatesProvider.ts (1 hunks)
  • client/src/app/queries/platforms.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx (1)
client/src/app/queries/platforms.ts (1)
  • useFetchPlatformById (32-46)
client/src/app/pages/applications/components/application-form/application-form.tsx (5)
client/src/app/queries/platforms.ts (2)
  • useFetchPlatformById (32-46)
  • useFetchPlatforms (16-30)
client/src/app/components/HookFormPFFields/HookFormPFGroupController.tsx (1)
  • HookFormPFGroupController (42-91)
client/src/app/components/SimpleSelect.tsx (2)
  • SimpleSelect (31-69)
  • OptionWithValue (11-14)
client/src/app/Constants.ts (1)
  • DEFAULT_SELECT_MAX_HEIGHT (19-19)
client/src/app/utils/model-utils.tsx (2)
  • toOptionLike (202-204)
  • matchItemsToRef (253-262)
🪛 Biome (1.9.4)
client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx

[error] 281-281: Comparing to itself is potentially pointless.

(lint/suspicious/noSelfCompare)

🔇 Additional comments (23)
client/src/app/queries/platforms.ts (1)

24-24: LGTM: Good defensive programming practice.

The fallback to an empty array prevents potential runtime errors in consuming components that expect an array, ensuring consistent behavior during loading states or when the query fails.

client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx (3)

22-22: LGTM: Proper hook import.

The import is correctly added to support platform data fetching functionality.


32-32: LGTM: Correct hook usage.

The hook is properly used to fetch platform data based on the application's platform ID, with appropriate conditional access.


217-232: LGTM: Well-structured platform information display.

The new "Source Platform" section properly displays platform details with:

  • Conditional rendering based on platform availability
  • Consistent styling with other sections
  • Appropriate fallback message for missing data
  • Clean data presentation of name, kind, and URL
client/src/app/components/schema-defined-fields/SchemaDefinedFields.tsx (3)

23-23: LGTM: Good addition of customization prop.

The optional className prop enhances the component's flexibility for styling customization.


30-30: LGTM: Proper prop usage.

The className prop is correctly accepted and passed to the CodeEditor component, enabling custom styling.

Also applies to: 72-72


78-78: LGTM: Fixed height provides better layout control.

Changing from "sizeToFit" to a fixed "600px" height provides more predictable layout behavior, which is beneficial for consistent UI presentation.

client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx (4)

88-89: LGTM: Proper imports for new functionality.

The imports are correctly added to support the new platform coordinates feature.


105-105: LGTM: Consistent enum extension.

The PlatformCoordinates tab key is properly added to the enum, maintaining consistency with the existing tab structure.


188-195: LGTM: Proper conditional tab rendering.

The Platform Coordinates tab is correctly rendered only when both application and platform data are available, following the same pattern as other conditional tabs.


379-391: LGTM: Well-structured component implementation.

The TabPlatformCoordinatesContent component is properly implemented with:

  • Correct props interface
  • Proper hook usage for data fetching
  • Appropriate component integration
  • TODO comment indicating future backend integration
client/public/locales/en/translation.json (2)

68-71: Translation keys added for new source platform actions.

The new action keys follow the existing naming conventions and are appropriately placed in the actions section. Ensure these keys are consistently used throughout the application.


475-475: Added singular form for source platform term.

This addition maintains consistency with the existing pattern of having both singular and plural forms for terms (e.g., "sourcePlatforms" already exists on line 474).

client/src/app/pages/applications/applications-table/applications-table.tsx (1)

124-124: Import added for dropdown separator.

Good addition to support the visual separation of action groups in the dropdown menus.

client/src/app/pages/applications/components/application-form/application-form.tsx (9)

40-43: Platform-related hooks imported.

The imports for useFetchPlatformById and useFetchPlatforms are properly added and will be used later in the component.


62-62: Source platform field added to FormValues interface.

The field is properly typed as a string and follows the existing pattern of other form fields.


86-87: Platform data integration in form hook.

The platform data is properly fetched and integrated into the form hook. The useFetchPlatformById hook correctly uses the application's platform ID to fetch the current platform.

Also applies to: 92-92


101-106: Source platform options mapping.

The mapping follows the exact same pattern as businessServiceOptions and stakeholdersOptions, ensuring consistency in the codebase.


268-268: Source platform default value.

The default value is properly set using the fetched platform's name, following the same pattern as other fields like businessServiceName.


312-312: Platform reference in form submission payload.

The platform is properly converted to a reference using sourcePlatformToRef and included in the submission payload, following the same pattern as other reference fields.


355-355: Source platform options passed through component props.

The options are properly passed through the hook return and component props, maintaining consistency with the existing pattern.

Also applies to: 376-376


537-564: Source platform form field implementation.

The form field implementation is excellent and follows the exact same pattern as the business service field (lines 403-432). It includes:

  • Proper form control integration
  • Appropriate placeholder text using translations
  • Typeahead variant for better UX
  • Clear functionality
  • Proper ARIA labels and accessibility attributes

684-684: Platform data hooks and helpers in useApplicationFormData.

The implementation properly:

  • Fetches source platforms using the existing useFetchPlatforms hook
  • Provides a sourcePlatformToRef helper function following the same pattern as other reference helpers
  • Returns the data and helper functions for use in the form

Also applies to: 693-694, 757-758

@sjd78 sjd78 added this to the v0.8.0 milestone Jul 17, 2025
@ElayAharoni ElayAharoni force-pushed the Enhance-application-inventory-table branch 2 times, most recently from 73864ea to f5efae6 Compare July 23, 2025 08:31
@sjd78 sjd78 force-pushed the Enhance-application-inventory-table branch 2 times, most recently from 7429d0d to af530ed Compare July 29, 2025 04:31
Copy link

@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

🧹 Nitpick comments (1)
client/src/app/pages/applications/useDecoratedApplications.ts (1)

165-169: Consider extracting duplicated readiness logic.

Both readiness flags use identical logic. Consider extracting this into a helper variable for better maintainability:

+      const isReadyForPlatformActions = app.platform && app.coordinates?.content ? true : false;
+
       isReadyForRetrieveConfigurations:
-        app.platform && app.coordinates?.content ? true : false,
+        isReadyForPlatformActions,

       isReadyForGenerateAssets:
-        app.platform && app.coordinates?.content ? true : false,
+        isReadyForPlatformActions,
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f5efae6 and 5e57147.

📒 Files selected for processing (12)
  • client/public/locales/en/translation.json (2 hunks)
  • client/src/app/api/models.ts (1 hunks)
  • client/src/app/pages/applications/applications-table/applications-table.tsx (7 hunks)
  • client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx (4 hunks)
  • client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx (3 hunks)
  • client/src/app/pages/applications/components/application-form/application-form.tsx (11 hunks)
  • client/src/app/pages/applications/useDecoratedApplications.ts (2 hunks)
  • client/src/app/pages/applications/usePlatformCoordinatesProvider.ts (1 hunks)
  • client/src/app/pages/source-platforms/components/platform-detail-drawer.tsx (3 hunks)
  • client/src/app/pages/source-platforms/components/platform-form/platform-form.tsx (1 hunks)
  • client/src/app/pages/source-platforms/usePlatformProviderList.ts (1 hunks)
  • client/src/app/queries/platforms.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • client/src/app/pages/source-platforms/components/platform-detail-drawer.tsx
🚧 Files skipped from review as they are similar to previous changes (7)
  • client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx
  • client/public/locales/en/translation.json
  • client/src/app/queries/platforms.ts
  • client/src/app/pages/applications/usePlatformCoordinatesProvider.ts
  • client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx
  • client/src/app/pages/applications/applications-table/applications-table.tsx
  • client/src/app/pages/applications/components/application-form/application-form.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
client/src/app/pages/source-platforms/components/platform-form/platform-form.tsx (1)
client/src/app/pages/source-platforms/usePlatformProviderList.ts (1)
  • usePlatformProviderList (5-7)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit-test
  • GitHub Check: build-and-upload-for-global-ci
🔇 Additional comments (6)
client/src/app/api/models.ts (3)

128-132: Well-designed Document interface.

The Document interface cleanly pairs JSON content with its schema, which is a good pattern for schema-validated data structures. The typing is appropriate and the interface is well-documented.


134-158: Application interface appropriately extended for platform features.

The new optional fields align well with the PR objectives for platform-aware application inventory:

  • platform enables source platform association
  • coordinates uses the new Document interface for schema-validated platform coordinates
  • assets/repository support asset generation and storage
  • identities and archetypes provide additional metadata capabilities

Making all new fields optional maintains backward compatibility while enabling the enhanced features.


969-1003: Comprehensive JsonSchemaObject interface implementation.

The interface covers all essential JSON schema validation properties with clear documentation. The typing is comprehensive and supports string patterns, numeric ranges, object properties, array items, and required field validation.

client/src/app/pages/applications/useDecoratedApplications.ts (1)

58-59: Well-named readiness flags for UI actions.

The new boolean properties clearly indicate when applications are ready for configuration retrieval and asset generation actions. The naming is self-documenting and follows good conventions.

client/src/app/pages/source-platforms/components/platform-form/platform-form.tsx (1)

62-62: Correctly adapted to updated hook interface.

The destructuring change appropriately handles the updated usePlatformProviderList hook that now returns an object with a providers property instead of a direct array.

client/src/app/pages/source-platforms/usePlatformProviderList.ts (1)

5-7: Improved hook API design for extensibility.

Returning an object with a providers property instead of a direct array makes the hook more extensible for future enhancements like loading states, metadata, or additional provider-related data.

sjd78 added 9 commits July 29, 2025 14:51
- Move application detail drawer components to application-detail-drawer
- Move application form components to application-form
- Move application identity form components to application-identity-form
- Move application analysis status components to applications-table
- Move application assessment status components to applications-table
- Move application review status components to applications-table
- Move import applications form components to import-applications-form

Signed-off-by: Scott J Dickerson <[email protected]>
- Rename table column components
- Refactor business service handling to use DecoratedApplication
- Remove ApplicationBusinessService component

Signed-off-by: Scott J Dickerson <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
@sjd78 sjd78 force-pushed the Enhance-application-inventory-table branch from 535f538 to cb70e7c Compare July 30, 2025 23:48
Copy link

@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

🧹 Nitpick comments (2)
client/src/app/pages/applications/application-detail-drawer/application-detail-fields.tsx (1)

215-230: Consider improving platform data presentation.

The platform information display is functional but could be enhanced for better readability and consistency with other sections.

Consider using a description list format similar to other sections:

-      {platform ? (
-        <Text
-          component="small"
-          cy-data="sourcePlatform"
-          className="pf-v5-u-color-200 pf-v5-u-font-weight-light"
-        >
-          Name: {platform?.name} <br />
-          Kind: {platform?.kind} <br />
-          URL: {platform?.url} <br />
-        </Text>
-      ) : (
-        <EmptyTextMessage message={t("terms.notAvailable")} />
-      )}
+      {platform ? (
+        <>
+          <Text component="small" className="pf-v5-u-color-200 pf-v5-u-font-weight-light">
+            {t("terms.name")}: {platform.name}
+          </Text>
+          <br />
+          <Text component="small" className="pf-v5-u-color-200 pf-v5-u-font-weight-light">
+            {t("terms.kind")}: {platform.kind}
+          </Text>
+          <br />
+          <Text component="small" className="pf-v5-u-color-200 pf-v5-u-font-weight-light">
+            {t("terms.url")}: {platform.url}
+          </Text>
+        </>
+      ) : (
+        <EmptyTextMessage />
+      )}
client/src/app/pages/applications/application-detail-drawer/tab-tasks-content.tsx (1)

62-65: Remove console.log statement.

The debug console.log should be removed from production code.

         getServerFilterValue: (value) => {
-          console.log("this id:", value);
           return value ? value : [];
         },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 535f538 and cb70e7c.

📒 Files selected for processing (28)
  • client/public/locales/en/translation.json (4 hunks)
  • client/src/app/api/models.ts (1 hunks)
  • client/src/app/components/EmptyTextMessage.tsx (1 hunks)
  • client/src/app/components/detail-drawer/drawer-tabs-container.css (1 hunks)
  • client/src/app/components/detail-drawer/drawer-tabs-container.tsx (1 hunks)
  • client/src/app/components/detail-drawer/index.tsx (1 hunks)
  • client/src/app/components/detail-drawer/repository-details.tsx (1 hunks)
  • client/src/app/pages/applications/application-detail-drawer/application-detail-drawer.tsx (1 hunks)
  • client/src/app/pages/applications/application-detail-drawer/application-detail-fields.tsx (3 hunks)
  • client/src/app/pages/applications/application-detail-drawer/components/application-tags.tsx (1 hunks)
  • client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx (1 hunks)
  • client/src/app/pages/applications/application-detail-drawer/tab-platform-content.tsx (1 hunks)
  • client/src/app/pages/applications/application-detail-drawer/tab-reports-contents.tsx (1 hunks)
  • client/src/app/pages/applications/application-detail-drawer/tab-tags-content.tsx (1 hunks)
  • client/src/app/pages/applications/application-detail-drawer/tab-tasks-content.tsx (1 hunks)
  • client/src/app/pages/applications/application-form/application-form.tsx (11 hunks)
  • client/src/app/pages/applications/application-identity-form/field-names.ts (1 hunks)
  • client/src/app/pages/applications/applications-table/applications-table.tsx (12 hunks)
  • client/src/app/pages/applications/applications-table/components/column-analysis-status.tsx (2 hunks)
  • client/src/app/pages/applications/applications-table/components/column-assessment-status.tsx (1 hunks)
  • client/src/app/pages/applications/applications-table/components/column-review-status.tsx (1 hunks)
  • client/src/app/pages/applications/components/application-assessment-status/index.ts (0 hunks)
  • client/src/app/pages/applications/components/application-business-service.tsx (0 hunks)
  • client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx (0 hunks)
  • client/src/app/pages/applications/components/application-tags/index.ts (0 hunks)
  • client/src/app/pages/applications/components/import-applications-form/index.ts (0 hunks)
  • client/src/app/pages/applications/useDecoratedApplications.ts (8 hunks)
  • client/src/app/pages/asset-generators/components/generator-detail-drawer.tsx (1 hunks)
💤 Files with no reviewable changes (5)
  • client/src/app/pages/applications/components/import-applications-form/index.ts
  • client/src/app/pages/applications/components/application-tags/index.ts
  • client/src/app/pages/applications/components/application-assessment-status/index.ts
  • client/src/app/pages/applications/components/application-business-service.tsx
  • client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx
✅ Files skipped from review due to trivial changes (10)
  • client/src/app/pages/applications/application-detail-drawer/components/application-tags.tsx
  • client/src/app/pages/applications/application-identity-form/field-names.ts
  • client/src/app/components/detail-drawer/drawer-tabs-container.css
  • client/src/app/pages/applications/applications-table/components/column-assessment-status.tsx
  • client/src/app/components/detail-drawer/index.tsx
  • client/src/app/pages/applications/applications-table/components/column-review-status.tsx
  • client/src/app/components/detail-drawer/repository-details.tsx
  • client/src/app/pages/applications/applications-table/components/column-analysis-status.tsx
  • client/src/app/pages/asset-generators/components/generator-detail-drawer.tsx
  • client/src/app/components/detail-drawer/drawer-tabs-container.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • client/public/locales/en/translation.json
  • client/src/app/pages/applications/useDecoratedApplications.ts
  • client/src/app/api/models.ts
  • client/src/app/pages/applications/applications-table/applications-table.tsx
🧰 Additional context used
🧠 Learnings (4)
client/src/app/pages/applications/application-detail-drawer/application-detail-fields.tsx (2)

Learnt from: sjd78
PR: #2468
File: client/src/app/pages/source-platforms/usePlatformProviderList.ts:1-3
Timestamp: 2025-07-29T14:20:50.580Z
Learning: The TargetCard component operates independently from the usePlatformProviderList hook and source platform functionality. References to cloud providers like "Azure" in TargetCard are unrelated to the platform provider list changes and serve a different purpose in the application.

Learnt from: sjd78
PR: #2468
File: client/src/app/pages/source-platforms/usePlatformProviderList.ts:1-3
Timestamp: 2025-07-29T14:20:50.580Z
Learning: TargetCard component is focused on transformation targets, not source platform providers. It imports Target/TargetLabel models and operates independently from usePlatformProviderList. The codebase maintains clear separation between source platforms (managed by usePlatformProviderList) and transformation targets (managed by TargetCard).

client/src/app/pages/applications/application-detail-drawer/tab-tags-content.tsx (1)

Learnt from: sjd78
PR: #2468
File: client/src/app/pages/source-platforms/usePlatformProviderList.ts:1-3
Timestamp: 2025-07-29T14:20:50.580Z
Learning: TargetCard component is focused on transformation targets, not source platform providers. It imports Target/TargetLabel models and operates independently from usePlatformProviderList. The codebase maintains clear separation between source platforms (managed by usePlatformProviderList) and transformation targets (managed by TargetCard).

client/src/app/pages/applications/application-detail-drawer/tab-platform-content.tsx (2)

Learnt from: sjd78
PR: #2468
File: client/src/app/pages/source-platforms/usePlatformProviderList.ts:1-3
Timestamp: 2025-07-29T14:20:50.580Z
Learning: TargetCard component is focused on transformation targets, not source platform providers. It imports Target/TargetLabel models and operates independently from usePlatformProviderList. The codebase maintains clear separation between source platforms (managed by usePlatformProviderList) and transformation targets (managed by TargetCard).

Learnt from: sjd78
PR: #2468
File: client/src/app/pages/source-platforms/usePlatformProviderList.ts:1-3
Timestamp: 2025-07-29T14:20:50.580Z
Learning: The TargetCard component operates independently from the usePlatformProviderList hook and source platform functionality. References to cloud providers like "Azure" in TargetCard are unrelated to the platform provider list changes and serve a different purpose in the application.

client/src/app/pages/applications/application-form/application-form.tsx (2)

Learnt from: sjd78
PR: #2468
File: client/src/app/pages/source-platforms/usePlatformProviderList.ts:1-3
Timestamp: 2025-07-29T14:20:50.580Z
Learning: The TargetCard component operates independently from the usePlatformProviderList hook and source platform functionality. References to cloud providers like "Azure" in TargetCard are unrelated to the platform provider list changes and serve a different purpose in the application.

Learnt from: sjd78
PR: #2468
File: client/src/app/pages/source-platforms/usePlatformProviderList.ts:1-3
Timestamp: 2025-07-29T14:20:50.580Z
Learning: TargetCard component is focused on transformation targets, not source platform providers. It imports Target/TargetLabel models and operates independently from usePlatformProviderList. The codebase maintains clear separation between source platforms (managed by usePlatformProviderList) and transformation targets (managed by TargetCard).

🧬 Code Graph Analysis (3)
client/src/app/pages/applications/application-detail-drawer/application-detail-fields.tsx (3)
client/src/app/pages/applications/useDecoratedApplications.ts (1)
  • DecoratedApplication (39-69)
client/src/app/queries/platforms.ts (1)
  • useFetchPlatformById (36-54)
client/src/app/components/EmptyTextMessage.tsx (1)
  • EmptyTextMessage (9-19)
client/src/app/pages/applications/application-detail-drawer/tab-platform-content.tsx (6)
client/src/app/pages/applications/useDecoratedApplications.ts (1)
  • DecoratedApplication (39-69)
client/src/app/queries/applications.ts (1)
  • useFetchApplicationManifest (85-105)
client/src/app/components/detail-drawer/drawer-tabs-container.tsx (2)
  • DrawerTabContent (11-19)
  • DrawerTabContentSection (21-33)
client/src/app/components/EmptyTextMessage.tsx (1)
  • EmptyTextMessage (9-19)
client/src/app/components/schema-defined-fields/SchemaDefinedFields.tsx (1)
  • SchemaDefinedField (17-74)
client/src/app/components/detail-drawer/repository-details.tsx (1)
  • RepositoryDetails (12-54)
client/src/app/pages/applications/application-form/application-form.tsx (5)
client/src/app/queries/platforms.ts (2)
  • useFetchPlatformById (36-54)
  • useFetchPlatforms (17-34)
client/src/app/components/HookFormPFFields/HookFormPFGroupController.tsx (1)
  • HookFormPFGroupController (42-91)
client/src/app/components/SimpleSelect.tsx (2)
  • SimpleSelect (31-69)
  • OptionWithValue (11-14)
client/src/app/Constants.ts (1)
  • DEFAULT_SELECT_MAX_HEIGHT (21-21)
client/src/app/utils/model-utils.tsx (2)
  • toOptionLike (202-204)
  • matchItemsToRef (253-262)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit-test
  • GitHub Check: build-and-upload-for-global-ci
🔇 Additional comments (25)
client/src/app/components/EmptyTextMessage.tsx (1)

3-16: LGTM! Clean internationalization enhancement.

The changes properly make the message prop optional and provide a localized fallback using the translation hook. This improves the component's usability across the application while maintaining consistency with the internationalization effort.

client/src/app/pages/applications/application-detail-drawer/tab-tags-content.tsx (1)

14-40: Well-structured modular component.

The TabTagsContent component is cleanly implemented with:

  • Proper conditional rendering for the running task state
  • Correct integration with the translation system
  • Good separation of concerns by delegating tag rendering to ApplicationTags

The modularization from the previous monolithic drawer approach improves maintainability.

client/src/app/pages/applications/application-detail-drawer/tab-platform-content.tsx (1)

17-57: Excellent component structure with proper data handling.

The TabPlatformContent component demonstrates good architectural practices:

  • Clean separation into logical sections with consistent labeling
  • Proper handling of optional data using EmptyTextMessage fallbacks
  • Effective reuse of components like RepositoryDetails and SchemaDefinedField
  • Good integration with the translation system

The component fits well into the modular drawer architecture and provides comprehensive platform information display.

client/src/app/pages/applications/application-detail-drawer/application-detail-fields.tsx (2)

20-31: Good integration of platform data fetching.

The addition of useFetchPlatformById hook and the type change to DecoratedApplication properly aligns with the enhanced application data model.


149-152: Clean simplification using decorated data.

The direct access to application.direct.businessService eliminates the need for a separate component and leverages the enhanced data structure effectively.

client/src/app/pages/applications/application-detail-drawer/tab-tasks-content.tsx (2)

31-88: Comprehensive and well-structured table component.

The TabTasksContent component demonstrates excellent implementation of:

  • Advanced table controls with filtering, sorting, and pagination
  • Proper integration between server-side data fetching and client-side controls
  • URL parameter persistence for table state
  • Comprehensive filter categories with appropriate types

The modular approach and use of established table control patterns ensures consistency with other table implementations.


140-228: Excellent table rendering with proper state handling.

The table implementation properly handles:

  • Loading, error, and no-data states using ConditionalTableBody
  • Task actions integration with TaskActionColumn
  • Navigation links to task details
  • Consistent styling and accessibility attributes

The pagination and toolbar integration provides a complete user experience.

client/src/app/pages/applications/application-form/application-form.tsx (6)

40-43: LGTM: Platform query hooks properly imported

The new platform-related imports follow the established pattern and are correctly grouped with other query imports.


62-62: LGTM: FormValues interface properly extended

The sourcePlatform field is correctly typed as string, consistent with how other entity references are handled in the form (like businessServiceName).


86-107: LGTM: Platform data integration follows established patterns

The platform data handling correctly follows the same pattern used for business services and stakeholders:

  • Fetches all platforms for dropdown options
  • Fetches specific platform for existing application
  • Maps to dropdown option format
  • Provides helper function for name-to-reference conversion

268-268: LGTM: Form initialization and submission properly handle platform data

The form initialization correctly uses the fetched platform name with appropriate fallback, and the submission payload properly converts the platform name back to a reference using the helper function.

Also applies to: 312-312


537-564: LGTM: Source platform UI field follows established patterns perfectly

The new source platform dropdown implementation is consistent with the business service field pattern:

  • Proper form controller wrapper
  • Typeahead variant for better UX
  • Correct accessibility attributes
  • Clear functionality included
  • Consistent value mapping and change handling

684-684: LGTM: Data fetching logic maintains consistency with existing patterns

The platform data fetching implementation follows the established architecture:

  • Uses standard query hook for fetching platforms
  • Provides helper function using the matchItemsToRef utility
  • Returns both data and helper function following the pattern used for other entities

Also applies to: 693-694, 757-758

client/src/app/pages/applications/application-detail-drawer/tab-reports-contents.tsx (4)

36-93: LGTM: Credentials section properly implemented

The credentials logic correctly:

  • Fetches and matches identities by kind using getKindIdByRef
  • Provides clear visual indicators with check icons
  • Handles all combinations of source/maven credentials
  • Uses appropriate fallback messaging

50-54: LGTM: Task state handling is straightforward and correct

The task state logic properly extracts the current analyzer task and uses the TaskStates enum to determine success/failure status.


98-215: LGTM: Analysis section handles all task states appropriately

The analysis section provides comprehensive handling:

  • Success state shows both details link and download options
  • Download buttons respect admin settings with helpful tooltips
  • Failure state uses appropriate error styling
  • Consistent navigation to analysis details across states
  • Proper fallback for unavailable states

218-218: LGTM: Facts rendering properly guarded against loading states

The conditional rendering ensures ApplicationFacts only displays when facts are loaded and available, preventing render issues during fetch operations.

client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx (4)

29-47: LGTM: ApplicationArchetypesLabels component is well-designed

The nested component provides excellent reusability:

  • Flexible filter function parameter for different archetype views
  • Proper TypeScript typing for the filter function
  • Appropriate fallback to empty message
  • Color customization support
  • Clean separation of concerns

57-77: LGTM: Description and links section properly implemented

The section correctly:

  • Uses established helper functions for URL generation (getIssuesSingleAppSelectedLocation, getDependenciesUrlFilteredByAppName)
  • Provides relevant navigation to related application data
  • Guards against null application with conditional rendering
  • Uses semantic list structure for navigation links

79-139: LGTM: Effort and archetype sections properly categorized

The implementation correctly:

  • Provides appropriate fallback for unassigned effort
  • Uses clear archetype categorization (associated, assessed, reviewed)
  • Includes helpful comments explaining filter logic
  • Maintains consistency with archetype table column logic
  • Proper use of the nested component with specific filters

141-153: LGTM: Risk display and detail fields properly delegated

The final sections correctly:

  • Use RiskLabel component for consistent risk display
  • Delegate detailed field rendering to ApplicationDetailFields
  • Pass through necessary callbacks for user interactions
  • Maintain good separation of concerns
client/src/app/pages/applications/application-detail-drawer/application-detail-drawer.tsx (4)

30-44: LGTM: Interface and TabKey enum properly designed

The component interface correctly extends IPageDrawerContentProps and the TabKey enum provides type-safe tab management with clear, descriptive values that align with the tab content structure.


54-70: LGTM: Drawer setup follows established patterns

The drawer configuration correctly:

  • Controls visibility with application presence
  • Manages focus with application ID for accessibility
  • Uses appropriate page key for context
  • Provides clean header with proper styling and application name display

77-133: LGTM: Tab structure well-organized with proper conditional rendering

The tab implementation correctly:

  • Uses consistent conditional rendering to prevent empty tabs
  • Passes appropriate props to each tab content component
  • Provides additional callbacks to Details tab as needed
  • Uses proper internationalization for tab titles
  • Maintains clean separation of concerns with dedicated tab components

50-52: LGTM: Tab state management properly implemented

The active tab state management correctly:

  • Initializes to the Details tab as a sensible default
  • Uses proper event handler for tab selection
  • Employs type-safe casting for the TabKey enum
  • Follows React best practices for controlled components

Also applies to: 74-74

Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

I pushed some structural refactoring into this PR while it was touching all of the application inventory components. I also added the full source platform coordinates.

LGTM

Copy link

@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

🧹 Nitpick comments (1)
client/src/app/pages/applications/application-form/useApplicationFormData.ts (1)

27-36: Consider making repository kind options configurable.

The hardcoded repositoryKindOptions work for now, but consider moving these to a configuration constant or fetching them from the backend if they might change or expand in the future.

If these options are static, consider moving them to a constants file:

// In a constants file
export const REPOSITORY_KIND_OPTIONS: OptionWithValue<string>[] = [
  { value: "git", toString: () => "Git" },
  { value: "subversion", toString: () => "Subversion" },
];
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2af644e and 7528348.

📒 Files selected for processing (17)
  • client/src/app/api/models.ts (3 hunks)
  • client/src/app/api/rest.ts (1 hunks)
  • client/src/app/api/rest/schemas.ts (1 hunks)
  • client/src/app/components/schema-defined-fields/SchemaAsCodeEditor.tsx (4 hunks)
  • client/src/app/components/schema-defined-fields/SchemaAsFields.tsx (6 hunks)
  • client/src/app/components/schema-defined-fields/SchemaDefinedFields.tsx (3 hunks)
  • client/src/app/components/schema-defined-fields/utils.tsx (1 hunks)
  • client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx (1 hunks)
  • client/src/app/pages/applications/application-detail-drawer/tab-platform-content.tsx (1 hunks)
  • client/src/app/pages/applications/application-form/__tests__/application-form.test.tsx (3 hunks)
  • client/src/app/pages/applications/application-form/application-form-modal.tsx (3 hunks)
  • client/src/app/pages/applications/application-form/application-form.tsx (1 hunks)
  • client/src/app/pages/applications/application-form/useApplicationForm.ts (1 hunks)
  • client/src/app/pages/applications/application-form/useApplicationFormData.ts (1 hunks)
  • client/src/app/queries/applications.ts (5 hunks)
  • client/src/app/queries/generators.ts (1 hunks)
  • client/src/app/queries/schemas.ts (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • client/src/app/components/schema-defined-fields/utils.tsx
  • client/src/app/queries/generators.ts
  • client/src/app/api/rest.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • client/src/app/queries/applications.ts
  • client/src/app/pages/applications/application-detail-drawer/tab-platform-content.tsx
  • client/src/app/pages/applications/application-form/tests/application-form.test.tsx
  • client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx
  • client/src/app/api/models.ts
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: in the tackle2-ui codebase, when using yup.lazy for optional object validation, the correct typescri...
Learnt from: sjd78
PR: konveyor/tackle2-ui#2432
File: client/src/app/components/schema-defined-fields/utils.tsx:42-47
Timestamp: 2025-07-17T23:29:20.652Z
Learning: In the tackle2-ui codebase, when using yup.lazy for optional object validation, the correct TypeScript typing is `ReturnType<typeof yup.lazy<yup.AnySchema>>` instead of passing the generic type parameter directly to yup.lazy, due to the specific version of yup being used.

Applied to files:

  • client/src/app/components/schema-defined-fields/SchemaAsFields.tsx
  • client/src/app/pages/applications/application-form/useApplicationForm.ts
📚 Learning: in the tackle2-ui codebase, mutation hooks in the queries files already handle cache invalidation by...
Learnt from: sjd78
PR: konveyor/tackle2-ui#2472
File: client/src/app/pages/controls/job-functions/job-functions.tsx:56-58
Timestamp: 2025-07-18T23:21:22.818Z
Learning: In the tackle2-ui codebase, mutation hooks in the queries files already handle cache invalidation by calling queryClient.invalidateQueries() in their onSuccess callbacks. This ensures immediate UI updates after CRUD operations without needing additional manual invalidation in the UI components.

Applied to files:

  • client/src/app/queries/schemas.ts
📚 Learning: the tackle2-ui codebase uses react query v4 (@tanstack/react-query v4.22.0), where the onerror callb...
Learnt from: sjd78
PR: konveyor/tackle2-ui#2467
File: client/src/app/queries/generators.ts:20-20
Timestamp: 2025-07-21T06:01:43.078Z
Learning: The tackle2-ui codebase uses React Query v4 (@tanstack/react-query v4.22.0), where the onError callback in query configurations is still valid and supported. The deprecation of onError callbacks only applies to React Query v5, so suggestions about removing them are premature until the codebase is upgraded.

Applied to files:

  • client/src/app/queries/schemas.ts
🧬 Code Graph Analysis (4)
client/src/app/pages/applications/application-form/useApplicationFormData.ts (11)
client/src/app/components/SimpleSelect.tsx (1)
  • OptionWithValue (11-14)
client/src/app/components/NotificationsContext.tsx (1)
  • NotificationsContext (31-33)
client/src/app/queries/tags.ts (1)
  • useFetchTagsWithTagItems (65-110)
client/src/app/queries/businessservices.ts (1)
  • useFetchBusinessServices (17-32)
client/src/app/queries/stakeholders.ts (1)
  • useFetchStakeholders (30-52)
client/src/app/queries/applications.ts (3)
  • useFetchApplications (37-61)
  • useCreateApplicationMutation (137-150)
  • useUpdateApplicationMutation (107-120)
client/src/app/queries/platforms.ts (1)
  • useFetchPlatforms (17-34)
client/src/app/utils/model-utils.tsx (2)
  • matchItemsToRefs (275-290)
  • matchItemsToRef (253-262)
client/src/app/api/models.ts (1)
  • Application (134-158)
client/src/app/utils/utils.ts (1)
  • getAxiosErrorMessage (10-16)
client/src/app/api/rest.ts (2)
  • createApplication (292-295)
  • updateApplication (316-317)
client/src/app/api/rest/schemas.ts (2)
client/src/app/api/rest.ts (2)
  • hub (55-65)
  • template (54-54)
client/src/app/api/models.ts (2)
  • Schema (1006-1015)
  • TargetedSchema (1017-1020)
client/src/app/components/schema-defined-fields/SchemaDefinedFields.tsx (1)
client/src/app/api/models.ts (1)
  • JsonSchemaObject (969-1004)
client/src/app/queries/schemas.ts (1)
client/src/app/api/rest/schemas.ts (4)
  • getSchemas (9-10)
  • getSchemaByName (12-13)
  • getPlatformCoordinatesSchema (15-24)
  • getPlatformDiscoveryFiltersSchema (26-35)
🪛 Biome (2.1.2)
client/src/app/pages/applications/application-form/useApplicationForm.ts

[error] 97-97: Comparing to itself is potentially pointless.

(lint/suspicious/noSelfCompare)


[error] 138-138: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 151-151: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 156-156: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 162-162: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 167-167: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 173-173: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 178-178: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 186-186: Do not add then to an object.

(lint/suspicious/noThenProperty)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit-test
  • GitHub Check: build-and-upload-for-global-ci
🔇 Additional comments (12)
client/src/app/components/schema-defined-fields/SchemaAsCodeEditor.tsx (2)

25-25: LGTM! Good addition of required id prop.

The addition of the required id prop enhances component identification and accessibility. The prop is properly typed, passed through to the underlying CodeEditor, and integrated consistently throughout the component.

Also applies to: 34-34, 97-97


43-45: Clean state initialization improvement.

Simplifying the state initialization by directly using JSON.stringify(jsonDocument, null, 2) removes unnecessary intermediate variables and makes the code more concise.

client/src/app/components/schema-defined-fields/SchemaAsFields.tsx (2)

20-21: LGTM! Good refactoring to controlled component pattern.

The addition of the required id prop and replacement of the PatternFly Form wrapper with a styled div improves component flexibility and consistency with the controlled component pattern.

Also applies to: 258-258


249-251: Approve the simplified change handling.

The refactoring to call onDocumentChanged directly on every value change without validation gating aligns with the controlled component pattern. This allows parent components to handle validation and form submission logic externally.

client/src/app/api/rest/schemas.ts (1)

1-36: LGTM! Well-structured REST API module.

The module follows consistent patterns with proper TypeScript typing and good separation of concerns. The use of the hub template function for URL construction and the consistent axios response handling pattern are well implemented.

client/src/app/pages/applications/application-form/application-form-modal.tsx (2)

13-13: LGTM! Good addition of controlled rendering.

The optional isOpen prop with a sensible default and the conditional null return provides better control over modal rendering and prevents unnecessary DOM creation when the modal is closed.

Also applies to: 19-19, 31-33


22-29: Approve the hook separation.

The refactoring to separate data fetching (useApplicationFormData) from form logic (useApplicationForm) improves separation of concerns and makes the component more maintainable and testable.

client/src/app/pages/applications/application-form/useApplicationFormData.ts (2)

75-114: LGTM! Excellent notification handling pattern.

The mutation notification handlers are well-structured with proper internationalization, consistent success/error handling, and integration with the notification system. The separation of create and update success handlers allows for different messaging while sharing the error handler.


117-137: Comprehensive and well-organized return object.

The hook returns a comprehensive set of data, options, helper functions, and mutation handlers that provide everything needed for the application form. The organization and naming are consistent and intuitive.

client/src/app/components/schema-defined-fields/SchemaDefinedFields.tsx (1)

1-78: Well-structured refactoring to controlled component pattern

The refactoring to remove internal state and make the component fully controlled is a good architectural decision. The addition of the id prop with proper propagation to child components improves accessibility and testability.

client/src/app/pages/applications/application-form/useApplicationForm.ts (1)

262-280: Add dependency array to useEffect

The useEffect hook that updates form values when coordinatesSchema changes is missing selectedPlatform and sourcePlatformFromName in its dependency array, which could lead to stale closures.

-  }, [coordinatesSchema, reset, form]);
+  }, [coordinatesSchema, reset, form, selectedPlatform, sourcePlatformFromName]);

Likely an incorrect or invalid review comment.

client/src/app/queries/schemas.ts (1)

1-87: Well-implemented React Query hooks for schema management

The schema query hooks follow best practices with proper conditional fetching, consistent error handling, and clear return interfaces. The use of query keys as constants ensures cache consistency.

Signed-off-by: Scott J Dickerson <[email protected]>
@sjd78 sjd78 force-pushed the Enhance-application-inventory-table branch from 4f9d3f0 to e8cd9d8 Compare July 31, 2025 23:43
Copy link

@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

♻️ Duplicate comments (1)
client/src/app/pages/applications/application-form/useApplicationForm.ts (1)

186-186: Fix validation parameter for asset repository URL

The repositoryUrl validation method on line 186 is receiving "assetKind" but should receive "assetKind" to match the field being validated.

       assetKind: string().oneOf(["", "git", "subversion"]),
       assetRepository: string().when("assetKind", {
         is: (kind: string) => kind !== "",
-        then: (schema) => schema.repositoryUrl("assetKind").required(),
+        then: (schema) => schema.repositoryUrl("assetKind").required(),
       }),
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f9d3f0 and e8cd9d8.

📒 Files selected for processing (2)
  • client/src/app/pages/applications/application-form/application-form.tsx (1 hunks)
  • client/src/app/pages/applications/application-form/useApplicationForm.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • client/src/app/pages/applications/application-form/application-form.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: in the tackle2-ui codebase, when using yup.lazy for optional object validation, the correct typescri...
Learnt from: sjd78
PR: konveyor/tackle2-ui#2432
File: client/src/app/components/schema-defined-fields/utils.tsx:42-47
Timestamp: 2025-07-17T23:29:20.652Z
Learning: In the tackle2-ui codebase, when using yup.lazy for optional object validation, the correct TypeScript typing is `ReturnType<typeof yup.lazy<yup.AnySchema>>` instead of passing the generic type parameter directly to yup.lazy, due to the specific version of yup being used.

Applied to files:

  • client/src/app/pages/applications/application-form/useApplicationForm.ts
🧬 Code Graph Analysis (1)
client/src/app/pages/applications/application-form/useApplicationForm.ts (6)
client/src/app/queries/tags.ts (1)
  • TagItemType (57-63)
client/src/app/api/models.ts (5)
  • TargetedSchema (1017-1020)
  • JsonDocument (926-926)
  • Application (134-158)
  • TagRef (562-565)
  • New (9-9)
client/src/app/pages/applications/application-form/useApplicationFormData.ts (1)
  • useApplicationFormData (38-137)
client/src/app/utils/utils.ts (1)
  • duplicateNameCheck (59-63)
client/src/app/components/schema-defined-fields/utils.tsx (1)
  • jsonSchemaToYupSchema (8-116)
client/src/app/queries/schemas.ts (1)
  • useFetchPlatformCoordinatesSchema (51-67)
🪛 Biome (2.1.2)
client/src/app/pages/applications/application-form/useApplicationForm.ts

[error] 97-97: Comparing to itself is potentially pointless.

(lint/suspicious/noSelfCompare)


[error] 138-138: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 151-151: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 156-156: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 162-162: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 167-167: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 173-173: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 178-178: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 186-186: Do not add then to an object.

(lint/suspicious/noThenProperty)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit-test
  • GitHub Check: build-and-upload-for-global-ci
🔇 Additional comments (1)
client/src/app/pages/applications/application-form/useApplicationForm.ts (1)

136-139: No changes needed for repositoryUrl parameters

The repositoryUrl(fieldName) helper looks up this.parent[fieldName], so its argument must match the schema’s field key:

  • Source repo uses .when("kind") with repositoryUrl("kind").
  • Asset repo uses .when("assetKind") with repositoryUrl("assetKind").

Both names correctly correspond to their respective fields.

Signed-off-by: Scott J Dickerson <[email protected]>
Copy link

@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

♻️ Duplicate comments (3)
client/src/app/pages/applications/application-form/useApplicationForm.ts (3)

97-97: Fix operator precedence issue in tag filtering.

The current expression has incorrect operator precedence. The nullish coalescing operator (??) has lower precedence than the comparison operator, causing the expression to always evaluate to a truthy value.

Apply this fix:

-    return application?.tags?.filter((t) => t?.source ?? "" !== "") ?? [];
+    return application?.tags?.filter((t) => (t?.source ?? "") !== "") ?? [];

184-187: Fix validation parameter for asset repository URL

The repositoryUrl validation method on line 186 is receiving "kind" but should receive "assetKind" to match the field being validated.

       assetKind: string().oneOf(["", "git", "subversion"]),
       assetRepository: string().when("assetKind", {
         is: (kind: string) => kind !== "",
-        then: (schema) => schema.repositoryUrl("kind").required(),
+        then: (schema) => schema.repositoryUrl("assetKind").required(),
       }),

229-229: Fix type inconsistency for owner field.

The default value for owner is set to undefined, but the FormValues interface defines it as string | null. This type mismatch should be corrected.

-      owner: application?.owner?.name || undefined,
+      owner: application?.owner?.name || null,
🧹 Nitpick comments (1)
client/src/app/pages/applications/application-form/useApplicationForm.ts (1)

265-280: Consider optimizing useEffect dependencies.

The form object in the dependency array might cause unnecessary effect executions. Since you're only using form.getValues(), you could optimize this.

   useEffect(() => {
+    const currentValues = form.getValues();
     if (coordinatesSchema) {
       // use reset() to change >1 field at once
       reset({
-        ...form.getValues(),
+        ...currentValues,
         coordinatesSchema: coordinatesSchema,
         coordinatesDocument: {},
       });
     } else {
       reset({
-        ...form.getValues(),
+        ...currentValues,
         coordinatesSchema: undefined,
         coordinatesDocument: undefined,
       });
     }
-  }, [coordinatesSchema, reset, form]);
+  }, [coordinatesSchema, reset]);

However, if the form values need to be preserved during platform changes, the current implementation is correct.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8cd9d8 and 86a8260.

📒 Files selected for processing (2)
  • client/src/app/pages/applications/application-form/application-form.tsx (1 hunks)
  • client/src/app/pages/applications/application-form/useApplicationForm.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • client/src/app/pages/applications/application-form/application-form.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: in the tackle2-ui codebase, when using yup.lazy for optional object validation, the correct typescri...
Learnt from: sjd78
PR: konveyor/tackle2-ui#2432
File: client/src/app/components/schema-defined-fields/utils.tsx:42-47
Timestamp: 2025-07-17T23:29:20.652Z
Learning: In the tackle2-ui codebase, when using yup.lazy for optional object validation, the correct TypeScript typing is `ReturnType<typeof yup.lazy<yup.AnySchema>>` instead of passing the generic type parameter directly to yup.lazy, due to the specific version of yup being used.

Applied to files:

  • client/src/app/pages/applications/application-form/useApplicationForm.ts
🪛 Biome (2.1.2)
client/src/app/pages/applications/application-form/useApplicationForm.ts

[error] 138-138: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 151-151: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 156-156: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 162-162: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 167-167: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 173-173: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 178-178: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 186-186: Do not add then to an object.

(lint/suspicious/noThenProperty)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit-test
  • GitHub Check: build-and-upload-for-global-ci
🔇 Additional comments (3)
client/src/app/pages/applications/application-form/useApplicationForm.ts (3)

51-73: Well-implemented Maven coordinate parser.

The helper function correctly handles the Maven URL format and safely extracts individual coordinate components.


195-205: Excellent implementation of dynamic schema validation.

The coordinatesDocument validation dynamically adapts based on the coordinatesSchema, providing flexible validation that aligns with the selected platform's requirements.


282-345: Well-structured form submission logic.

The payload construction properly handles:

  • String trimming for all text fields
  • Optional field inclusion using conditional spreading
  • Retention of non-editable fields from the original application
  • Correct Maven coordinate formatting

@sjd78 sjd78 merged commit 51e4ab0 into konveyor:main Aug 1, 2025
11 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 29, 2025
sshveta pushed a commit to sshveta/tackle2-ui that referenced this pull request Oct 31, 2025
https://issues.redhat.com/browse/MTA-5245
Resolves: konveyor#2287

Update the inventory table, detail drawer, and create/edit modal to
support new data and actions needed to implement

## Summary by CodeRabbit

* **New Features**
  * Introduced a detailed application drawer with tabbed views for
    Details, Tags, Reports, Reviews, Tasks, and Platform information.
  * Added support for managing source platform and asset repository data
    in the application form.
  * Enhanced bulk and per-application actions in the applications table,
    including new actions for changing source platform, retrieving
    configurations, and generating assets.
  * Added schema-driven platform coordinates support and related UI
    components.
  * Introduced new hooks for fetching schemas and platform-specific schema
    data.
  * Added a multi-section application form with dynamic validation and
    platform-specific coordinates support.
  * Added new translation keys for actions and terms related to
    configurations, source platform, and assets.

* **Improvements**
  * Expanded application metadata and UI to display and edit additional
    platform, repository, and business service details.
  * Refined component structure and naming for clarity and
    maintainability.
  * Improved handling of empty states and localization throughout the UI.
  * Disabled automatic refetch and retries for application manifest
    fetching by default to improve performance.
  * Enhanced form validation and submission logic with improved data
    mapping and error handling.
  * Improved bulk action dropdown styling and conditional enabling based
    on selection.
  * Updated notification handling for application create and update
    actions.

* **Bug Fixes**
  * Ensured platform lists are always returned as arrays to prevent
    undefined errors.

* **Refactor**
  * Reorganized and consolidated UI components, removing deprecated or
    redundant files and updating import paths.
  * Converted schema-defined field components to controlled components
    with improved accessibility IDs.
  * Replaced local repository details component with a shared version for
    consistency.
  * Split application actions column into primary and secondary actions
    for better UX.
  * Renamed several status components for consistency.
  * Replaced single form hook with separate hooks for form data and form
    logic.
  * Centralized exports for detail drawer components.

* **Tests**
  * Updated application form tests to account for new platform data and
    improved validation synchronization.

* **Style**
  * Added new styles for the drawer tab container and its content.

---------

Signed-off-by: Elay Aharoni <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
Co-authored-by: Scott J Dickerson <[email protected]>
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.

Enhance application inventory table, detail drawer, and create/edit modal

2 participants