UNPKG

@botonic/plugin-flow-builder

Version:

Use Flow Builder to show your contents

42 lines 1.72 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FlowWhatsappButtonListRow = void 0; const tslib_1 = require("tslib"); const constants_1 = require("../../constants"); const content_fields_base_1 = require("../content-fields-base"); class FlowWhatsappButtonListRow extends content_fields_base_1.ContentFieldsBase { constructor() { super(...arguments); this.title = ''; this.description = ''; } static fromHubtypeCMS(component, locale, cmsApi) { const newRow = new FlowWhatsappButtonListRow(component.id); newRow.title = this.getTextByLocale(locale, component.text); newRow.description = this.getTextByLocale(locale, component.description); newRow.targetId = cmsApi.getPayload(component.target); return newRow; } // eslint-disable-next-line @typescript-eslint/no-unused-vars trackFlow(_request) { return tslib_1.__awaiter(this, void 0, void 0, function* () { // Not apply for this content, because it is a child of the FlowWhatsappButtonList content }); } toBotonic(rowIndex, sectionIndex) { if (!this.targetId) { console.error(`Row with title: '${this.title}' has no target`); return undefined; } return { id: this.getRowId(rowIndex, sectionIndex), title: this.title, description: this.description, }; } getRowId(rowIndex, sectionIndex) { return `${this.targetId}${constants_1.SOURCE_INFO_SEPARATOR}${sectionIndex}.${rowIndex}`; } } exports.FlowWhatsappButtonListRow = FlowWhatsappButtonListRow; //# sourceMappingURL=flow-whatsapp-button-list-row.js.map