Tier 4: Migrate 6 Reflux stores with UI state or cross-store dependencies#25372
Draft
dennisoelkers wants to merge 24 commits intomasterfrom
Draft
Tier 4: Migrate 6 Reflux stores with UI state or cross-store dependencies#25372dennisoelkers wants to merge 24 commits intomasterfrom
dennisoelkers wants to merge 24 commits intomasterfrom
Conversation
Use StaticFields.create/remove from @graylog/server-api instead of the Reflux store. Remove cross-store dependency from InputsStore since react-query cache invalidation already handles input list refresh. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace all usages of the Reflux InputStatesStore with the existing useInputsStates hook and useInputStateMutations hook. Components now use SystemInputStates from @graylog/server-api directly where hooks cannot be used (StartInputStep). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace all usages of InputTypesStore with existing hooks: - useInputTypesDescriptions for input type descriptions - useInputTypes (hooks/) for input type summaries - fetchInputType for fetching a single input type definition Move InputDescription type to hooks/useInputType.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create usePipelineConnections hook for fetching connections and usePipelineConnectionMutation for updating pipeline-to-stream connections. Uses PipelinesConnections from @graylog/server-api. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace StreamRulesStore with useStreamRuleMutations hook for create/update/remove operations. Update useStreamRuleTypes to use generated API client directly. Remove onChange/unregister callbacks in favor of query invalidation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace GrokPatternsStore with exported functions in hooks/useGrokPatterns.ts that call the generated SystemGrok API client. Update all three consumers (GrokPatterns, BulkLoadPatternModal, GrokExtractorConfiguration) and replace CancellablePromise patterns with unmounted flags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create useOutputMutations hook for save/update/remove operations using SystemOutputs API client. Move Output type to hooks/useOutputs. Update OutputsComponent to use useOutputs/useStreamOutputs hooks instead of store callbacks. Update OutputsList and AddOutputButton to use mutations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ContentPacksActions with direct calls to SystemContentPacks API client. Replace useStore(ContentPacksStore) in EditContentPackPage with useContentPackRevisions hook. Use queryClient.invalidateQueries for cache refresh after upload. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… API calls Replace LookupTablesStore, LookupTableCachesStore, and LookupTableDataAdaptersStore with direct REST calls via lookupTablesAPI.ts. Consumers now use react-query or call API functions directly instead of going through Reflux stores. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…query hooks Replace the Reflux store with standalone API functions (fetchIndexSets, createIndexSet, updateIndexSet, deleteIndexSet, setDefaultIndexSet, etc.) and leverage existing useIndexSetsList/useSingleIndexSet react-query hooks. Update all 20 consumer files including tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the useFetchLookupTables hook with direct named exports of fetchPaginatedLookupTables and lookupTablesKeyFn from useLookupTablesAPI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract the load balancer override logic from the Reflux store into a plain exported function in src/api/system-load-balancer.ts. Update NodesActions and GraylogNodeActions to import the new function, and remove the SystemLoadBalancerStore listener from ClusterOverviewStore. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract pause/resume processing into src/api/system-processing.ts, update all consumers to use the new functions, and remove the SystemProcessingStore listenTo from ClusterOverviewStore. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate StartpageStore to a plain `setStartpage` function in `api/startpage.ts`. The new function calls `CurrentUserStore.reload()` directly after success instead of relying on Reflux trigger/listenTo coupling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate from Reflux TelemetrySettingsStore/TelemetrySettingsActions to react-query useTelemetrySettings and useUpdateTelemetrySettings hooks, with plain fetch functions for the telemetry settings API endpoint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…vider - Create ServerAvailabilityContext with types and context definition - Create ServerAvailabilityProvider with state management and ping logic - Create api/server-availability module-level callback pattern for FetchProvider - Update FetchProvider to use new reportSuccess/reportError imports - Update AppFacade to consume context instead of Reflux store - Update useServerVersion to use context - Update ServerUnavailablePage to import ServerError from new location - Wrap AppFacade with ServerAvailabilityProvider in index.tsx - Update FetchProvider test mock - Delete ServerAvailabilityStore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove vestigial TelemetrySettingsStoreState type with no consumers - Replace @ts-ignore with proper type assertion in convertPreferences Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit d29fa12.
…flux-stores-tier-4 # Conflicts: # graylog2-web-interface/src/routing/AppFacade.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Motivation and Context
SystemLoadBalancerStoreandSystemProcessingStore(action-only stores) with plain async functions in src/api/, remove their listenTo chains fromClusterOverviewStoreStartpageStoreandPreferencesStorewith plain async functions that callCurrentUserStore.reload()directly, removing Reflux action/completed listener coupling from CurrentUserStoreTelemetrySettingsStorewithreact-queryhooks (useTelemetrySettings,useUpdateTelemetrySettings) for automatic cache managementServerAvailabilityStorewith a React Context + Provider + module-level callback pattern, allowing both React components and the non-ReactFetchProviderto report/consume server availability state/nocl Internal refactoring
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: