hise-flow-graphs 1.0.11 → 1.0.13

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,6 +1,6 @@
1
1
  {
2
2
  "name": "hise-flow-graphs",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "This package manages ReactFlow graphs for HISE.",
5
5
  "main": "dist/main.js",
6
6
  "repository": "git@github.com:aifimmunology/hise-flow-graphs.git",
@@ -23,8 +23,8 @@ export type Pipeline = {
23
23
  };
24
24
 
25
25
  export enum PipelineStatus {
26
- Completed = "Completed",
27
- Failure = "Failure",
26
+ Completed = 'Completed',
27
+ Failure = 'Failure',
28
28
  };
29
29
 
30
30
  export type IDE = {
@@ -35,4 +35,4 @@ export type IDE = {
35
35
  export enum IDEState {
36
36
  ACTIVE = 'ACTIVE',
37
37
  STOPPED = 'STOPPED',
38
- }
38
+ };
@@ -1,12 +1,44 @@
1
1
  import React from 'react';
2
- import { ConfirmationModal } from 'hise-components';
2
+ import { ConfirmationModal, Button } from 'hise-components';
3
+ import { Status } from './index';
3
4
  import { Pipeline } from '../../../../@types/GeneralTypes';
4
5
 
6
+ const Content = ({ pipeline }: { pipeline: Pipeline }) => {
7
+ return (
8
+ <>
9
+ <table className="table">
10
+ <tbody>
11
+ <tr>
12
+ <th scope="row">
13
+ Status
14
+ </th>
15
+ <td>
16
+ <Status status={pipeline.status} />
17
+ </td>
18
+ </tr>
19
+ </tbody>
20
+ </table>
21
+
22
+ <Button
23
+ id="view-pipe-btn"
24
+ key="view-pipe-btn"
25
+ color="secondary"
26
+ target="_blank"
27
+ to={`/data-mgt/pipeline-dashboard/${pipeline.id}`}
28
+ >
29
+ View More
30
+ </Button>
31
+ </>
32
+ );
33
+ };
34
+
5
35
  const PipelineModal = ({ isOpen, toggle, pipeline }: {
6
36
  isOpen: boolean,
7
37
  toggle: Function,
8
38
  pipeline: Pipeline | null,
9
39
  }) => {
40
+ if (!pipeline) return null;
41
+
10
42
  return (
11
43
  <ConfirmationModal
12
44
  id="about-pipeline-modal"
@@ -14,10 +46,8 @@ const PipelineModal = ({ isOpen, toggle, pipeline }: {
14
46
  noSubmit
15
47
  isOpen={isOpen}
16
48
  onClose={toggle}
17
- headerContent="What wil go here"
18
- content={
19
- pipeline ? JSON.stringify(pipeline) : 'No current pipeline data'
20
- }
49
+ headerContent={`${pipeline.pipelineType} Pipeline`}
50
+ content={<Content pipeline={pipeline} />}
21
51
  cancelButtonText="Close"
22
52
  />
23
53
  );
@@ -29,18 +29,22 @@ const RetryPipelineButton = ({ pipeline }: { pipeline: Pipeline | null }) => {
29
29
  RETRY?
30
30
  </Button>
31
31
  );
32
- }
32
+ };
33
+
34
+ export const Status = ({ status }: { status: PipelineStatus }) => (
35
+ <section>
36
+ <span className={`badge rounded-pill ${statusColor[status]}`}>
37
+ {status}
38
+ </span>
39
+ </section>
40
+ );
33
41
 
34
42
  const ReplicaPipelineInfo = ({ pipeline }: { pipeline: Pipeline | null }) => {
35
43
  if (R.isNil(pipeline) || R.isEmpty(pipeline)) return null;
36
44
 
37
45
  return (
38
46
  <div className="text-center">
39
- <section>
40
- <span className={`badge rounded-pill ${statusColor[pipeline.status]}`}>
41
- {pipeline.status}
42
- </span>
43
- </section>
47
+ <Status status={pipeline.status} />
44
48
  <RetryPipelineButton pipeline={pipeline} />
45
49
  </div>
46
50
  );
@@ -61,8 +65,10 @@ const ReplicaPipelineNode = (props: NodeProps) => {
61
65
 
62
66
  useEffect(() => {
63
67
  const getReplicaPipelineInfo = async () => {
68
+ const id = pipelineId.replace('Pipeline/', '');
69
+
64
70
  await fetch(
65
- `${process.env.REACT_APP_API_ROUTE}/ledger/pipeline/${pipelineId}`,
71
+ `${process.env.REACT_APP_API_ROUTE}/ledger/pipeline/${id}`,
66
72
  { method: 'GET', credentials: 'include' },
67
73
  )
68
74
  .then((async (response) => {
@@ -26,10 +26,10 @@ const WorkspaceFileNode = (props: NodeProps) => {
26
26
  toast.success('Copied file into exploration.')
27
27
  } else {
28
28
  const error: any = await resp.json();
29
-
30
- toggleFileModal();
31
29
  toast.error('Unable to copy file: ' + error.Message);
32
30
  }
31
+
32
+ toggleFileModal();
33
33
  });
34
34
  } catch (error: any) {
35
35
  console.log(error);
@@ -34,10 +34,10 @@ const WorkspaceIDENode = (props: NodeProps) => {
34
34
  toast.success('Copied IDE setup into exploration.')
35
35
  } else {
36
36
  const error: any = await resp.json();
37
-
38
- toggleIDEModal();
39
37
  toast.error('Unable to copy IDE: ' + error.Message);
40
38
  }
39
+
40
+ toggleIDEModal();
41
41
  });
42
42
  } catch (error: any) {
43
43
  console.log(error);
@@ -78,10 +78,10 @@ export const startPipeline = async (
78
78
  toast.success('Started pipeline.')
79
79
  } else {
80
80
  const error: any = await resp.json();
81
-
82
- toggleModal();
83
81
  toast.error('Unable to start pipeline: ' + error.Message);
84
82
  }
83
+
84
+ toggleModal();
85
85
  });
86
86
  } else {
87
87
  refresh();