hise-flow-graphs 1.1.19 → 1.1.21

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.
Files changed (54) hide show
  1. package/dist/@types/CertificateTypes.d.ts +64 -0
  2. package/dist/@types/GeneralTypes.d.ts +35 -0
  3. package/dist/components/Certificates/CertificateGraph/LayerBackButton.d.ts +2 -0
  4. package/dist/components/Certificates/CertificateGraph/NodeAttributes.d.ts +9 -0
  5. package/dist/components/Certificates/CertificateGraph/helpers.d.ts +31 -0
  6. package/dist/components/Certificates/CertificateGraph/index.d.ts +16 -0
  7. package/dist/components/Certificates/EditCertificate/EditNode.d.ts +3 -0
  8. package/dist/components/Certificates/EditCertificate/EditNodeModal.d.ts +18 -0
  9. package/dist/components/Certificates/EditCertificate/MaskMetadataModal/EMRMaskingTables.d.ts +10 -0
  10. package/dist/components/Certificates/EditCertificate/MaskMetadataModal/MaskMetadataTable.d.ts +20 -0
  11. package/dist/components/Certificates/EditCertificate/MaskMetadataModal/helpers.d.ts +7 -0
  12. package/dist/components/Certificates/EditCertificate/MaskMetadataModal/index.d.ts +21 -0
  13. package/dist/components/Certificates/EditCertificate/helpers.d.ts +6 -0
  14. package/dist/components/Certificates/EditCertificate/index.d.ts +8 -0
  15. package/dist/components/Certificates/FileLayerNode/CopyFileLayer.d.ts +24 -0
  16. package/dist/components/Certificates/FileLayerNode/index.d.ts +3 -0
  17. package/dist/components/Certificates/ReadCertificate/MetadataModal/MetadataTable.d.ts +10 -0
  18. package/dist/components/Certificates/ReadCertificate/MetadataModal/helpers.d.ts +8 -0
  19. package/dist/components/Certificates/ReadCertificate/MetadataModal/index.d.ts +10 -0
  20. package/dist/components/Certificates/ReadCertificate/ReadNode.d.ts +3 -0
  21. package/dist/components/Certificates/ReadCertificate/index.d.ts +5 -0
  22. package/dist/components/Certificates/ReviewCertificate/RestrictNode/index.d.ts +10 -0
  23. package/dist/components/Certificates/ReviewCertificate/ReviewNode.d.ts +3 -0
  24. package/dist/components/Certificates/ReviewCertificate/ReviewNodes/index.d.ts +22 -0
  25. package/dist/components/Certificates/ReviewCertificate/helpers.d.ts +14 -0
  26. package/dist/components/Certificates/ReviewCertificate/index.d.ts +7 -0
  27. package/dist/components/Certificates/WalkingGraph/ActionsMenu.d.ts +4 -0
  28. package/dist/components/Certificates/WalkingGraph/LayerItemsModal.d.ts +5 -0
  29. package/dist/components/Certificates/WalkingGraph/WalkingNode.d.ts +3 -0
  30. package/dist/components/Certificates/WalkingGraph/helpers.d.ts +11 -0
  31. package/dist/components/Certificates/WalkingGraph/index.d.ts +5 -0
  32. package/dist/components/Certificates/WorkspaceCertificate/ReplicaIDENode/helpers.d.ts +2 -0
  33. package/dist/components/Certificates/WorkspaceCertificate/ReplicaIDENode/index.d.ts +3 -0
  34. package/dist/components/Certificates/WorkspaceCertificate/ReplicaPipelineNode/index.d.ts +15 -0
  35. package/dist/components/Certificates/WorkspaceCertificate/RestrictedNode/index.d.ts +7 -0
  36. package/dist/components/Certificates/WorkspaceCertificate/WorkspaceFileNode/helpers.d.ts +1 -0
  37. package/dist/components/Certificates/WorkspaceCertificate/WorkspaceFileNode/index.d.ts +3 -0
  38. package/dist/components/Certificates/WorkspaceCertificate/WorkspaceIDENode/IDEModal.d.ts +7 -0
  39. package/dist/components/Certificates/WorkspaceCertificate/WorkspaceIDENode/helpers.d.ts +3 -0
  40. package/dist/components/Certificates/WorkspaceCertificate/WorkspaceIDENode/index.d.ts +3 -0
  41. package/dist/components/Certificates/WorkspaceCertificate/WorkspaceNode/index.d.ts +8 -0
  42. package/dist/components/Certificates/WorkspaceCertificate/WorkspacePipelineNode/PipelineModal.d.ts +7 -0
  43. package/dist/components/Certificates/WorkspaceCertificate/WorkspacePipelineNode/helpers.d.ts +3 -0
  44. package/dist/components/Certificates/WorkspaceCertificate/WorkspacePipelineNode/index.d.ts +3 -0
  45. package/dist/components/Certificates/WorkspaceCertificate/helpers.d.ts +10 -0
  46. package/dist/components/Certificates/WorkspaceCertificate/index.d.ts +8 -0
  47. package/dist/index.d.ts +16 -0
  48. package/dist/index.es.js +9450 -9506
  49. package/dist/index.umd.js +40 -40
  50. package/dist/state/GraphContext.d.ts +21 -0
  51. package/dist/utils/getCertificateBody.d.ts +3 -0
  52. package/package.json +50 -50
  53. package/src/components/Certificates/CertificateGraph/helpers.tsx +9 -3
  54. package/src/components/Certificates/WalkingGraph/helpers.ts +37 -22
@@ -0,0 +1,21 @@
1
+ import { Node } from 'reactflow';
2
+ import { Certificate, Replica, NodeLayers } from '../@types/CertificateTypes';
3
+ type GraphContextType = {
4
+ certificate: Certificate | any;
5
+ node: Node | any;
6
+ setNode: (p: Node | object) => void;
7
+ type: string;
8
+ replica: Replica | any;
9
+ nodesState: any;
10
+ edgesState: any;
11
+ nodeLayers: NodeLayers;
12
+ setNodeLayers: (p: NodeLayers) => void;
13
+ };
14
+ declare const GraphProvider: (props: {
15
+ type: string;
16
+ certificate: Certificate;
17
+ replica?: Replica;
18
+ children: React.ReactNode;
19
+ }) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const useGraph: () => GraphContextType;
21
+ export default GraphProvider;
@@ -0,0 +1,3 @@
1
+ export declare const certificateSchemesEndpoint: (schemesId: string, baseUrl: string, isPublic: boolean) => string;
2
+ declare const getCertificateBody: (certificateId: string, baseUrl: string, isPublic?: boolean, setResponse?: Function) => Promise<any>;
3
+ export default getCertificateBody;
package/package.json CHANGED
@@ -1,52 +1,52 @@
1
1
  {
2
- "name": "hise-flow-graphs",
3
- "version": "1.1.19",
4
- "description": "This package manages ReactFlow graphs for HISE.",
5
- "private": false,
6
- "type": "module",
7
- "main": "dist/index.umd.js",
8
- "module": "dist/index.es.js",
9
- "types": "dist/index.d.ts",
10
- "scripts": {
11
- "build": "vite build && tsc --project tsconfig.app.json",
12
- "start": "vite build --mode development && chokidar 'src/**/*.{ts,tsx,js,jsx,css,scss}' -c 'vite build --mode development'",
13
- "build:dev": "vite build --mode development",
14
- "build:stage": "vite build --mode staging",
15
- "build:prod": "vite build --mode production",
16
- "lint": "eslint .",
17
- "preview": "vite preview"
18
- },
19
- "dependencies": {
20
- "@xyflow/react": "^12.8.4",
21
- "bootstrap": "5.1.3",
22
- "dagre": "^0.8.5",
23
- "hise-components": "^1.0.0",
24
- "ramda": "0.27.1",
25
- "react-quill": "^2.0.0",
26
- "react-toastify": "^9.1.3",
27
- "reactflow": "^11.8.1"
28
- },
29
- "devDependencies": {
30
- "@eslint/js": "^9.33.0",
31
- "@types/dagre": "^0.7.49",
32
- "@types/node": "^22.15.24",
33
- "@types/ramda": "^0.29.3",
34
- "@types/react": "^18.3.18",
35
- "@types/react-dom": "^18.3.5",
36
- "@vitejs/plugin-react": "^4.3.4",
37
- "chokidar-cli": "^3.0.0",
38
- "eslint": "^9.33.0",
39
- "eslint-plugin-react": "^7.33.1",
40
- "eslint-plugin-react-hooks": "^5.2.0",
41
- "eslint-plugin-react-refresh": "^0.4.20",
42
- "globals": "^16.3.0",
43
- "typescript": "~5.8.3",
44
- "typescript-eslint": "^8.39.1",
45
- "vite": "^7.1.2",
46
- "vite-tsconfig-paths": "^5.1.1"
47
- },
48
- "peerDependencies": {
49
- "react": "^18.0.0",
50
- "react-dom": "^18.0.0"
51
- }
2
+ "name": "hise-flow-graphs",
3
+ "version": "1.1.21",
4
+ "description": "This package manages ReactFlow graphs for HISE.",
5
+ "private": false,
6
+ "type": "module",
7
+ "main": "dist/index.umd.js",
8
+ "module": "dist/index.es.js",
9
+ "types": "dist/index.d.ts",
10
+ "scripts": {
11
+ "build": "vite build && tsc --project tsconfig.app.json",
12
+ "start": "vite build --mode development && chokidar 'src/**/*.{ts,tsx,js,jsx,css,scss}' -c 'vite build --mode development'",
13
+ "build:dev": "vite build --mode development",
14
+ "build:stage": "vite build --mode staging",
15
+ "build:prod": "vite build --mode production",
16
+ "lint": "eslint .",
17
+ "preview": "vite preview"
18
+ },
19
+ "dependencies": {
20
+ "@xyflow/react": "^12.8.4",
21
+ "bootstrap": "5.1.3",
22
+ "dagre": "^0.8.5",
23
+ "hise-components": "^2.0.0",
24
+ "ramda": "0.27.1",
25
+ "react-quill": "^2.0.0",
26
+ "react-toastify": "^9.1.3",
27
+ "reactflow": "^11.8.1"
28
+ },
29
+ "devDependencies": {
30
+ "@eslint/js": "^9.33.0",
31
+ "@types/dagre": "^0.7.49",
32
+ "@types/node": "^22.15.24",
33
+ "@types/ramda": "^0.29.3",
34
+ "@types/react": "^18.3.18",
35
+ "@types/react-dom": "^18.3.5",
36
+ "@vitejs/plugin-react": "^4.3.4",
37
+ "chokidar-cli": "^3.0.0",
38
+ "eslint": "^9.33.0",
39
+ "eslint-plugin-react": "^7.33.1",
40
+ "eslint-plugin-react-hooks": "^5.2.0",
41
+ "eslint-plugin-react-refresh": "^0.4.20",
42
+ "globals": "^16.3.0",
43
+ "typescript": "~5.8.3",
44
+ "typescript-eslint": "^8.39.1",
45
+ "vite": "^7.1.2",
46
+ "vite-tsconfig-paths": "^5.1.1"
47
+ },
48
+ "peerDependencies": {
49
+ "react": "^18.0.0",
50
+ "react-dom": "^18.0.0"
51
+ }
52
52
  }
@@ -173,6 +173,7 @@ export const getStyle = (type: string) => {
173
173
  style.borderColor = '#285222'; // dark green
174
174
  break;
175
175
 
176
+ case 'Certificate':
176
177
  case 'DirectUpload':
177
178
  style.borderColor = '#F78383'; // light red
178
179
  break;
@@ -260,10 +261,9 @@ export const getNodeLabel = (type: string, desc: any) => {
260
261
  case 'Cohort':
261
262
  case 'Pipeline':
262
263
  case 'Submission':
263
- return type;
264
-
264
+ case 'Certificate':
265
265
  default:
266
- return null;
266
+ return type;
267
267
  }
268
268
  };
269
269
 
@@ -298,6 +298,12 @@ export const getNodeDescription = (type: string, desc: any) => {
298
298
  </>
299
299
  )}
300
300
  <span className="font-italic">{desc['File Size']}</span>
301
+ <br />
302
+ {desc['File Availability'] && (
303
+ <span className="badge rounded-pill bg-secondary p-1 ps-2 fs-6 text-white">
304
+ {desc['File Availability']}
305
+ </span>
306
+ )}
301
307
  </>
302
308
  );
303
309
 
@@ -1,7 +1,7 @@
1
- import dagre from "dagre";
2
- import { Edge, Node, Position } from "reactflow";
3
- import { Certificate } from "../../../@types/CertificateTypes";
4
- import { getStyle } from "../CertificateGraph/helpers";
1
+ import dagre from 'dagre';
2
+ import { Edge, Node, Position } from 'reactflow';
3
+ import { Certificate } from '../../../@types/CertificateTypes';
4
+ import { getStyle } from '../CertificateGraph/helpers';
5
5
 
6
6
  export const nodeWidth = 250;
7
7
  export const nodeHeight = 120;
@@ -9,7 +9,7 @@ export const nodeHeight = 120;
9
9
  export const getWalkingNodesAndEdges = (
10
10
  nodes: Array<Node>,
11
11
  edges: Array<Edge>,
12
- direction = "LR"
12
+ direction = 'LR'
13
13
  ) => {
14
14
  const dagreGraph = new dagre.graphlib.Graph();
15
15
  dagreGraph.setDefaultEdgeLabel(() => ({}));
@@ -29,12 +29,14 @@ export const getWalkingNodesAndEdges = (
29
29
  nodes.forEach((node: Node) => {
30
30
  const nodeWithPosition = dagreGraph.node(node.id);
31
31
 
32
- node.targetPosition = direction === "LR" ? Position.Right : Position.Left;
33
- node.sourcePosition = direction === "LR" ? Position.Left : Position.Right;
32
+ node.targetPosition =
33
+ direction === 'LR' ? Position.Right : Position.Left;
34
+ node.sourcePosition =
35
+ direction === 'LR' ? Position.Left : Position.Right;
34
36
 
35
37
  node.position = {
36
- x: nodeWithPosition.x - nodeWidth / 2,
37
- y: nodeWithPosition.y - nodeHeight / 2,
38
+ x: nodeWithPosition.x - nodeWidth / 2,
39
+ y: nodeWithPosition.y - nodeHeight / 2
38
40
  };
39
41
 
40
42
  return node;
@@ -43,28 +45,37 @@ export const getWalkingNodesAndEdges = (
43
45
  return { nodes, edges };
44
46
  };
45
47
 
46
- export const getUpdatedNodes = (currentNodes: Array<Node>, newNodes: Certificate['vertices'], certificate: Certificate, isUpdate = true) => {
48
+ export const getUpdatedNodes = (
49
+ currentNodes: Array<Node>,
50
+ newNodes: Certificate['vertices'],
51
+ certificate: Certificate,
52
+ isUpdate = true
53
+ ) => {
47
54
  let updatedNodes = [...currentNodes];
48
55
 
49
56
  newNodes.forEach((nodeId: Node['id']) => {
50
- const isNodeAlreadyLoaded = currentNodes.find(n => n.id === nodeId);
51
- const isLayerInSubgraph = nodeId.includes('Layer') ? !Boolean(certificate.subgraphs[nodeId]) : false;
57
+ const isNodeAlreadyLoaded = currentNodes.find((n) => n.id === nodeId);
58
+ const isLayerInSubgraph = nodeId.includes('Layer')
59
+ ? !Boolean(certificate.subgraphs[nodeId])
60
+ : false;
52
61
 
53
62
  if (!isNodeAlreadyLoaded) {
54
- if ((isUpdate && isLayerInSubgraph)) {
63
+ if (isUpdate && isLayerInSubgraph) {
55
64
  updatedNodes = updatedNodes;
56
65
  } else {
57
66
  const [type] = nodeId.split('/');
58
- const description = certificate.customLabels?.[nodeId] || certificate.generatedLabels?.[nodeId];
67
+ const description =
68
+ certificate.customLabels?.[nodeId] ||
69
+ certificate.generatedLabels?.[nodeId];
59
70
 
60
71
  const newNode = {
61
72
  id: nodeId,
62
73
  position: { x: 0, y: 0 },
63
74
  type: 'walkingNode',
64
75
  data: {
65
- description,
76
+ description
66
77
  },
67
- style: getStyle(type),
78
+ style: getStyle(type)
68
79
  };
69
80
 
70
81
  updatedNodes = [...updatedNodes, newNode];
@@ -75,7 +86,10 @@ export const getUpdatedNodes = (currentNodes: Array<Node>, newNodes: Certificate
75
86
  return updatedNodes;
76
87
  };
77
88
 
78
- export const getUpdatedEdges = (currentEdges: Array<Edge>, newEdges: Certificate['edges']) => {
89
+ export const getUpdatedEdges = (
90
+ currentEdges: Array<Edge>,
91
+ newEdges: Certificate['edges']
92
+ ) => {
79
93
  let updatedEdges = [...currentEdges];
80
94
 
81
95
  const newEdgesEntries = Object.entries(newEdges || {});
@@ -84,19 +98,21 @@ export const getUpdatedEdges = (currentEdges: Array<Edge>, newEdges: Certificate
84
98
  const [source, targets] = entry;
85
99
 
86
100
  targets.map((target: Node['id']) => {
87
- const isEdgeAlreadyLoaded = currentEdges.find(e => e.id.match(source) && e.id.match(target));
88
-
101
+ const isEdgeAlreadyLoaded = currentEdges.find(
102
+ (e) => e.id.match(source) && e.id.match(target)
103
+ );
104
+
89
105
  if (!isEdgeAlreadyLoaded) {
90
106
  const newEdge = {
91
107
  id: `${source}-${target}`,
92
108
  source,
93
109
  target,
94
- animated: true,
110
+ animated: true
95
111
  };
96
112
 
97
113
  updatedEdges = [...updatedEdges, newEdge];
98
114
  }
99
- })
115
+ });
100
116
  });
101
117
 
102
118
  return updatedEdges;
@@ -138,7 +154,6 @@ export const getLink = (id: Node['id']) => {
138
154
  case 'Cohort':
139
155
  return `/#/cohorts/${guid}`;
140
156
 
141
-
142
157
  // case 'Trace':
143
158
  // case 'Specimen':
144
159
  // case 'DirectUpload':