/** sap.m */ import type Button from 'sap/m/Button'; import type Dialog from 'sap/m/Dialog'; import type Select from 'sap/m/Select'; /** sap.ui.core */ import type UI5Element from 'sap/ui/core/Element'; /** sap.ui.base */ import type Event from 'sap/ui/base/Event'; /** sap.ui.model */ import JSONModel from 'sap/ui/model/json/JSONModel'; /** sap.ui.rta */ import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import { MessageBarType } from '@sap-ux-private/control-property-editor-common'; import { getError } from '../../utils/error.js'; import { sendInfoCenterMessage } from '../../utils/info-center-message.js'; import { getFragments } from '../api-handler.js'; import { ExtensionPointData, ExtensionPointInfo } from '../extension-point.js'; import BaseDialog from './BaseDialog.controller.js'; type ExtensionPointModel = JSONModel & { getProperty(sPath: '/newFragmentName'): string; getProperty(sPath: '/extensionPointName'): string; }; /** * @namespace open.ux.preview.client.adp.controllers */ export default class ExtensionPoint extends BaseDialog { public readonly data: ExtensionPointData; constructor(name: string, _overlays: UI5Element, rta: RuntimeAuthoring, data: ExtensionPointData) { super(name); this.model = new JSONModel(); this.data = data; this.rta = rta; } /** * Setups the Dialog and the JSON Model * * @param {Dialog} dialog - Dialog instance */ async setup(dialog: Dialog): Promise { this.dialog = dialog; this.setEscapeHandler(); await this.buildDialogData(); this.dialog.setModel(this.model); this.dialog.open(); } /** * Handles create button press * * @param event Event */ async onCreateBtnPress(event: Event) { const source = event.getSource