fixed bugs
This commit is contained in:
parent
193e884e40
commit
c0a23c31f7
6 changed files with 20 additions and 33 deletions
|
@ -21,7 +21,6 @@ export abstract class Instance {
|
||||||
toWebGl = (_coreThreeRepository: CoreThreeRepository) => {};
|
toWebGl = (_coreThreeRepository: CoreThreeRepository) => {};
|
||||||
update = (_coreThreeRepository: CoreThreeRepository) => {};
|
update = (_coreThreeRepository: CoreThreeRepository) => {};
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SceneAsset {
|
export class SceneAsset {
|
||||||
name: string;
|
name: string;
|
||||||
@IsArray()
|
@IsArray()
|
||||||
|
|
|
@ -1,23 +1,13 @@
|
||||||
import {
|
import { IsArray, IsEnum, IsNotEmpty, IsOptional, IsString, ValidateNested } from "class-validator";
|
||||||
IsArray,
|
|
||||||
IsEnum,
|
|
||||||
IsNotEmpty,
|
|
||||||
IsObject,
|
|
||||||
IsOptional,
|
|
||||||
IsString,
|
|
||||||
ValidateNested,
|
|
||||||
isMongoId,
|
|
||||||
} from "class-validator";
|
|
||||||
import { Type } from "class-transformer";
|
import { Type } from "class-transformer";
|
||||||
import { ISkillView } from "../../features/behavior_tree_builder/presentation/ui/skill_tree/skill_tree";
|
import { ISkillView } from "../../features/behavior_tree_builder/presentation/ui/skill_tree/skill_tree";
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
import { Result } from "../helper/result";
|
import { Result } from "../helper/result";
|
||||||
import { ValidationModel } from "./validation_model";
|
import { ValidationModel } from "./validation_model";
|
||||||
import { ITopicModel, TopicViewModel } from "../../features/topics/topic_view_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 makeAutoObservable from "mobx-store-inheritance";
|
||||||
import clone from "just-clone";
|
import clone from "just-clone";
|
||||||
import { BehaviorTreeBuilderStore } from "../../features/behavior_tree_builder/presentation/behavior_tree_builder_store";
|
|
||||||
|
|
||||||
export interface IDependency {
|
export interface IDependency {
|
||||||
skills: ISkillDependency[];
|
skills: ISkillDependency[];
|
||||||
}
|
}
|
||||||
|
@ -68,7 +58,6 @@ export class ParamViewModel implements IParam {
|
||||||
}
|
}
|
||||||
export interface IBTAction {
|
export interface IBTAction {
|
||||||
name: string;
|
name: string;
|
||||||
format: string;
|
|
||||||
type: string;
|
type: string;
|
||||||
param: IParam[];
|
param: IParam[];
|
||||||
result: string[];
|
result: string[];
|
||||||
|
@ -123,6 +112,7 @@ export interface ILaunch {
|
||||||
|
|
||||||
export interface IModule {
|
export interface IModule {
|
||||||
name: string;
|
name: string;
|
||||||
|
node_name: string;
|
||||||
description: string;
|
description: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,6 +149,8 @@ export class SkillPackage implements ISkillPackage {
|
||||||
static empty = () => new SkillPackage("", "", "");
|
static empty = () => new SkillPackage("", "", "");
|
||||||
}
|
}
|
||||||
export class Module implements IModule {
|
export class Module implements IModule {
|
||||||
|
@IsString()
|
||||||
|
node_name: string;
|
||||||
@IsString()
|
@IsString()
|
||||||
name: string;
|
name: string;
|
||||||
@IsString()
|
@IsString()
|
||||||
|
@ -172,8 +164,8 @@ export class Module implements IModule {
|
||||||
export class BTAction implements IBTAction {
|
export class BTAction implements IBTAction {
|
||||||
@IsString()
|
@IsString()
|
||||||
name: string;
|
name: string;
|
||||||
@IsString()
|
// @IsString()
|
||||||
format: string;
|
// format: string;
|
||||||
@IsString()
|
@IsString()
|
||||||
type: string;
|
type: string;
|
||||||
sid?: string;
|
sid?: string;
|
||||||
|
@ -377,7 +369,6 @@ export class Skills {
|
||||||
getSkillDo = (name: string) =>
|
getSkillDo = (name: string) =>
|
||||||
this.skills.reduce((acc, el) => {
|
this.skills.reduce((acc, el) => {
|
||||||
if (el.BTAction.find((el) => el.name.isEqual(name))) {
|
if (el.BTAction.find((el) => el.name.isEqual(name))) {
|
||||||
|
|
||||||
acc = el.Module.name;
|
acc = el.Module.name;
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
|
@ -486,3 +477,4 @@ export class Skills {
|
||||||
() => Result.error(false)
|
() => Result.error(false)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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",
|
|
||||||
}
|
|
|
@ -45,7 +45,7 @@ export const CoreSelect = (props: ICoreSelectProps) => {
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ position: "absolute", width: width, backgroundColor: "rgba(230, 224, 233, 1)" }}>
|
<div style={{ position: "relative", width: width, backgroundColor: "rgba(230, 224, 233, 1)" }}>
|
||||||
{cursorIsCorses
|
{cursorIsCorses
|
||||||
? props.items.map((el, i) => (
|
? props.items.map((el, i) => (
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -35,6 +35,8 @@ export const SkillsScreen = observer(() => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CoreText text="Delete" type={CoreTextType.header} onClick={() => store.deleteSkill(el._id as string)} />
|
<CoreText text="Delete" type={CoreTextType.header} onClick={() => store.deleteSkill(el._id as string)} />
|
||||||
|
<CoreText text="Copy" type={CoreTextType.header} onClick={() => store.copySkill(el)} />
|
||||||
|
|
||||||
<CoreText text={`skill server name:${el.SkillPackage.name}`} type={CoreTextType.header} />
|
<CoreText text={`skill server name:${el.SkillPackage.name}`} type={CoreTextType.header} />
|
||||||
<div>
|
<div>
|
||||||
<CoreText text={"Topics"} type={CoreTextType.header} />
|
<CoreText text={"Topics"} type={CoreTextType.header} />
|
||||||
|
@ -98,6 +100,10 @@ export const SkillsScreen = observer(() => {
|
||||||
label={"Module name"}
|
label={"Module name"}
|
||||||
onChange={(text) => store.updateForm({ Module: Object.assign(store.viewModel.Module, { name: text }) })}
|
onChange={(text) => store.updateForm({ Module: Object.assign(store.viewModel.Module, { name: text }) })}
|
||||||
/>
|
/>
|
||||||
|
<CoreInput
|
||||||
|
label="Module node name"
|
||||||
|
onChange={(text) => store.updateForm({ Module: Object.assign(store.viewModel.Module, { node_name: text }) })}
|
||||||
|
/>
|
||||||
<CoreText
|
<CoreText
|
||||||
text={`Topics ${store.viewModel.topicsOut.length}`}
|
text={`Topics ${store.viewModel.topicsOut.length}`}
|
||||||
type={CoreTextType.large}
|
type={CoreTextType.large}
|
||||||
|
@ -151,6 +157,7 @@ export const SkillsScreen = observer(() => {
|
||||||
store.updateForm({ BTAction: store.viewModel.BTAction.replacePropIndex({ format: text }, index) })
|
store.updateForm({ BTAction: store.viewModel.BTAction.replacePropIndex({ format: text }, index) })
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<CoreSelect
|
<CoreSelect
|
||||||
items={Object.keys(BtAction)}
|
items={Object.keys(BtAction)}
|
||||||
value={el.typeAction}
|
value={el.typeAction}
|
||||||
|
@ -161,6 +168,7 @@ export const SkillsScreen = observer(() => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<CoreText
|
<CoreText
|
||||||
text={`Param ${el.param.length}`}
|
text={`Param ${el.param.length}`}
|
||||||
type={CoreTextType.large}
|
type={CoreTextType.large}
|
||||||
|
|
|
@ -26,7 +26,6 @@ export class SkillsStore extends UiDrawerFormState<SkillModel, HttpError> {
|
||||||
}
|
}
|
||||||
init = async (navigate?: NavigateFunction | undefined) => {
|
init = async (navigate?: NavigateFunction | undefined) => {
|
||||||
this.mapOk("skills", this.skillsHttpRepository.getAllSkills());
|
this.mapOk("skills", this.skillsHttpRepository.getAllSkills());
|
||||||
|
|
||||||
};
|
};
|
||||||
deleteSkill = async (id: string) => (await this.skillsHttpRepository.deleteSkill(id), this.init());
|
deleteSkill = async (id: string) => (await this.skillsHttpRepository.deleteSkill(id), this.init());
|
||||||
modalShow = () => {
|
modalShow = () => {
|
||||||
|
@ -73,8 +72,9 @@ export class SkillsStore extends UiDrawerFormState<SkillModel, HttpError> {
|
||||||
}
|
}
|
||||||
saveNewSkill = async () => {
|
saveNewSkill = async () => {
|
||||||
(await this.viewModel.valid<SkillModel>()).fold(
|
(await this.viewModel.valid<SkillModel>()).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)
|
async (e) => message.error(e)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
copySkill = (skillModel: SkillModel) => window.prompt("Copy to clipboard: Ctrl+C, Enter", JSON.stringify(skillModel));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue