Skip to content

Commit b0ca309

Browse files
[Chrome Next] Migrate content connectors to AppHeader (#289612)
## Summary This PR migrates `Content connectors` pages to the new `AppHeader`. Part of: elastic/kibana-team#3945 ### Visuals https://github.com/user-attachments/assets/a51f7dbd-d648-486f-8e4d-c10cd3d5a961
1 parent 913e17c commit b0ca309

12 files changed

Lines changed: 383 additions & 346 deletions

File tree

x-pack/platform/plugins/shared/content_connectors/moon.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ dependsOn:
6363
- '@kbn/logging'
6464
- '@kbn/shared-ux-ai-components'
6565
- '@kbn/deeplinks-management'
66+
- '@kbn/app-header'
6667
- '@kbn/ui-callout'
6768
- '@kbn/usage-collection-plugin'
6869
- '@kbn/core-logging-server-mocks'

x-pack/platform/plugins/shared/content_connectors/public/api/connector/cached_fetch_connector_by_id_api_logic.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export interface CachedFetchConnectorByIdApiLogicActions {
4040
setTimeoutId(id: NodeJS.Timeout): { id: NodeJS.Timeout };
4141
startPolling(connectorId: string): { connectorId: string };
4242
stopPolling(): void;
43+
updateConnectorData(update: Partial<Connector>): Partial<Connector>;
4344
}
4445
export interface CachedFetchConnectorByIdApiLogicValues {
4546
connectorData: Connector | null;
@@ -62,6 +63,7 @@ export const CachedFetchConnectorByIdApiLogic = kea<
6263
setTimeoutId: (id) => ({ id }),
6364
startPolling: (connectorId) => ({ connectorId }),
6465
stopPolling: true,
66+
updateConnectorData: (update) => update,
6567
},
6668
connect: {
6769
actions: [FetchConnectorByIdApiLogic, ['apiSuccess', 'apiError', 'apiReset', 'makeRequest']],
@@ -123,6 +125,13 @@ export const CachedFetchConnectorByIdApiLogic = kea<
123125
? currentState
124126
: newConnectorData.connector ?? null;
125127
},
128+
updateConnectorData: (currentState, update) => {
129+
if (!currentState) {
130+
return currentState;
131+
}
132+
const nextState = { ...currentState, ...update };
133+
return isEqual(currentState, nextState) ? currentState : nextState;
134+
},
126135
},
127136
],
128137
connectorId: [

0 commit comments

Comments
 (0)