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) => {};
|
||||
update = (_coreThreeRepository: CoreThreeRepository) => {};
|
||||
}
|
||||
|
||||
export class SceneAsset {
|
||||
name: string;
|
||||
@IsArray()
|
||||
|
|
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
|
@ -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,
|
||||
}}
|
||||
>
|
||||
<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
|
||||
? props.items.map((el, i) => (
|
||||
<div
|
||||
|
|
|
@ -35,6 +35,8 @@ export const SkillsScreen = observer(() => {
|
|||
}}
|
||||
>
|
||||
<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} />
|
||||
<div>
|
||||
<CoreText text={"Topics"} type={CoreTextType.header} />
|
||||
|
@ -98,6 +100,10 @@ export const SkillsScreen = observer(() => {
|
|||
label={"Module name"}
|
||||
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
|
||||
text={`Topics ${store.viewModel.topicsOut.length}`}
|
||||
type={CoreTextType.large}
|
||||
|
@ -151,6 +157,7 @@ export const SkillsScreen = observer(() => {
|
|||
store.updateForm({ BTAction: store.viewModel.BTAction.replacePropIndex({ format: text }, index) })
|
||||
}
|
||||
/>
|
||||
|
||||
<CoreSelect
|
||||
items={Object.keys(BtAction)}
|
||||
value={el.typeAction}
|
||||
|
@ -161,6 +168,7 @@ export const SkillsScreen = observer(() => {
|
|||
})
|
||||
}
|
||||
/>
|
||||
|
||||
<CoreText
|
||||
text={`Param ${el.param.length}`}
|
||||
type={CoreTextType.large}
|
||||
|
|
|
@ -26,7 +26,6 @@ export class SkillsStore extends UiDrawerFormState<SkillModel, HttpError> {
|
|||
}
|
||||
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<SkillModel, HttpError> {
|
|||
}
|
||||
saveNewSkill = async () => {
|
||||
(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)
|
||||
);
|
||||
};
|
||||
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