diff --git a/assets/js/src/subscribers/importExport/export.js b/assets/js/src/subscribers/importExport/export.js index 88e8b3d45a..8eda6a43cf 100644 --- a/assets/js/src/subscribers/importExport/export.js +++ b/assets/js/src/subscribers/importExport/export.js @@ -35,11 +35,7 @@ jQuery(document).ready(function documentReady() { nextStepButton = jQuery('#mailpoet-export-button'); const templateRendered = (option) => { - let tpl = ''; - if (option.tag !== undefined) { - tpl += `${option.tag}`; - } - tpl += `${option.text}`; + let tpl = `${option.name}`; if (option.count !== undefined) { tpl += `${option.count}`; } diff --git a/assets/js/src/subscribers/importExport/import/step_data_manipulation/generate_segment_selection.jsx b/assets/js/src/subscribers/importExport/import/step_data_manipulation/generate_segment_selection.jsx index d54be9d98d..11b92337dc 100644 --- a/assets/js/src/subscribers/importExport/import/step_data_manipulation/generate_segment_selection.jsx +++ b/assets/js/src/subscribers/importExport/import/step_data_manipulation/generate_segment_selection.jsx @@ -8,11 +8,7 @@ export function createSelection(segments, onSelectionChange) { return; } const templateRendered = (option) => { - let tpl = ''; - if (option.tag) { - tpl += `${option.tag}`; - } - tpl += `${option.text}`; + let tpl = `${option.name}`; if (option.count) { tpl += `${option.count}`; } diff --git a/lib/Subscribers/ImportExport/ImportExportFactory.php b/lib/Subscribers/ImportExport/ImportExportFactory.php index 86024c7d14..5ec499d14a 100644 --- a/lib/Subscribers/ImportExport/ImportExportFactory.php +++ b/lib/Subscribers/ImportExport/ImportExportFactory.php @@ -40,7 +40,6 @@ class ImportExportFactory { return [ 'id' => $segment['id'], 'name' => $segment['name'], - 'text' => $segment['name'], // Required select2 property 'count' => $segment['subscribers'], ]; }, $segments); @@ -70,7 +69,6 @@ class ImportExportFactory { return [ 'id' => $fieldId, 'name' => $fieldName, - 'text' => $fieldName, 'type' => ($fieldId === 'confirmed_at') ? 'date' : null, 'custom' => false, ]; @@ -86,7 +84,6 @@ class ImportExportFactory { return [ 'id' => $field['id'], 'name' => $field['name'], - 'text' => $field['name'], 'type' => $field['type'], 'params' => unserialize($field['params']), 'custom' => true, @@ -102,42 +99,35 @@ class ImportExportFactory { [ 'id' => 'ignore', 'name' => __('Ignore field...', 'mailpoet'), - 'text' => __('Ignore field...', 'mailpoet'), ], [ 'id' => 'create', 'name' => __('Create new field...', 'mailpoet'), - 'text' => __('Create new field...', 'mailpoet'), ], ] : [ [ 'id' => 'select', 'name' => __('Select all...', 'mailpoet'), - 'text' => __('Select all...', 'mailpoet'), ], [ 'id' => 'deselect', 'name' => __('Deselect all...', 'mailpoet'), - 'text' => __('Deselect all...', 'mailpoet'), ], ]; $select2Fields = [ [ 'name' => __('Actions', 'mailpoet'), - 'text' => __('Actions', 'mailpoet'), 'children' => $actions, ], [ 'name' => __('System fields', 'mailpoet'), - 'text' => __('System fields', 'mailpoet'), 'children' => $this->formatSubscriberFields($subscriberFields), ], ]; if ($subscriberCustomFields) { array_push($select2Fields, [ 'name' => __('User fields', 'mailpoet'), - 'text' => __('User fields', 'mailpoet'), 'children' => $this->formatSubscriberCustomFields( $subscriberCustomFields ), diff --git a/tests/integration/Subscribers/ImportExport/ImportExportFactoryTest.php b/tests/integration/Subscribers/ImportExport/ImportExportFactoryTest.php index e373104d18..a66c2536f9 100644 --- a/tests/integration/Subscribers/ImportExport/ImportExportFactoryTest.php +++ b/tests/integration/Subscribers/ImportExport/ImportExportFactoryTest.php @@ -176,23 +176,19 @@ class ImportExportFactoryTest extends \MailPoetTest { $select2FieldsWithoutCustomFields = [ [ 'name' => 'Actions', - 'text' => 'Actions', 'children' => [ [ 'id' => 'ignore', 'name' => 'Ignore field...', - 'text' => 'Ignore field...', ], [ 'id' => 'create', 'name' => 'Create new field...', - 'text' => 'Create new field...', ], ], ], [ 'name' => 'System fields', - 'text' => 'System fields', 'children' => $importExportFactory->formatSubscriberFields( $importExportFactory->getSubscriberFields() ), @@ -203,7 +199,6 @@ class ImportExportFactoryTest extends \MailPoetTest { [ [ 'name' => 'User fields', - 'text' => 'User fields', 'children' => $importExportFactory->formatSubscriberCustomFields( $importExportFactory->getSubscriberCustomFields() ), @@ -226,23 +221,19 @@ class ImportExportFactoryTest extends \MailPoetTest { $select2FieldsWithoutCustomFields = [ [ 'name' => 'Actions', - 'text' => 'Actions', 'children' => [ [ 'id' => 'select', 'name' => 'Select all...', - 'text' => 'Select all...', ], [ 'id' => 'deselect', 'name' => 'Deselect all...', - 'text' => 'Deselect all...', ], ], ], [ 'name' => 'System fields', - 'text' => 'System fields', 'children' => $importExportFactory->formatSubscriberFields( $importExportFactory->getSubscriberFields() ), @@ -253,7 +244,6 @@ class ImportExportFactoryTest extends \MailPoetTest { [ [ 'name' => 'User fields', - 'text' => 'User fields', 'children' => $importExportFactory->formatSubscriberCustomFields( $importExportFactory->getSubscriberCustomFields() ),