Open create Concept modal

Concept Admin will export a portal in order for other plugins to render it. This will allow the requester to get hold on the create concept scheme and be able to utilise the functionality from Concept Admin in their own plugin to create a concept.

Start of by registering the portal as a requirement in your plugin.

https://docs.infomaker.io/dashboard-plugin/api-and-gui/api/register/requirements#portals

When the plugin has registered a dependency to the Concept Admin portal a mapping needs to be made in order to fully utilise it in your plugin.

https://docs.infomaker.io/dashboard-plugin/mappings

When all that is done we now have a link setup in within your plugin. This will allow you to easy retrieve the function that will render the portal from Concept Admin.

import { Plugin } from '@root'
import { useRef } from 'react'

const MyComponent = () => {
    const createConceptRef = useRef(Plugin.getPortal('my-required-portal-id'))
    
    const onCloseHandler = () => {}
    const onErroHandler = () => {}
    const onDoneHandler = (uuid, concept) => {}
    
    const CreateConcept = createConceptRef.current
    return (
        <CreateConcept 
            conceptType={'author'}
            onClose={onCloseHandler}
            onError={onErrorHandler}
            onDone={onDoneHandler}
        />
    )
}

Property

conceptType

string (any of the configured types)

onClose

function when portal is closed

onError

function when something uncalled for happens

onDone

function when everything is done, gives back uuid and the concept

Last updated