Renames
This commit is contained in:
parent
2dc3a693a8
commit
4ea8b60b3b
|
@ -452,7 +452,7 @@ export class ComponentStore extends BudiStore<ComponentState> {
|
|||
* @returns
|
||||
*/
|
||||
createInstance(
|
||||
componentName: string,
|
||||
componentType: string,
|
||||
presetProps: any,
|
||||
parent: any
|
||||
): Component | null {
|
||||
|
@ -461,11 +461,13 @@ export class ComponentStore extends BudiStore<ComponentState> {
|
|||
throw "A valid screen must be selected"
|
||||
}
|
||||
|
||||
const definition = this.getDefinition(componentName)
|
||||
const definition = this.getDefinition(componentType)
|
||||
if (!definition) {
|
||||
return null
|
||||
}
|
||||
|
||||
let componentName = `New ${definition.friendlyName || definition.name}`
|
||||
|
||||
// Generate basic component structure
|
||||
let instance: Component = {
|
||||
_id: Helpers.uuid(),
|
||||
|
@ -475,7 +477,7 @@ export class ComponentStore extends BudiStore<ComponentState> {
|
|||
hover: {},
|
||||
active: {},
|
||||
},
|
||||
_instanceName: `New ${definition.friendlyName || definition.name}`,
|
||||
_instanceName: componentName,
|
||||
...presetProps,
|
||||
}
|
||||
|
||||
|
@ -500,7 +502,7 @@ export class ComponentStore extends BudiStore<ComponentState> {
|
|||
}
|
||||
|
||||
// Add step name to form steps
|
||||
if (componentName.endsWith("/formstep")) {
|
||||
if (componentType.endsWith("/formstep")) {
|
||||
const parentForm = findClosestMatchingComponent(
|
||||
screen.props,
|
||||
get(selectedComponent)?._id,
|
||||
|
@ -529,14 +531,14 @@ export class ComponentStore extends BudiStore<ComponentState> {
|
|||
* @returns
|
||||
*/
|
||||
async create(
|
||||
componentName: string,
|
||||
componentType: string,
|
||||
presetProps: any,
|
||||
parent: Component,
|
||||
index: number
|
||||
) {
|
||||
const state = get(this.store)
|
||||
const componentInstance = this.createInstance(
|
||||
componentName,
|
||||
componentType,
|
||||
presetProps,
|
||||
parent
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue