Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fieldmap screen design updates #339

Open
wants to merge 72 commits into
base: master
Choose a base branch
from

Conversation

jonathanstegall
Copy link
Member

@jonathanstegall jonathanstegall commented Feb 25, 2020

What does this PR do?

  1. Closes Fieldmap screen design updates #328.
  2. Closes Add default status field to fieldmaps when WordPress provides a status field #319.
  3. Closes Allow users to choose their desired date format in fieldmaps #276.

How do I test this PR?

  1. Make sure the upgrade process runs smoothly without PHP errors.
  2. Make sure the push and pull still works as expected even if no changes are made to existing setup.
  3. Make a new fieldmap. Make sure it pushes and pulls successfully.
  4. Edit an existing fieldmap. Make sure it pushes and pulls successfully.

…ieldmap object for the default wordpress object status
…ect_default_status when interacting with the fieldmap database table itself
…e admin ui for fieldmaps. this is not yet running client side.
…jects. this way it will work on new fieldmaps and when the field changes.
… value around. if it is not overridden by a mapped parameter or a developer hook, and the object type supports a status field, use that default value as the status.
…side the fieldmap selector. we'll need more changes here, including ajax.
# Conflicts:
#	assets/css/object-sync-for-salesforce-admin.css
#	assets/js/object-sync-for-salesforce-admin.js
#	assets/js/object-sync-for-salesforce-admin.min.js
#	assets/js/src/admin.js
#	assets/sass/object-sync-for-salesforce-admin.scss
#	package-lock.json
#	package.json
#	templates/admin/fieldmaps-add-edit-clone.php
…, descriptive text styles, and show/hide stuff for the server side templates the js uses
…ter all, but expand it instead. use it to get status information for the object.
Copy link

@minncodebot minncodebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcs scanning turned up:

🚫 7 errors


hashes-api-scanning skipped

@@ -366,31 +373,27 @@ public function get_fieldmaps( $id = null, $conditions = array(), $reset = false
} else {
$where = '';
}

$mappings = $this->wpdb->get_results( 'SELECT * FROM ' . $table . $where . ' ORDER BY `weight`', ARRAY_A );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use placeholders and $wpdb->prepare(); found $table (WordPress.DB.PreparedSQL.NotPrepared).

@@ -366,31 +373,27 @@ public function get_fieldmaps( $id = null, $conditions = array(), $reset = false
} else {
$where = '';
}

$mappings = $this->wpdb->get_results( 'SELECT * FROM ' . $table . $where . ' ORDER BY `weight`', ARRAY_A );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use placeholders and $wpdb->prepare(); found $where (WordPress.DB.PreparedSQL.NotPrepared).

if ( version_compare( $this->version, '1.5.0', '>=' ) ) {
if ( version_compare( $this->user_installed_version, '2.1.0', '>=' ) ) {
// if the version is greater than or equal to 2.1.0, the fieldmap table has a wordpress_object_default_status column.
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `wordpress_object_default_status`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `pull_to_drafts`, `weight`, `version` FROM $table", ARRAY_A );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use placeholders and $wpdb->prepare(); found interpolated variable $table at "SELECT id, label, wordpress_object, wordpress_object_default_status, salesforce_object, salesforce_record_types_allowed, salesforce_record_type_default, fields, pull_trigger_field, sync_triggers, push_async, push_drafts, pull_to_drafts, weight, version FROM $table" (WordPress.DB.PreparedSQL.InterpolatedNotPrepared).

// if the version is greater than or equal to 2.1.0, the fieldmap table has a wordpress_object_default_status column.
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `wordpress_object_default_status`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `pull_to_drafts`, `weight`, `version` FROM $table", ARRAY_A );
} elseif ( version_compare( $this->user_installed_version, '1.5.0', '>=' ) ) {
// if the version is greater than or equal to 1.5.0, the fieldmap table has a pull_to_drafts column.
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `pull_to_drafts`, `weight`, `version` FROM $table", ARRAY_A );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use placeholders and $wpdb->prepare(); found interpolated variable $table at "SELECT id, label, wordpress_object, salesforce_object, salesforce_record_types_allowed, salesforce_record_type_default, fields, pull_trigger_field, sync_triggers, push_async, push_drafts, pull_to_drafts, weight, version FROM $table" (WordPress.DB.PreparedSQL.InterpolatedNotPrepared).

$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `pull_to_drafts`, `weight`, `version` FROM $table", ARRAY_A );
} elseif ( version_compare( $this->version, '1.2.5', '>=' ) ) {
} elseif ( version_compare( $this->user_installed_version, '1.2.5', '>=' ) ) {
// if the version is greater than or equal to 1.2.5, the fieldmap table has a version column.
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `weight`, `version` FROM $table", ARRAY_A );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use placeholders and $wpdb->prepare(); found interpolated variable $table at "SELECT id, label, wordpress_object, salesforce_object, salesforce_record_types_allowed, salesforce_record_type_default, fields, pull_trigger_field, sync_triggers, push_async, push_drafts, weight, version FROM $table" (WordPress.DB.PreparedSQL.InterpolatedNotPrepared).

$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `pull_to_drafts`, `weight`, `version` FROM $table", ARRAY_A );
} elseif ( version_compare( $this->version, '1.2.5', '>=' ) ) {
} elseif ( version_compare( $this->user_installed_version, '1.2.5', '>=' ) ) {
// if the version is greater than or equal to 1.2.5, the fieldmap table has a version column.
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `weight`, `version` FROM $table", ARRAY_A );
} else {
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `weight` FROM $table", ARRAY_A );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use placeholders and $wpdb->prepare(); found interpolated variable $table at "SELECT id, label, wordpress_object, salesforce_object, salesforce_record_types_allowed, salesforce_record_type_default, fields, pull_trigger_field, sync_triggers, push_async, push_drafts, weight FROM $table" (WordPress.DB.PreparedSQL.InterpolatedNotPrepared).

@@ -1577,7 +1577,17 @@ private function create_called_from_salesforce( $sf_sync_trigger, $synced_object
// we can then check to see if it has a mapping object
// we should only do this if the above hook didn't already set the $wordpress_id.
if ( null === $wordpress_id ) {
$wordpress_id = $this->wordpress->object_upsert( $salesforce_mapping['wordpress_object'], $upsert_key, $upsert_value, $upsert_methods, $params, $salesforce_mapping['pull_to_drafts'], true );
// we don't need to check the plugin version here because the default status is empty in the mapping class, if there's no value in the database

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Copy link

@minncodebot minncodebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcs scanning turned up:

⚠️ 1 warning


hashes-api-scanning skipped


<!-- this needs to reproduce the loaded version -->
<ul class="sfwp-a-fieldmap-values sfwp-a-fieldmap-values-template" data-key="0">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Found precision alignment of 1 spaces (WordPress.WhiteSpace.PrecisionAlignment.Found).

# Conflicts:
#	assets/css/object-sync-for-salesforce-admin.css
#	assets/js/object-sync-for-salesforce-admin.js
#	assets/js/object-sync-for-salesforce-admin.min.js
#	assets/sass/object-sync-for-salesforce-admin.scss
#	classes/class-object-sync-sf-admin.php
#	classes/class-object-sync-sf-mapping.php
#	classes/class-object-sync-sf-salesforce-pull.php
#	languages/object-sync-for-salesforce.pot
#	package-lock.json
#	templates/admin/fieldmaps-add-edit-clone.php
Copy link

@minncodebot minncodebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcs scanning turned up:

🚫 184 errors

⚠️ 8 warnings


hashes-api-scanning skipped

Posting will continue in further review(s)

<?php
// translators: the placeholders refer to: 1) the cache clear link, 2) the cache clear link text.
echo sprintf(
esc_html__( 'To map a custom meta field (such as post meta, user meta, term meta, etc.), WordPress must have at least one value for that field. If you add a new meta field and want to map it, make sure to add a value for it and ', 'object-sync-for-salesforce' ) . '<a href="%1$s" id="clear-sfwp-cache">%2$s</a>' . esc_html__( ' to see the field listed here.', 'object-sync-for-salesforce' ),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

// translators: the placeholders refer to: 1) the cache clear link, 2) the cache clear link text.
echo sprintf(
esc_html__( 'To map a custom meta field (such as post meta, user meta, term meta, etc.), WordPress must have at least one value for that field. If you add a new meta field and want to map it, make sure to add a value for it and ', 'object-sync-for-salesforce' ) . '<a href="%1$s" id="clear-sfwp-cache">%2$s</a>' . esc_html__( ' to see the field listed here.', 'object-sync-for-salesforce' ),
esc_url( get_admin_url( null, 'options-general.php?page=object-sync-salesforce-admin&tab=clear_cache' ) ),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

echo sprintf(
esc_html__( 'To map a custom meta field (such as post meta, user meta, term meta, etc.), WordPress must have at least one value for that field. If you add a new meta field and want to map it, make sure to add a value for it and ', 'object-sync-for-salesforce' ) . '<a href="%1$s" id="clear-sfwp-cache">%2$s</a>' . esc_html__( ' to see the field listed here.', 'object-sync-for-salesforce' ),
esc_url( get_admin_url( null, 'options-general.php?page=object-sync-salesforce-admin&tab=clear_cache' ) ),
esc_html__( 'clear the plugin cache', 'object-sync-for-salesforce' )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

esc_html__( 'To map a custom meta field (such as post meta, user meta, term meta, etc.), WordPress must have at least one value for that field. If you add a new meta field and want to map it, make sure to add a value for it and ', 'object-sync-for-salesforce' ) . '<a href="%1$s" id="clear-sfwp-cache">%2$s</a>' . esc_html__( ' to see the field listed here.', 'object-sync-for-salesforce' ),
esc_url( get_admin_url( null, 'options-general.php?page=object-sync-salesforce-admin&tab=clear_cache' ) ),
esc_html__( 'clear the plugin cache', 'object-sync-for-salesforce' )
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

esc_url( get_admin_url( null, 'options-general.php?page=object-sync-salesforce-admin&tab=clear_cache' ) ),
esc_html__( 'clear the plugin cache', 'object-sync-for-salesforce' )
);
?>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

esc_html__( 'clear the plugin cache', 'object-sync-for-salesforce' )
);
?>
</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

);
?>
</p>
</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

?>
</p>
</div>
</article>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

</p>
</div>
</article>
<article class="postbox sfwp-o-fieldmap-form sfwp-fieldmap-salesforce-field">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

</div>
</article>
<article class="postbox sfwp-o-fieldmap-form sfwp-fieldmap-salesforce-field">
<header>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

Copy link

@minncodebot minncodebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

</article>
<article class="postbox sfwp-o-fieldmap-form sfwp-fieldmap-salesforce-field">
<header>
<label for="sfwp-salesforce-field-0"><?php echo esc_html__( 'Salesforce Field', 'object-sync-for-salesforce' ); ?></label>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

<article class="postbox sfwp-o-fieldmap-form sfwp-fieldmap-salesforce-field">
<header>
<label for="sfwp-salesforce-field-0"><?php echo esc_html__( 'Salesforce Field', 'object-sync-for-salesforce' ); ?></label>
</header>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

<header>
<label for="sfwp-salesforce-field-0"><?php echo esc_html__( 'Salesforce Field', 'object-sync-for-salesforce' ); ?></label>
</header>
<div class="sfwp-m-fieldmap-subgroup-fields select">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

<label for="sfwp-salesforce-field-0"><?php echo esc_html__( 'Salesforce Field', 'object-sync-for-salesforce' ); ?></label>
</header>
<div class="sfwp-m-fieldmap-subgroup-fields select">
<select name="salesforce_field[0]" id="sfwp-salesforce-field-0" style="width: 100%;">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

</header>
<div class="sfwp-m-fieldmap-subgroup-fields select">
<select name="salesforce_field[0]" id="sfwp-salesforce-field-0" style="width: 100%;">
<option value="">- <?php echo esc_html__( 'Select Salesforce Field', 'object-sync-for-salesforce' ); ?> -</option>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

<div class="sfwp-m-fieldmap-subgroup-fields select">
<select name="salesforce_field[0]" id="sfwp-salesforce-field-0" style="width: 100%;">
<option value="">- <?php echo esc_html__( 'Select Salesforce Field', 'object-sync-for-salesforce' ); ?> -</option>
<?php

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

<select name="salesforce_field[0]" id="sfwp-salesforce-field-0" style="width: 100%;">
<option value="">- <?php echo esc_html__( 'Select Salesforce Field', 'object-sync-for-salesforce' ); ?> -</option>
<?php
$salesforce_fields = $this->get_salesforce_object_fields(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

<option value="">- <?php echo esc_html__( 'Select Salesforce Field', 'object-sync-for-salesforce' ); ?> -</option>
<?php
$salesforce_fields = $this->get_salesforce_object_fields(
array(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

<?php
$salesforce_fields = $this->get_salesforce_object_fields(
array(
'salesforce_object' => $salesforce_object,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$salesforce_fields = $this->get_salesforce_object_fields(
array(
'salesforce_object' => $salesforce_object,
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

Copy link

@minncodebot minncodebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

array(
'salesforce_object' => $salesforce_object,
)
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

'salesforce_object' => $salesforce_object,
)
);
// allow for api name or field label to be the display value in the <select>.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

)
);
// allow for api name or field label to be the display value in the <select>.
$display_value = get_option( $this->option_prefix . 'salesforce_field_display_value', 'field_label' );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

);
// allow for api name or field label to be the display value in the <select>.
$display_value = get_option( $this->option_prefix . 'salesforce_field_display_value', 'field_label' );
foreach ( $salesforce_fields as $salesforce_field ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

// allow for api name or field label to be the display value in the <select>.
$display_value = get_option( $this->option_prefix . 'salesforce_field_display_value', 'field_label' );
foreach ( $salesforce_fields as $salesforce_field ) {
$disabled = '';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$display_value = get_option( $this->option_prefix . 'salesforce_field_display_value', 'field_label' );
foreach ( $salesforce_fields as $salesforce_field ) {
$disabled = '';
$key = null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

foreach ( $salesforce_fields as $salesforce_field ) {
$disabled = '';
$key = null;
$needle = $salesforce_field['name']; // the current Salesforce field.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

foreach ( $salesforce_fields as $salesforce_field ) {
$disabled = '';
$key = null;
$needle = $salesforce_field['name']; // the current Salesforce field.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Missing bracket closer (WordPress.Arrays.ArrayKeySpacingRestrictions.MissingBracketCloser).

$disabled = '';
$key = null;
$needle = $salesforce_field['name']; // the current Salesforce field.
// check the already mapped fields for the current field.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$key = null;
$needle = $salesforce_field['name']; // the current Salesforce field.
// check the already mapped fields for the current field.
array_walk(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

Copy link

@minncodebot minncodebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

$needle = $salesforce_field['name']; // the current Salesforce field.
// check the already mapped fields for the current field.
array_walk(
$fieldmap_fields,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

// check the already mapped fields for the current field.
array_walk(
$fieldmap_fields,
function( $v, $k ) use ( &$key, $needle ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

array_walk(
$fieldmap_fields,
function( $v, $k ) use ( &$key, $needle ) {
if ( in_array( $needle, $v['salesforce_field'], true ) ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

array_walk(
$fieldmap_fields,
function( $v, $k ) use ( &$key, $needle ) {
if ( in_array( $needle, $v['salesforce_field'], true ) ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Missing bracket closer (WordPress.Arrays.ArrayKeySpacingRestrictions.MissingBracketCloser).

$fieldmap_fields,
function( $v, $k ) use ( &$key, $needle ) {
if ( in_array( $needle, $v['salesforce_field'], true ) ) {
$key = $k;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

function( $v, $k ) use ( &$key, $needle ) {
if ( in_array( $needle, $v['salesforce_field'], true ) ) {
$key = $k;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

if ( in_array( $needle, $v['salesforce_field'], true ) ) {
$key = $k;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$key = $k;
}
}
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

}
}
);
// disable fields that are already mapped.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

}
);
// disable fields that are already mapped.
if ( null !== $key ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

Copy link

@minncodebot minncodebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

);
// disable fields that are already mapped.
if ( null !== $key ) {
$disabled = ' disabled';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

// disable fields that are already mapped.
if ( null !== $key ) {
$disabled = ' disabled';
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$disabled = ' disabled';
}

if ( 'api_name' === $display_value ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

}

if ( 'api_name' === $display_value ) {
$salesforce_field['label'] = $salesforce_field['name'];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

}

if ( 'api_name' === $display_value ) {
$salesforce_field['label'] = $salesforce_field['name'];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Missing bracket closer (WordPress.Arrays.ArrayKeySpacingRestrictions.MissingBracketCloser).


if ( 'api_name' === $display_value ) {
$salesforce_field['label'] = $salesforce_field['name'];
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$salesforce_field['label'] = $salesforce_field['name'];
}

if ( false === $salesforce_field['nillable'] ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$salesforce_field['label'] = $salesforce_field['name'];
}

if ( false === $salesforce_field['nillable'] ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Missing bracket closer (WordPress.Arrays.ArrayKeySpacingRestrictions.MissingBracketCloser).

}

if ( false === $salesforce_field['nillable'] ) {
$salesforce_field['label'] .= ' *';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

}

if ( false === $salesforce_field['nillable'] ) {
$salesforce_field['label'] .= ' *';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Missing bracket closer (WordPress.Arrays.ArrayKeySpacingRestrictions.MissingBracketCloser).

Copy link

@minncodebot minncodebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.


if ( false === $salesforce_field['nillable'] ) {
$salesforce_field['label'] .= ' *';
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$salesforce_field['label'] .= ' *';
}

if ( false === $salesforce_field['updateable'] ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$salesforce_field['label'] .= ' *';
}

if ( false === $salesforce_field['updateable'] ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Missing bracket closer (WordPress.Arrays.ArrayKeySpacingRestrictions.MissingBracketCloser).

}

if ( false === $salesforce_field['updateable'] ) {
$locked = ' 🔒';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).


if ( false === $salesforce_field['updateable'] ) {
$locked = ' 🔒';
} else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

if ( false === $salesforce_field['updateable'] ) {
$locked = ' 🔒';
} else {
$locked = '';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$locked = ' 🔒';
} else {
$locked = '';
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

$locked = '';
}

echo sprintf(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

}

echo sprintf(
'<option value="%1$s"%2$s>%3$s%4$s</option>',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).


echo sprintf(
'<option value="%1$s"%2$s>%3$s%4$s</option>',
esc_attr( $salesforce_field['name'] ),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

Copy link

@minncodebot minncodebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.


echo sprintf(
'<option value="%1$s"%2$s>%3$s%4$s</option>',
esc_attr( $salesforce_field['name'] ),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Missing bracket closer (WordPress.Arrays.ArrayKeySpacingRestrictions.MissingBracketCloser).

echo sprintf(
'<option value="%1$s"%2$s>%3$s%4$s</option>',
esc_attr( $salesforce_field['name'] ),
esc_attr( $disabled ),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

'<option value="%1$s"%2$s>%3$s%4$s</option>',
esc_attr( $salesforce_field['name'] ),
esc_attr( $disabled ),
esc_html( $salesforce_field['label'] ),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

'<option value="%1$s"%2$s>%3$s%4$s</option>',
esc_attr( $salesforce_field['name'] ),
esc_attr( $disabled ),
esc_html( $salesforce_field['label'] ),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Missing bracket closer (WordPress.Arrays.ArrayKeySpacingRestrictions.MissingBracketCloser).

esc_attr( $salesforce_field['name'] ),
esc_attr( $disabled ),
esc_html( $salesforce_field['label'] ),
esc_attr( $locked )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

esc_attr( $disabled ),
esc_html( $salesforce_field['label'] ),
esc_attr( $locked )
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).

esc_html( $salesforce_field['label'] ),
esc_attr( $locked )
);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

esc_attr( $locked )
);
}
?>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

);
}
?>
</select>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

}
?>
</select>
<p class="description">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull request that adds a feature in progress Work on this issue has started, but is not finished
Projects
None yet
2 participants