Skip to content

Commit

Permalink
rename CleanProductList mutation to more precise RemoveProductList
Browse files Browse the repository at this point in the history
  • Loading branch information
vitek-rostislav committed Dec 1, 2023
1 parent 6625f5c commit 9334b53
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 97 deletions.
4 changes: 2 additions & 2 deletions app/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,6 @@ type Mutation {
ChangePersonalData(input: ChangePersonalDataInput!): CustomerUser!
"Add a transport to the cart, or remove a transport from the cart"
ChangeTransportInCart(input: ChangeTransportInCartInput!): Cart!
"Removes the product list"
CleanProductList(input: ProductListInput!): ProductList
"Send message to the site owner"
Contact(input: ContactInput!): Boolean!
"Creates complete order with products and addresses"
Expand All @@ -939,6 +937,8 @@ type Mutation {
RemoveFromCart(input: RemoveFromCartInput!): Cart!
"Removes a product from a product list"
RemoveProductFromList(input: ProductListUpdateInput!): ProductList
"Removes the product list"
RemoveProductList(input: ProductListInput!): ProductList
"Remove already used promo code from cart"
RemovePromoCodeFromCart(input: RemovePromoCodeFromCartInput!): Cart!
"Request password recovery - email with hash will be sent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ public function testRemoveProductFromListProductNotInListUserError(ProductListTy
* @dataProvider \Tests\FrontendApiBundle\Functional\Product\ProductList\ProductListTypesDataProvider::getProductListTypes
* @param \Shopsys\FrameworkBundle\Model\Product\List\ProductListTypeEnum $productListType
*/
public function testCleanProductList(ProductListTypeEnum $productListType): void
public function testRemoveProductList(ProductListTypeEnum $productListType): void
{
$response = $this->getResponseContentForGql(__DIR__ . '/graphql/CleanProductListMutation.graphql', [
$response = $this->getResponseContentForGql(__DIR__ . '/graphql/RemoveProductListMutation.graphql', [
'type' => $productListType->name,
]);

$this->assertNull($response['data']['CleanProductList']);
$this->assertNull($response['data']['RemoveProductList']);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,14 @@ public function testRemoveLastProductFromList(ProductListTypeEnum $productListTy
* @param \Shopsys\FrameworkBundle\Model\Product\List\ProductListTypeEnum $productListType
* @param string $uuid
*/
public function testCleanProductList(ProductListTypeEnum $productListType, string $uuid): void
public function testRemoveProductList(ProductListTypeEnum $productListType, string $uuid): void
{
$response = $this->getResponseContentForGql(__DIR__ . '/graphql/CleanProductListMutation.graphql', [
$response = $this->getResponseContentForGql(__DIR__ . '/graphql/RemoveProductListMutation.graphql', [
'productListUuid' => $uuid,
'type' => $productListType->name,
]);

$this->assertNull($response['data']['CleanProductList']);
$this->assertNull($response['data']['RemoveProductList']);
}

public function testMergeListsAfterLoginAsCustomerUserWithExistingProductLists(): void
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation RemoveProductListMutation($productListUuid: Uuid, $type: ProductListTypeEnum!) {
RemoveProductList(input:{type: $type, uuid: $productListUuid}) {
uuid
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ type ProductComparisonButtonRemoveAllProps = {

export const ProductComparisonButtonRemoveAll: FC<ProductComparisonButtonRemoveAllProps> = ({ displayMobile }) => {
const { t } = useTranslation();
const { cleanComparison: handleCleanComparison } = useComparison();
const { removeComparison: handleRemoveComparison } = useComparison();

return (
<div
className={twJoin(
'hidden cursor-pointer items-center rounded bg-greyVeryLight py-2 px-4 transition-colors hover:bg-greyLighter sm:inline-flex',
displayMobile && 'mb-5 inline-flex sm:hidden',
)}
onClick={handleCleanComparison}
onClick={handleRemoveComparison}
>
<span className="mr-3 text-sm">{t('Delete all')}</span>
<RemoveThinIcon className="w-3" />
Expand Down
4 changes: 2 additions & 2 deletions storefront/components/Pages/Wishlist/Wishlist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import useTranslation from 'next-translate/useTranslation';

export const Wishlist: FC = () => {
const { t } = useTranslation();
const { wishlist, fetching, cleanWishlist: handleCleanWishlist } = useWishlist();
const { wishlist, fetching, removeWishlist: handleRemoveWishlist } = useWishlist();
const title = `${t('Wishlist')}${wishlist?.products.length ? ` (${wishlist.products.length})` : ''}`;

return (
Expand All @@ -22,7 +22,7 @@ export const Wishlist: FC = () => {
<div
className="mb-2 cursor-pointer items-center rounded bg-greyVeryLight py-2 px-4 transition-colors hover:bg-greyLighter sm:inline-flex lg:mb-0"
onClick={() => {
handleCleanWishlist();
handleRemoveWishlist();
}}
>
<span className="mr-3 text-sm">{t('Delete all from wishlist')}</span>
Expand Down
28 changes: 14 additions & 14 deletions storefront/graphql/docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -1203,20 +1203,6 @@ Add a transport to the cart, or remove a transport from the cart
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong>CleanProductList</strong></td>
<td valign="top"><a href="#productlist">ProductList</a></td>
<td>

Removes the product list

</td>
</tr>
<tr>
<td colspan="2" align="right" valign="top">input</td>
<td valign="top"><a href="#productlistinput">ProductListInput</a>!</td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong>Contact</strong></td>
<td valign="top"><a href="#boolean">Boolean</a>!</td>
<td>
Expand Down Expand Up @@ -1394,6 +1380,20 @@ Removes a product from a product list
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong>RemoveProductList</strong></td>
<td valign="top"><a href="#productlist">ProductList</a></td>
<td>

Removes the product list

</td>
</tr>
<tr>
<td colspan="2" align="right" valign="top">input</td>
<td valign="top"><a href="#productlistinput">ProductListInput</a>!</td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong>RemovePromoCodeFromCart</strong></td>
<td valign="top"><a href="#cart">Cart</a>!</td>
<td>
Expand Down
Loading

0 comments on commit 9334b53

Please sign in to comment.