Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/lists/element/creation-guide/src/ |
Upload File : |
import { Runtime, Type, Uri } from 'main.core'; import 'sidepanel'; type OpenSliderParams = { iBlockTypeId: string, iBlockId: number, fillConstantsUrl?: string, onClose?: Function, analyticsSection?: string, analyticsP1?: string, }; export class CreationGuide { static open(params: OpenSliderParams) { if (!Type.isPlainObject(params) || !Type.isStringFilled(params.iBlockTypeId) || !Type.isInteger(params.iBlockId)) { throw new TypeError('invalid params'); } const url = Uri.addParam( '/bitrix/components/bitrix/lists.element.creation_guide/', { iBlockTypeId: encodeURIComponent(params.iBlockTypeId), iBlockId: encodeURIComponent(params.iBlockId), fillConstantsUrl: encodeURIComponent(this.#getFillConstantsUrl(params)), analyticsSection: params.analyticsSection || '', }, ); BX.SidePanel.Instance.open( url, { width: 900, cacheable: false, allowChangeHistory: false, loader: '/bitrix/js/lists/element/creation-guide/images/skeleton.svg', events: { onCloseComplete: () => { if (Type.isFunction(params.onClose)) { params.onClose(); } }, }, }, ); this.#sendAnalytics(params); } static #getFillConstantsUrl(params: OpenSliderParams): string { if (Type.isStringFilled(params.fillConstantsUrl)) { return params.fillConstantsUrl; } return Uri.addParam('/bizproc/userprocesses/', { iBlockId: params.iBlockId, }); } static #sendAnalytics(params: OpenSliderParams): void { Runtime.loadExtension('ui.analytics') .then(({ sendData }) => { sendData({ tool: 'automation', category: 'bizproc_operations', event: 'process_start_attempt', c_section: params.analyticsSection || 'bizproc', p1: params.analyticsP1, }); }) .catch(() => {}) ; } }