Skip to content

Commit

Permalink
fix: revert randomuuid change (#1866)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwdchang authored Sep 15, 2023
1 parent a095e47 commit 25f5beb
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
1 change: 1 addition & 0 deletions packages/client/hmi-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"primevue": "3.25.0",
"pyodide": "0.23.4",
"sass": "1.56.1",
"uuid": "^9.0.1",
"vue": "3.3.4",
"vue-feather": "2.0.0",
"vue-gtag": "2.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/client/hmi-client/src/services/jupyter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import * as messages from '@jupyterlab/services/lib/kernel/messages';
import * as kernel from '@jupyterlab/services/lib/kernel/kernel';
import { KernelConnection as JupyterKernelConnection } from '@jupyterlab/services/lib/kernel';
import API from '@/api/api';
import crypto from 'crypto';
import { v4 as uuidv4 } from 'uuid';

declare module '@jupyterlab/services/lib/kernel/messages' {
export function createMessage(options: JSONObject): JupyterMessage;
Expand Down Expand Up @@ -145,7 +145,7 @@ let initialized = false;

export const createMessageId = (msgType) => {
// const timestamp = Date
const uuid = crypto.randomUUID().replaceAll('-', '').slice(0, 16);
const uuid = uuidv4().replaceAll('-', '').slice(0, 16);
return `tgpt-${uuid}-${msgType}`;
};

Expand Down
12 changes: 6 additions & 6 deletions packages/client/hmi-client/src/services/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
WorkflowPortStatus,
WorkflowStatus
} from '@/types/workflow';
import crypto from 'crypto';
import { v4 as uuidv4 } from 'uuid';

/**
* Captures common actions performed on workflow nodes/edges. The functions here are
Expand All @@ -23,7 +23,7 @@ import crypto from 'crypto';

export const emptyWorkflow = (name: string = 'test', description: string = '') => {
const workflow: Workflow = {
id: crypto.randomUUID(),
id: uuidv4(),
name,
description,

Expand All @@ -42,7 +42,7 @@ export const addNode = (
options: { size?: Size; state?: any } = { size: defaultNodeSize, state: {} }
) => {
const node: WorkflowNode = {
id: crypto.randomUUID(),
id: uuidv4(),
workflowId: wf.id,
operationType: op.name,
displayName: op.displayName,
Expand All @@ -51,7 +51,7 @@ export const addNode = (
state: options.state,

inputs: op.inputs.map((port) => ({
id: crypto.randomUUID(),
id: uuidv4(),
type: port.type,
label: port.label,
status: WorkflowPortStatus.NOT_CONNECTED,
Expand All @@ -61,7 +61,7 @@ export const addNode = (
outputs: [],
/*
outputs: op.outputs.map((port) => ({
id: crypto.randomUUID(),
id: uuidv4(),
type: port.type,
label: port.label,
status: WorkflowPortStatus.NOT_CONNECTED,
Expand Down Expand Up @@ -127,7 +127,7 @@ export const addEdge = (
}

const edge: WorkflowEdge = {
id: crypto.randomUUID(),
id: uuidv4(),
workflowId: wf.id,
source: sourceId,
sourcePortId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { workflowEventBus } from '@/services/workflow';
import { createNotebookSession, getNotebookSessionById } from '@/services/notebook-session';
import { NotebookSession } from '@/types/Types';
import { cloneDeep } from 'lodash';
import crypto from 'crypto';
import { v4 as uuidv4 } from 'uuid';
const props = defineProps<{
node: WorkflowNode;
Expand All @@ -46,7 +46,7 @@ onMounted(async () => {
if (!notebookSessionId) {
// create a new notebook session log if it does not exist
const response = await createNotebookSession({
id: crypto.randomUUID(),
id: uuidv4(),
name: props.node.id,
description: '',
data: { history: [] },
Expand Down
10 changes: 5 additions & 5 deletions packages/client/hmi-client/src/workflow/tera-workflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ import * as d3 from 'd3';
import { IProject } from '@/types/Project';
import { AssetType, Dataset, Model } from '@/types/Types';
import { useDragEvent } from '@/services/drag-drop';
import { v4 as uuidv4 } from 'uuid';
import crypto from 'crypto';
import { ModelOperation, TeraModelNode } from './ops/model/mod';
import { SimulateCiemssOperation, TeraSimulateNodeCiemss } from './ops/simulate-ciemss/mod';
import { StratifyOperation, TeraStratifyNodeJulia } from './ops/stratify-julia/mod';
Expand Down Expand Up @@ -372,7 +372,7 @@ const refreshModelNode = async (node: WorkflowNode) => {
}
node.outputs.push({
id: crypto.randomUUID(),
id: uuidv4(),
type: 'modelConfigId',
label: configuration.name,
value: [configuration.id],
Expand Down Expand Up @@ -401,7 +401,7 @@ async function selectDataset(node: WorkflowNode, data: { id: string; name: strin
node.state.datasetId = data.id;
node.outputs = [
{
id: crypto.randomUUID(),
id: uuidv4(),
type: 'datasetId',
label: data.name,
value: [data.id],
Expand All @@ -412,7 +412,7 @@ async function selectDataset(node: WorkflowNode, data: { id: string; name: strin
}
function appendInputPort(node: WorkflowNode, port: { type: string; label?: string; value: any }) {
node.inputs.push({
id: crypto.randomUUID(),
id: uuidv4(),
type: port.type,
label: port.label,
status: WorkflowPortStatus.NOT_CONNECTED
Expand All @@ -421,7 +421,7 @@ function appendInputPort(node: WorkflowNode, port: { type: string; label?: strin
function appendOutputPort(node: WorkflowNode, port: { type: string; label?: string; value: any }) {
node.outputs.push({
id: crypto.randomUUID(),
id: uuidv4(),
type: port.type,
label: port.label,
value: isArray(port.value) ? port.value : [port.value],
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8841,6 +8841,7 @@ cors@latest:
pyodide: 0.23.4
sass: 1.56.1
typescript: 5.0.4
uuid: ^9.0.1
vite: 4.3.9
vite-svg-loader: 4.0.0
vitest: 0.24.5
Expand Down Expand Up @@ -14419,6 +14420,15 @@ send@latest:
languageName: node
linkType: hard

"uuid@npm:^9.0.1":
version: 9.0.1
resolution: "uuid@npm:9.0.1"
bin:
uuid: dist/bin/uuid
checksum: 39931f6da74e307f51c0fb463dc2462807531dc80760a9bff1e35af4316131b4fc3203d16da60ae33f07fdca5b56f3f1dd662da0c99fea9aaeab2004780cc5f4
languageName: node
linkType: hard

"v8-compile-cache@npm:^2.0.3":
version: 2.3.0
resolution: "v8-compile-cache@npm:2.3.0"
Expand Down

0 comments on commit 25f5beb

Please sign in to comment.