-
Notifications
You must be signed in to change notification settings - Fork 2
[backend/frontend] refactor: mutualize code for private document list #1609
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
base: development
Are you sure you want to change the base?
Conversation
Summary
Insights
Suites31 passed, 0 failed, and 0 other
🎉 No failed tests in this run. | 🍂 No flaky tests in this run. Github Test Reporter by CTRF 💚 🔄 This comment has been updated |
5712853 to
6076370
Compare
6d48205 to
af9d503
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.
Pull request overview
Refactors private “resource list” pages (integrations, custom dashboards, OpenAEV scenarios) to use the generic documents query end-to-end, removing the now-redundant specialized list queries and centralizing list loading logic.
Changes:
- Frontend list pages now load/refetch via
DocumentsListQuery+documentItem_fragmentinstead of per-resource list queries. - Backend removes
integrations/customDashboards/openAEVScenarioslist queries and routes list fetching throughDocumentApp.loadDocuments. - Updates GraphQL schemas/types and expands the shared document fragment to cover integration-specific fields.
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/portal-front/src/utils/shareable-resources/shareable-resources.types.ts | Extends shareable/subscribable resource unions to include the generic document fragment type. |
| apps/portal-front/src/components/service/openaev-scenarios/openaev-scenario.graphql.ts | Removes OpenAEV scenarios list fragment/query in favor of the generic documents list query. |
| apps/portal-front/src/components/service/openaev-scenarios/[serviceInstanceId]/openaev-scenarios-list.tsx | Switches OpenAEV scenario list to DocumentsListQuery + documentItem_fragment. |
| apps/portal-front/src/components/service/integrations/integration.utils.tsx | Repoints LogicalFilterInput typing to documents query types. |
| apps/portal-front/src/components/service/integrations/integration.graphql.ts | Removes integrations list fragment/query in favor of the generic documents list query. |
| apps/portal-front/src/components/service/integrations/[serviceInstanceId]/public-integrations-list.tsx | Updates refetch typings (currently mismatched; needs correction). |
| apps/portal-front/src/components/service/integrations/[serviceInstanceId]/integrations-list.tsx | Switches integrations list to DocumentsListQuery + documentItem_fragment. |
| apps/portal-front/src/components/service/document/one-click-deploy/one-platform-display.tsx | Makes resource name null-safe for i18n interpolation. |
| apps/portal-front/src/components/service/document/one-click-deploy/one-click-deploy.tsx | Makes telemetry payload resource_title null-safe. |
| apps/portal-front/src/components/service/document/one-click-deploy/choose-platform-form.tsx | Makes resource name null-safe for i18n interpolation. |
| apps/portal-front/src/components/service/document/document.graphql.ts | Expands documentItem_fragment fields and updates documents list query args (notably filters → logicalFilters). |
| apps/portal-front/src/components/service/custom-dashboards/custom-dashboard.graphql.ts | Removes custom dashboards list fragment/query in favor of the generic documents list query. |
| apps/portal-front/src/components/service/custom-dashboards/[serviceInstanceId]/custom-dashboards-list.tsx | Switches custom dashboards list to DocumentsListQuery + documentItem_fragment. |
| apps/portal-front/src/components/service/components/service-manage-sheet.tsx | Makes document name null-safe for i18n interpolation. |
| apps/portal-front/schema.graphql | Updates client schema: removes deprecated list queries and updates documents signature. |
| apps/portal-front/app/(application)/app/(user)/service/opencti_integrations/[serviceInstanceId]/page-loader.tsx | Loads integrations lists through DocumentsListQuery with logical filters. |
| apps/portal-front/app/(application)/app/(user)/service/opencti_custom_dashboards/[serviceInstanceId]/page-loader.tsx | Loads custom dashboards lists through DocumentsListQuery with logical filters. |
| apps/portal-front/app/(application)/app/(user)/service/openaev_scenarios/[serviceInstanceId]/page-loader.tsx | Loads OpenAEV scenario lists through DocumentsListQuery with logical filters. |
| apps/portal-api/src/modules/services/openaev-scenarios/openaev-scenarios.resolver.ts | Removes openAEVScenarios list resolver. |
| apps/portal-api/src/modules/services/openaev-scenarios/openaev-scenarios.graphql | Removes openAEVScenarios list field from service schema. |
| apps/portal-api/src/modules/services/integrations/integrations.resolver.ts | Removes integrations list resolver. |
| apps/portal-api/src/modules/services/integrations/integrations.graphql | Removes integrations list field from service schema. |
| apps/portal-api/src/modules/services/integrations/integrations.app.ts | Removes list-loading app method (now handled by documents). |
| apps/portal-api/src/modules/services/document/domain/document.domain.ts | Updates parent-documents loader to respect parentsOnly input. |
| apps/portal-api/src/modules/services/document/document.resolver.ts | Routes documents query through DocumentApp.loadDocuments (error mapping behavior changed). |
| apps/portal-api/src/modules/services/document/document.helper.ts | Introduces ALL_METADATA_KEYS for generic list loading. |
| apps/portal-api/src/modules/services/document/document.graphql | Removes legacy filters arg from documents query signature. |
| apps/portal-api/src/modules/services/document/document.app.ts | Adds DocumentApp.loadDocuments to infer document type from service definition and fetch list. |
| apps/portal-api/src/modules/services/custom-dashboards/custom-dashboards.resolver.ts | Removes customDashboards list resolver. |
| apps/portal-api/src/modules/services/custom-dashboards/custom-dashboards.graphql | Removes customDashboards list field from service schema. |
| apps/portal-api/src/generated/resolvers-types.ts | Updates generated resolver types to reflect schema removals/arg changes. |
Files not reviewed (1)
- apps/portal-api/src/generated/resolvers-types.ts: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...l-front/src/components/service/integrations/[serviceInstanceId]/public-integrations-list.tsx
Show resolved
Hide resolved
108ce77 to
472b2ef
Compare
472b2ef to
aeef4a5
Compare
Context
Use same generic documents methods to load list of resources.
How to test
Related issues
Checklist
Quality
Testing
What tests have been made
Additional information