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/landing/ui/panel/formsettingspanel/content/vk/src/ |
Upload File : |
import {ContentWrapper} from 'landing.ui.panel.basepresetpanel'; import {HeaderCard} from 'landing.ui.card.headercard'; import {Loc} from 'landing.loc'; import {BaseCard} from 'landing.ui.card.basecard'; import {Dom} from 'main.core'; import {BaseEvent} from 'main.core.events'; import {type FormOptions} from 'crm.form.type'; import {MessageCard} from 'landing.ui.card.messagecard'; import {Integration} from 'crm.form.integration'; export default class VkContent extends ContentWrapper { constructor(options) { super(options); this.setEventNamespace('BX.Landing.UI.Panel.FormSettingsPanel.VkContent'); this.addItem( new HeaderCard({ title: Loc.getMessage('LANDING_SIDEBAR_BUTTON_VK'), }), ); if (!this.options.dictionary.integration.canUse) { this.addItem( new MessageCard({ header: Loc.getMessage('LANDING_CRM_FORM_INTEGRATION_SEO_NOT_INSTALLED_HEADER'), description: Loc.getMessage('LANDING_CRM_FORM_INTEGRATION_SEO_NOT_INSTALLED_VK_TEXT'), angle: false, closeable: false, }), ); return; } const buttonCard = new BaseCard(); Dom.style(buttonCard.getLayout(), { padding: 0, margin: 0, }); const integration = new Integration({ type: 'vkontakte', form: this.options.formOptions, fields: this.options.crmFields, dictionary: this.options.dictionary, }); integration.subscribe('change', this.onChange.bind(this)); Dom.append( integration.render(), buttonCard.getBody() ); this.addItem(buttonCard); } prepareButtonText(formOptions: FormOptions) { const enabled = formOptions.integration.cases.some((item) => { return item.providerCode === 'vkontakte'; }); if (enabled) { return Loc.getMessage('LANDING_FORM_SETTINGS_VK_BUTTON_ENABLED'); } return Loc.getMessage('LANDING_FORM_SETTINGS_VK_BUTTON'); } valueReducer(value: {[key: string]: any}): {[key: string]: any} { return { integration: this.options.formOptions.integration, }; } onChange(event: BaseEvent) { this.emit('onChange', {skipPrepare: false}); } getData() { return this.options.formOptions.integration.cases.filter(data => data.providerCode === 'vkontakte')[0] || null; } }