diff --git a/ui/src/core/model/scene_asset.ts b/ui/src/core/model/scene_asset.ts index bd14192..cecbee0 100644 --- a/ui/src/core/model/scene_asset.ts +++ b/ui/src/core/model/scene_asset.ts @@ -21,7 +21,6 @@ export abstract class Instance { toWebGl = (_coreThreeRepository: CoreThreeRepository) => {}; update = (_coreThreeRepository: CoreThreeRepository) => {}; } - export class SceneAsset { name: string; @IsArray() diff --git a/ui/src/core/model/skill_model.ts b/ui/src/core/model/skill_model.ts index 31587b6..a4bd75d 100644 --- a/ui/src/core/model/skill_model.ts +++ b/ui/src/core/model/skill_model.ts @@ -1,23 +1,13 @@ -import { - IsArray, - IsEnum, - IsNotEmpty, - IsObject, - IsOptional, - IsString, - ValidateNested, - isMongoId, -} from "class-validator"; +import { IsArray, IsEnum, IsNotEmpty, IsOptional, IsString, ValidateNested } from "class-validator"; import { Type } from "class-transformer"; import { ISkillView } from "../../features/behavior_tree_builder/presentation/ui/skill_tree/skill_tree"; import { v4 } from "uuid"; import { Result } from "../helper/result"; import { ValidationModel } from "./validation_model"; import { ITopicModel, TopicViewModel } from "../../features/topics/topic_view_model"; +import { BehaviorTreeBuilderStore } from "../../features/behavior_tree_builder/presentation/behavior_tree_builder_store"; import makeAutoObservable from "mobx-store-inheritance"; import clone from "just-clone"; -import { BehaviorTreeBuilderStore } from "../../features/behavior_tree_builder/presentation/behavior_tree_builder_store"; - export interface IDependency { skills: ISkillDependency[]; } @@ -68,7 +58,6 @@ export class ParamViewModel implements IParam { } export interface IBTAction { name: string; - format: string; type: string; param: IParam[]; result: string[]; @@ -123,6 +112,7 @@ export interface ILaunch { export interface IModule { name: string; + node_name: string; description: string; } @@ -159,6 +149,8 @@ export class SkillPackage implements ISkillPackage { static empty = () => new SkillPackage("", "", ""); } export class Module implements IModule { + @IsString() + node_name: string; @IsString() name: string; @IsString() @@ -172,8 +164,8 @@ export class Module implements IModule { export class BTAction implements IBTAction { @IsString() name: string; - @IsString() - format: string; + // @IsString() + // format: string; @IsString() type: string; sid?: string; @@ -377,9 +369,8 @@ export class Skills { getSkillDo = (name: string) => this.skills.reduce((acc, el) => { if (el.BTAction.find((el) => el.name.isEqual(name))) { - acc = el.Module.name; - } + } return acc; }, "error"); @@ -486,3 +477,4 @@ export class Skills { () => Result.error(false) ); } + \ No newline at end of file diff --git a/ui/src/core/model/trigger_model.ts b/ui/src/core/model/trigger_model.ts deleted file mode 100644 index 277bf7e..0000000 --- a/ui/src/core/model/trigger_model.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { DatabaseModelId } from "./database_model"; - -export interface ITriggerModel extends DatabaseModelId { - type: string; - description: string; - value: string[]; -} - -export enum TriggerType { - PROCESS = "PROCESS", - FILE = "FILE", -} diff --git a/ui/src/core/ui/select/select.tsx b/ui/src/core/ui/select/select.tsx index 8fb9abe..017c16f 100644 --- a/ui/src/core/ui/select/select.tsx +++ b/ui/src/core/ui/select/select.tsx @@ -45,7 +45,7 @@ export const CoreSelect = (props: ICoreSelectProps) => { borderRadius: 4, }} > -
+
{cursorIsCorses ? props.items.map((el, i) => (
{ }} > store.deleteSkill(el._id as string)} /> + store.copySkill(el)} /> +
@@ -98,6 +100,10 @@ export const SkillsScreen = observer(() => { label={"Module name"} onChange={(text) => store.updateForm({ Module: Object.assign(store.viewModel.Module, { name: text }) })} /> + store.updateForm({ Module: Object.assign(store.viewModel.Module, { node_name: text }) })} + /> { store.updateForm({ BTAction: store.viewModel.BTAction.replacePropIndex({ format: text }, index) }) } /> + { }) } /> + { } init = async (navigate?: NavigateFunction | undefined) => { this.mapOk("skills", this.skillsHttpRepository.getAllSkills()); - }; deleteSkill = async (id: string) => (await this.skillsHttpRepository.deleteSkill(id), this.init()); modalShow = () => { @@ -73,8 +72,9 @@ export class SkillsStore extends UiDrawerFormState { } saveNewSkill = async () => { (await this.viewModel.valid()).fold( - async (model) => (this.skillsHttpRepository.createNewSkill(model), this.handleCancel(), this.init()), + async (model) => (await this.skillsHttpRepository.createNewSkill(model), this.handleCancel(), await this.init()), async (e) => message.error(e) ); }; + copySkill = (skillModel: SkillModel) => window.prompt("Copy to clipboard: Ctrl+C, Enter", JSON.stringify(skillModel)); }