@spinnaker/core 2025.1.4 → 2025.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,30 @@
1
+ import { useMemo } from 'react';
2
+ import type { ITaskMonitorConfig } from './TaskMonitor';
3
+ import { TaskMonitor } from './TaskMonitor';
4
+
5
+ /**
6
+ * React hook that returns a TaskMonitor
7
+ *
8
+ * @param config a ITaskMonitorConfig
9
+ * @param dismissModal a function that closes the modal enclosing the task monitor
10
+ *
11
+ * Example:
12
+ *
13
+ * function MyComponent(props) {
14
+ * const { application, serverGroup } = props;
15
+ * const title = `Resize ${serverGroup.name}`;
16
+ * const taskMonitor = useTaskMonitor({ application, title });
17
+ *
18
+ * return (
19
+ * <>
20
+ * <TaskMonitorWrapper taskMonitor={taskMonitor}>
21
+ * <form onSubmit={() => taskMonitor.submit(() => API.runSomeTask())}>
22
+ * </>
23
+ * )
24
+ * }
25
+ *
26
+ */
27
+ export const useTaskMonitor = (config: ITaskMonitorConfig, dismissModal: () => void) => {
28
+ const modalInstance = TaskMonitor.modalInstanceEmulation(() => dismissModal());
29
+ return useMemo(() => new TaskMonitor({ modalInstance, ...config }), [config.application, config.title]);
30
+ };
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { IOverridableProps } from '../overrideRegistry';
3
- export interface ILoadBalancerDetailsProps extends IOverridableProps {
4
- }
5
- export declare class LoadBalancerDetails extends React.Component<ILoadBalancerDetailsProps> {
6
- render(): JSX.Element;
7
- }
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
-
3
- import type { IOverridableProps } from '../overrideRegistry';
4
- import { Overridable } from '../overrideRegistry';
5
-
6
- export interface ILoadBalancerDetailsProps extends IOverridableProps {}
7
-
8
- @Overridable('loadBalancer.details')
9
- export class LoadBalancerDetails extends React.Component<ILoadBalancerDetailsProps> {
10
- public render() {
11
- return <h3>Load Balancer Details</h3>;
12
- }
13
- }