Search
    Preparing search index...

    Точка расширения отвечает за режим просмотра атрибута в карточке записи

    Точка расширения логически связана с другой точкой расширения - Platform.Record.UERenderAttributeOnDataCard Создаваемые данной точкой расширения режимы просмотра должны быть перечислены в поле Platform.Record.UERenderAttributeOnDataCard.meta.previewOptions

    import {Universe} from '@universe-ee/sdk';

    const {React} = Universe.Vendor;
    const {Uikit, Router} = Universe.Platform;

    interface Props {
    attributeStore: Universe.Platform.Record.SimpleAttributeStore | Universe.Platform.Record.ArrayAttributeStore;
    dataEntityStore: Universe.Platform.Record.AbstractRecordEntityStore;
    metaEntityStore: Universe.Platform.Meta.UPathMetaStore<Universe.Platform.Meta.IMetaModel>;
    }

    export class CustomAttributePreview extends React.Component<Props> {
    onClick = () => {
    Router.routerStore.setRoute('EnumerationPage');

    console.log('UE_BTN_WORK!!!')
    };

    render() {
    return (
    <span>
    <Uikit.Button intent={Uikit.INTENT.DANGER} onClick={this.onClick}>
    Go to enumerations!
    </Uikit.Button>
    </span>
    );
    }
    }

    Подключение точки расширения:

    import {Universe} from '@universe-ee/sdk';
    import {CustomAttributePreview} from './CustomAttributePreview';

    export default {
    type: 'AttributePreview',
    moduleId: 'AttributePreviewTestUE',
    active: true,
    system: false,
    component: CustomAttributePreview,
    meta: {
    name: 'AttributePreviewTest',
    displayName: () => 'AttributePreviewTest'
    },
    resolver: (attribute: Universe.Platform.Meta.IMetaAbstractAttribute | Universe.Platform.Meta.IMetaComplexAttribute, model: Universe.Platform.Model.AbstractModel) => {
    return true
    }
    } satisfies Universe.Platform.UserExit.UserExitDeclaration;
    interface UEAttributePreview {
        active: boolean;
        component: ComponentType<AttributePreviewProps>;
        meta: UEAttributePreviewMeta;
        moduleId: string;
        resolver: UEAttributePreviewResolver;
        system: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    active: boolean

    Является ли экземпляр точки расширения активным

    Компонент отображения атрибута

    Мета-информация точки расширения

    moduleId: string

    Уникальный идентификатор экземпляра точки расширения

    Функция указывает, следует ли применять данный экземпляр точки расширения

    system: boolean

    Является ли системным экземпляром