mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-04-12 21:50:23 +08:00
chore: change properties
to exampleProperties
This commit is contained in:
parent
8e455ce184
commit
8d22b4d8b5
@ -42,7 +42,7 @@ export const ExplorerForm: React.FC<Props> = observer(
|
||||
name,
|
||||
version,
|
||||
stateMap: moduleSpec?.spec.stateMap || {},
|
||||
properties: moduleSpec?.spec.properties || {},
|
||||
exampleProperties: moduleSpec?.spec.exampleProperties || {},
|
||||
};
|
||||
form = (
|
||||
<ModuleMetaDataForm
|
||||
|
@ -9,7 +9,7 @@ export type ModuleMetaDataFormData = {
|
||||
name: string;
|
||||
version: string;
|
||||
stateMap: Record<string, string>;
|
||||
properties: Record<string, any>;
|
||||
exampleProperties: Record<string, any>;
|
||||
};
|
||||
|
||||
type ModuleMetaDataFormProps = {
|
||||
@ -67,9 +67,9 @@ export const ModuleMetaDataForm: React.FC<ModuleMetaDataFormProps> = observer(
|
||||
<FormLabel>Module Mock Properties</FormLabel>
|
||||
<RecordEditor
|
||||
services={services}
|
||||
value={formik.values.properties}
|
||||
value={formik.values.exampleProperties}
|
||||
onChange={json => {
|
||||
formik.setFieldValue('properties', json);
|
||||
formik.setFieldValue('exampleProperties', json);
|
||||
formik.submitForm();
|
||||
}}
|
||||
/>
|
||||
|
@ -35,6 +35,7 @@ export const DefaultNewModule: ImplementedRuntimeModule = {
|
||||
stateMap: {},
|
||||
events: [],
|
||||
properties: {},
|
||||
exampleProperties: {},
|
||||
},
|
||||
impl: [
|
||||
{
|
||||
|
@ -113,12 +113,12 @@ export class AppStorage {
|
||||
version,
|
||||
name,
|
||||
stateMap,
|
||||
properties,
|
||||
exampleProperties,
|
||||
}: {
|
||||
version: string;
|
||||
name: string;
|
||||
stateMap: Record<string, string>;
|
||||
properties: Record<string, string>;
|
||||
exampleProperties: Record<string, string>;
|
||||
}
|
||||
) {
|
||||
const i = this.modules.findIndex(
|
||||
@ -127,7 +127,7 @@ export class AppStorage {
|
||||
const newModules = produce(toJS(this.modules), draft => {
|
||||
draft[i].metadata.name = name;
|
||||
draft[i].spec.stateMap = stateMap;
|
||||
draft[i].spec.properties = properties;
|
||||
draft[i].spec.exampleProperties = exampleProperties;
|
||||
draft[i].version = version;
|
||||
});
|
||||
|
||||
|
@ -21,7 +21,7 @@ type EditingTarget = {
|
||||
version: string;
|
||||
name: string;
|
||||
spec?: {
|
||||
properties?: Record<string, any>;
|
||||
exampleProperties?: Record<string, any>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -94,7 +94,7 @@ export class EditorStore {
|
||||
this.setComponents(this.originComponents);
|
||||
this.setSelectedComponentId(this.originComponents[0]?.id || '');
|
||||
const evaledDependencies = stateManager.deepEval(
|
||||
target.spec?.properties || {},
|
||||
target.spec?.exampleProperties || {},
|
||||
{ fallbackWhenError: () => undefined }
|
||||
);
|
||||
this.stateManager.setDependencies({
|
||||
|
Loading…
x
Reference in New Issue
Block a user