Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

november cleanup #5601

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<template>
<div class="response-thought-container">
<div ref="responseThought" class="thought" :class="{ hide: !props.showThought, show: props.showThought }">
<div class="thought" :class="{ hide: !props.showThought, show: props.showThought }">
<slot />
<Button text rounded icon="pi pi-times" @click="onClickClose" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, defineProps, defineEmits } from 'vue';
import { defineProps, defineEmits } from 'vue';
import Button from 'primevue/button';

const responseThought = ref(<HTMLElement | null>null);

const props = defineProps<{
showThought?: boolean;
}>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!-- add 'debug-mode' to debug this -->
<tera-infinite-canvas
v-if="!isWorkflowLoading"
ref="canvasRef"
@click="onCanvasClick()"
@contextmenu="toggleContextMenu"
@save-transform="saveTransform"
Expand Down Expand Up @@ -224,7 +225,6 @@ import * as CalibrateCiemssOp from '@/components/workflow/ops/calibrate-ciemss/m
import * as CalibrateEnsembleCiemssOp from '@/components/workflow/ops/calibrate-ensemble-ciemss/mod';
import * as DatasetTransformerOp from '@/components/workflow/ops/dataset-transformer/mod';
import * as SubsetDataOp from '@/components/workflow/ops/subset-data/mod';
import * as CodeAssetOp from '@/components/workflow/ops/code-asset/mod';
import * as OptimizeCiemssOp from '@/components/workflow/ops/optimize-ciemss/mod';
import * as DocumentOp from '@/components/workflow/ops/document/mod';
import * as ModelFromDocumentOp from '@/components/workflow/ops/model-from-equations/mod';
Expand All @@ -250,7 +250,6 @@ registry.registerOp(CalibrateEnsembleCiemssOp);
registry.registerOp(ModelConfigOp);
registry.registerOp(CalibrateCiemssOp);
registry.registerOp(DatasetTransformerOp);
registry.registerOp(CodeAssetOp);
mwdchang marked this conversation as resolved.
Show resolved Hide resolved
registry.registerOp(SubsetDataOp);
registry.registerOp(OptimizeCiemssOp);
registry.registerOp(DocumentOp);
Expand Down Expand Up @@ -312,6 +311,7 @@ const toggleOptionsMenu = (event: MouseEvent) => {
optionsMenu.value.toggle(event);
};
const teraOperatorRefs = ref();
const canvasRef = ref();

async function updateWorkflowName() {
const workflowClone = cloneDeep(wf.value.dump());
Expand Down Expand Up @@ -630,6 +630,13 @@ const showAddComponentMenu = () => {
const el = document.querySelector('#add-component-btn');
const coords = el?.getBoundingClientRect();

// Places new operators roughly in the centre
if (canvasRef.value) {
const box = (canvasRef.value.$el as HTMLDivElement).getBoundingClientRect();
newNodePosition.x = (Math.random() * 50 + 0.5 * box.width - canvasTransform.x) / canvasTransform.k;
newNodePosition.y = (Math.random() * 50 + 0.5 * box.height - canvasTransform.y) / canvasTransform.k;
}

if (coords) {
const event = new PointerEvent('click', {
clientX: coords.x + coords.width,
Expand Down Expand Up @@ -662,10 +669,6 @@ function onDrop(event: DragEvent) {
operation = DatasetOp.operation;
state = { datasetId: assetId };
break;
case AssetType.Code:
operation = CodeAssetOp.operation;
state = { codeAssetId: assetId };
break;
case AssetType.Document:
operation = DocumentOp.operation;
state = { documentId: assetId };
Expand Down
170 changes: 0 additions & 170 deletions packages/client/hmi-client/src/utils/pivot.ts

This file was deleted.

61 changes: 0 additions & 61 deletions packages/client/hmi-client/tests/unit/utils/pivot.spec.ts

This file was deleted.