From d8df2b07c9b91704d407e3d5981febbaa5015a7a Mon Sep 17 00:00:00 2001 From: Joakim Uddholm Date: Tue, 2 Jul 2024 17:06:58 +0200 Subject: [PATCH] chore: update component types in core (these are mostly unused... for now) --- core/src/data/models/Model.ts | 5 +++-- core/src/data/models/ModelDataService.ts | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/src/data/models/Model.ts b/core/src/data/models/Model.ts index fa6f4643..0c7f1564 100644 --- a/core/src/data/models/Model.ts +++ b/core/src/data/models/Model.ts @@ -8,7 +8,7 @@ export interface DataFlow { bidirectional: boolean; } -type ComponentType = "ee" | "ds" | "proc"; +type ComponentType = "ee" | "ds" | "proc" | "tb"; // type AuthenticationType = // | "json-web-token" @@ -104,10 +104,11 @@ export interface Component { x: number; y: number; type: ComponentType; + width?: number; + height?: number; name: string; classes?: ComponentClass[]; description?: string; - // attributes?: Attributes; } export interface ModelData { diff --git a/core/src/data/models/ModelDataService.ts b/core/src/data/models/ModelDataService.ts index ac9c5f2d..290a021e 100644 --- a/core/src/data/models/ModelDataService.ts +++ b/core/src/data/models/ModelDataService.ts @@ -385,11 +385,11 @@ export class ModelDataService extends EventEmitter implements SearchProvider { /** * Update the model object of specified id - * @param {string} id - Model id to update - * @param {any} model - Model object to save - * @returns {boolean} - true if an update was performed */ - async update(id: string, model: { version: string; data: ModelData }) { + async update( + id: string, + model: { version: string; data: ModelData } + ): Promise { const previousModel = await this.getById(id); if (!previousModel) { this.log.warn(`Attempted to update non-existent model: ${id}`);