-
Notifications
You must be signed in to change notification settings - Fork 51
✨ Enhance application inventory #2468
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
✨ Enhance application inventory #2468
Conversation
WalkthroughThis 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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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:
- Lines 744, 752, 760: Placeholder console.log statements need actual implementation
- Line 743: The "change source platform" action requires at least 2 selected items, which is appropriate for bulk operations
- 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
📒 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
classNameprop enhances the component's flexibility for styling customization.
30-30: LGTM: Proper prop usage.The
classNameprop is correctly accepted and passed to theCodeEditorcomponent, 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
PlatformCoordinatestab 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
TabPlatformCoordinatesContentcomponent 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
useFetchPlatformByIdanduseFetchPlatformsare 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
useFetchPlatformByIdhook 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
businessServiceOptionsandstakeholdersOptions, 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
sourcePlatformToRefand 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
useFetchPlatformshook- Provides a
sourcePlatformToRefhelper 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
...rc/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx
Outdated
Show resolved
Hide resolved
client/src/app/pages/applications/applications-table/applications-table.tsx
Outdated
Show resolved
Hide resolved
73864ea to
f5efae6
Compare
7429d0d to
af530ed
Compare
There was a problem hiding this 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
📒 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
Documentinterface 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:
platformenables source platform associationcoordinatesuses the new Document interface for schema-validated platform coordinatesassets/repositorysupport asset generation and storageidentitiesandarchetypesprovide additional metadata capabilitiesMaking 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
usePlatformProviderListhook that now returns an object with aprovidersproperty 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
providersproperty instead of a direct array makes the hook more extensible for future enhancements like loading states, metadata, or additional provider-related data.
Signed-off-by: Elay Aharoni <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
5e57147 to
535f538
Compare
Signed-off-by: Scott J Dickerson <[email protected]>
- 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]>
Signed-off-by: Scott J Dickerson <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
535f538 to
cb70e7c
Compare
There was a problem hiding this 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
📒 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
messageprop 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
TabTagsContentcomponent 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
ApplicationTagsThe 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
TabPlatformContentcomponent demonstrates good architectural practices:
- Clean separation into logical sections with consistent labeling
- Proper handling of optional data using
EmptyTextMessagefallbacks- Effective reuse of components like
RepositoryDetailsandSchemaDefinedField- 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
useFetchPlatformByIdhook and the type change toDecoratedApplicationproperly aligns with the enhanced application data model.
149-152: Clean simplification using decorated data.The direct access to
application.direct.businessServiceeliminates 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
TabTasksContentcomponent 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 importedThe new platform-related imports follow the established pattern and are correctly grouped with other query imports.
62-62: LGTM: FormValues interface properly extendedThe
sourcePlatformfield is correctly typed as string, consistent with how other entity references are handled in the form (likebusinessServiceName).
86-107: LGTM: Platform data integration follows established patternsThe 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 dataThe 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 perfectlyThe 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 patternsThe platform data fetching implementation follows the established architecture:
- Uses standard query hook for fetching platforms
- Provides helper function using the
matchItemsToRefutility- 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 implementedThe 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 correctThe task state logic properly extracts the current analyzer task and uses the
TaskStatesenum to determine success/failure status.
98-215: LGTM: Analysis section handles all task states appropriatelyThe 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 statesThe conditional rendering ensures
ApplicationFactsonly 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-designedThe 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 implementedThe 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 categorizedThe 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 delegatedThe final sections correctly:
- Use
RiskLabelcomponent 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 designedThe component interface correctly extends
IPageDrawerContentPropsand theTabKeyenum provides type-safe tab management with clear, descriptive values that align with the tab content structure.
54-70: LGTM: Drawer setup follows established patternsThe 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 renderingThe 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 implementedThe 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
Signed-off-by: Scott J Dickerson <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
… setup Signed-off-by: Scott J Dickerson <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
sjd78
left a comment
There was a problem hiding this 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
There was a problem hiding this 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
repositoryKindOptionswork 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
📒 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.tsxclient/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 requiredidprop.The addition of the required
idprop 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
idprop 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
onDocumentChangeddirectly 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
hubtemplate 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
isOpenprop 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 patternThe refactoring to remove internal state and make the component fully controlled is a good architectural decision. The addition of the
idprop 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 useEffectThe useEffect hook that updates form values when coordinatesSchema changes is missing
selectedPlatformandsourcePlatformFromNamein 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 managementThe 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.
client/src/app/pages/applications/application-form/application-form.tsx
Outdated
Show resolved
Hide resolved
client/src/app/pages/applications/application-form/useApplicationForm.ts
Show resolved
Hide resolved
Signed-off-by: Scott J Dickerson <[email protected]>
4f9d3f0 to
e8cd9d8
Compare
There was a problem hiding this 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 URLThe
repositoryUrlvalidation 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
📒 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 forrepositoryUrlparametersThe
repositoryUrl(fieldName)helper looks upthis.parent[fieldName], so its argument must match the schema’s field key:
- Source repo uses
.when("kind")withrepositoryUrl("kind").- Asset repo uses
.when("assetKind")withrepositoryUrl("assetKind").Both names correctly correspond to their respective fields.
client/src/app/pages/applications/application-form/useApplicationForm.ts
Outdated
Show resolved
Hide resolved
client/src/app/pages/applications/application-form/useApplicationForm.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Scott J Dickerson <[email protected]>
There was a problem hiding this 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 URLThe
repositoryUrlvalidation 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
owneris set toundefined, but theFormValuesinterface defines it asstring | 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
formobject in the dependency array might cause unnecessary effect executions. Since you're only usingform.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
📒 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
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]>
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:
SchemaDefinedFieldsSummary by CodeRabbit
New Features
Improvements
Bug Fixes
Refactor
Tests
Style