Skip to content

Commit

Permalink
Merge pull request #3837 from magento-epam/EPAM-PR-42
Browse files Browse the repository at this point in the history
MAGETWO-62411 [Github] Cannot save product because of required attribute within Advanced pricing #7735
MAGETWO-57337 [Github] #5077 Store View (language) switch leads to 404
  • Loading branch information
rganin authored Mar 5, 2019
2 parents 7d0efc5 + 6ed899d commit 3a4ba66
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ private function addAdvancedPriceLink()
'componentType' => Container::NAME,
'component' => 'Magento_Ui/js/form/components/button',
'template' => 'ui/form/components/button/container',
'imports' => [
'childError' => $this->scopeName . '.advanced_pricing_modal.advanced-pricing:error',
],
'actions' => [
[
'targetName' => $this->scopeName . '.advanced_pricing_modal',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
<test name="StoreViewLanguageCorrectSwitchTest">
<annotations>
<features value="Cms"/>
<stories value="Store View (language) switch leads to 404"/>
<group value="Cms"/>
<title value="Check that Store View(language) switches correct"/>
<description value="Check that Store View(language) switches correct"/>
<severity value="MAJOR"/>
<testCaseId value="MAGETWO-96388"/>
<useCaseId value="MAGETWO-57337"/>
<group value="Cms"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
Expand All @@ -37,7 +36,7 @@

<!-- Create StoreView -->
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView">
<argument name="customStore" value="NewStoreViewData"/>
<argument name="customStore" value="NewStoreViewData"/>
</actionGroup>

<!-- Add StoreView To Cms Page-->
Expand All @@ -51,10 +50,18 @@
<see userInput="$$createFirstCmsPage.title$$" stepKey="seePageTitle"/>

<!-- Switch StoreView and check that Cms Page is open -->
<click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="clickStoreViewSwitcher"/>
<waitForElementVisible selector="{{StorefrontHeaderSection.storeViewDropdown}}" stepKey="waitForStoreViewDropDown"/>
<click selector="{{StorefrontHeaderSection.storeViewOption(NewStoreViewData.code)}}" stepKey="selectStoreView"/>
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView">
<argument name="storeView" value="NewStoreViewData"/>
</actionGroup>
<amOnPage url="{{StorefrontHomePage.url}}/$$createSecondCmsPage.identifier$$" stepKey="gotToSecondCmsPage"/>
<see userInput="$$createSecondCmsPage.title$$" stepKey="seePageTitle1"/>

<!--Open first Cms page on custom store view-->
<amOnPage url="{{StorefrontHomePage.url}}/$$createFirstCmsPage.identifier$$" stepKey="gotToFirstCmsPage1"/>
<see userInput="Whoops, our bad..." stepKey="seePageError"/>

<!--Switch to default store view and check Cms page-->
<actionGroup ref="StorefrontSwitchDefaultStoreViewActionGroup" stepKey="switchToDefualtStoreView"/>
<see userInput="$$createFirstCmsPage.title$$" stepKey="seePageTitle2"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@
<click selector="{{StorefrontHeaderSection.storeViewOption(storeView.code)}}" stepKey="clickSelectStoreView"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>

<actionGroup name="StorefrontSwitchDefaultStoreViewActionGroup" extends="StorefrontSwitchStoreViewActionGroup">
<remove keyForRemoval="clickSelectStoreView"/>
<click selector="{{StorefrontHeaderSection.storeViewOption('default')}}" stepKey="clickSelectDefaultStoreView" after="waitForStoreViewDropdown"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ define([
.observe([
'visible',
'disabled',
'title'
'title',
'childError'
]);
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@
attr="'data-index': index">
<span text="title"/>
</button>

<if args="childError">
<strong class="_error">
<span class="admin__page-nav-item-messages">
<span class="admin__page-nav-item-message _error">
<span class="admin__page-nav-item-message-icon"></span>
<span class="admin__page-nav-item-message-tooltip"
data-bind="i18n: 'This element contains invalid data. Please resolve this before saving.'">This element contains invalid data. Please resolve this before saving.</span>
</span>
</span>
</strong>
</if>
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, s
$existingRewrite = $this->urlFinder->findOneByData([
UrlRewrite::REQUEST_PATH => $urlPath
]);
if ($existingRewrite) {
$currentRewrite = $this->urlFinder->findOneByData([
UrlRewrite::REQUEST_PATH => $urlPath,
UrlRewrite::STORE_ID => $targetStore->getId(),
]);

if ($existingRewrite && !$currentRewrite) {
/** @var \Magento\Framework\App\Response\Http $response */
$targetUrl = $targetStore->getBaseUrl();
}
Expand Down

0 comments on commit 3a4ba66

Please sign in to comment.