@spinnaker/titus 2025.1.4 → 2025.2.0
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.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinnaker/titus",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "2025.
|
|
4
|
+
"version": "2025.2.0",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"publishConfig": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"shx": "0.3.3",
|
|
49
49
|
"typescript": "5.0.4"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "81190a0beb5d741f276e39ef2b7c6034294f977f"
|
|
52
52
|
}
|
|
@@ -14,12 +14,11 @@ import {
|
|
|
14
14
|
SpinFormik,
|
|
15
15
|
TaskMonitorWrapper,
|
|
16
16
|
UserVerification,
|
|
17
|
+
useTaskMonitor,
|
|
17
18
|
ValidationMessage,
|
|
18
19
|
} from '@spinnaker/core';
|
|
19
20
|
import type { ITitusServerGroup } from '../../../domain';
|
|
20
21
|
|
|
21
|
-
import { useTaskMonitor } from './useTaskMonitor';
|
|
22
|
-
|
|
23
22
|
const { useState, useEffect, useMemo } = React;
|
|
24
23
|
|
|
25
24
|
export interface ITitusResizeServerGroupModalProps extends IModalComponentProps {
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ITaskMonitorConfig } from '@spinnaker/core';
|
|
2
|
-
import { TaskMonitor } from '@spinnaker/core';
|
|
3
|
-
/**
|
|
4
|
-
* React hook that returns a TaskMonitor
|
|
5
|
-
*
|
|
6
|
-
* @param config a ITaskMonitorConfig
|
|
7
|
-
* @param dismissModal a function that closes the modal enclosing the task monitor
|
|
8
|
-
*
|
|
9
|
-
* Example:
|
|
10
|
-
*
|
|
11
|
-
* function MyComponent(props) {
|
|
12
|
-
* const { application, serverGroup } = props;
|
|
13
|
-
* const title = `Resize ${serverGroup.name}`;
|
|
14
|
-
* const taskMonitor = useTaskMonitor({ application, title });
|
|
15
|
-
*
|
|
16
|
-
* return (
|
|
17
|
-
* <>
|
|
18
|
-
* <TaskMonitorWrapper taskMonitor={taskMonitor}>
|
|
19
|
-
* <form onSubmit={() => taskMonitor.submit(() => API.runSomeTask())}>
|
|
20
|
-
* </>
|
|
21
|
-
* )
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
export declare const useTaskMonitor: (config: ITaskMonitorConfig, dismissModal: () => void) => TaskMonitor;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import type { ITaskMonitorConfig } from '@spinnaker/core';
|
|
3
|
-
import { TaskMonitor } from '@spinnaker/core';
|
|
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
|
-
};
|