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

Product attribute creation page handles Storefront tab visibility wrong #11770

Merged
merged 4 commits into from
Nov 6, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ function switchDefaultValueField()

<?php foreach ($this->helper('Magento\Catalog\Helper\Data')->getAttributeHiddenFields() as $type => $fields): ?>
case '<?= /* @escapeNotVerified */ $type ?>':
var is_front_tab_hidden = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you change this variable to isFrontTabHidden to match the rest of the file.

<?php foreach ($fields as $one): ?>
<?php if ($one == '_front_fieldset'): ?>
getFrontTab().hide();
is_front_tab_hidden = true;
<?php elseif ($one == '_default_value'): ?>
defaultValueTextVisibility =
defaultValueTextareaVisibility =
Expand All @@ -210,6 +212,10 @@ function switchDefaultValueField()
setRowVisibility('<?= /* @escapeNotVerified */ $one ?>', false);
<?php endif; ?>
<?php endforeach; ?>

if (!is_front_tab_hidden){
getFrontTab().show();
}
break;
<?php endforeach; ?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ define([
useProductImageForSwatch = false,
defaultValueUpdateImage = false,
optionDefaultInputType = '',
isFrontTabHidden = false,
thing = this;

if (!this.frontendInput.length) {
Expand Down Expand Up @@ -246,6 +247,7 @@ define([
switch (option) {
case '_front_fieldset':
thing.tabsFront.hide();
isFrontTabHidden = true;
break;

case '_default_value':
Expand All @@ -262,6 +264,11 @@ define([
thing.setRowVisibility($('#' + option), false);
}
});

if (!isFrontTabHidden) {
thing.tabsFront.show();
}

} else {
this.tabsFront.show();
this.showDefaultRows();
Expand Down