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

Reordering products in collection #5327

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 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
5 changes: 5 additions & 0 deletions .changeset/four-lions-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Now you can re-order products within the collection.
6 changes: 6 additions & 0 deletions locale/defaultMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -5488,6 +5488,9 @@
"context": "card update success alert title",
"string": "Successfully updated card balance"
},
"XAvER/": {
"string": "Product reordered"
},
"XB2Jj9": {
"context": "create app button",
"string": "Create App"
Expand Down Expand Up @@ -7897,6 +7900,9 @@
"context": "label",
"string": "External app"
},
"nABmvC": {
"string": "No. of rows"
},
"nBzIBG": {
"string": "Delete permission group"
},
Expand Down
46 changes: 23 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@apollo/client": "3.4.17",
"@dnd-kit/core": "^6.0.8",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^7.0.2",
"@dnd-kit/utilities": "^3.2.1",
"@editorjs/editorjs": "^2.30.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @ts-strict-ignore
import { ChannelCollectionData } from "@dashboard/channels/utils";
import { collectionListPath } from "@dashboard/collections/urls";
import { collectionListPath, CollectionUrlQueryParams } from "@dashboard/collections/urls";
import { TopNav } from "@dashboard/components/AppLayout/TopNav";
import { CardSpacer } from "@dashboard/components/CardSpacer";
import ChannelsAvailabilityCard from "@dashboard/components/ChannelsAvailabilityCard";
import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton";
import { DetailPageLayout } from "@dashboard/components/Layouts";
Expand All @@ -21,14 +20,13 @@ import useNavigator from "@dashboard/hooks/useNavigator";
import React from "react";
import { useIntl } from "react-intl";

import { ChannelProps, ListActions, PageListProps } from "../../../types";
import { ChannelProps, PageListProps } from "../../../types";
import CollectionDetails from "../CollectionDetails/CollectionDetails";
import { CollectionImage } from "../CollectionImage/CollectionImage";
import CollectionProducts from "../CollectionProducts/CollectionProducts";
import CollectionUpdateForm, { CollectionUpdateData } from "./form";

export interface CollectionDetailsPageProps extends PageListProps, ListActions, ChannelProps {
onAdd: () => void;
export interface CollectionDetailsPageProps extends PageListProps, ChannelProps {
channelsCount: number;
channelsErrors: CollectionChannelListingErrorFragment[];
collection: CollectionDetailsQuery["collection"];
Expand All @@ -38,10 +36,10 @@ export interface CollectionDetailsPageProps extends PageListProps, ListActions,
onCollectionRemove: () => void;
onImageDelete: () => void;
onImageUpload: (file: File) => void;
onProductUnassign: (id: string, event: React.MouseEvent<any>) => void;
onSubmit: (data: CollectionUpdateData) => SubmitPromise;
onChannelsChange: (data: ChannelCollectionData[]) => void;
openChannelsModal: () => void;
params: CollectionUrlQueryParams;
}

const CollectionDetailsPage: React.FC<CollectionDetailsPageProps> = ({
Expand Down Expand Up @@ -80,23 +78,20 @@ const CollectionDetailsPage: React.FC<CollectionDetailsPageProps> = ({
<TopNav href={collectionListBackLink} title={collection?.name} />
<DetailPageLayout.Content>
<CollectionDetails data={data} disabled={disabled} errors={errors} onChange={change} />
<CardSpacer />
<CollectionImage
data={data}
image={collection?.backgroundImage}
onImageDelete={onImageDelete}
onImageUpload={onImageUpload}
onChange={change}
/>
<CardSpacer />
<Metadata data={data} onChange={handlers.changeMetadata} />
<CardSpacer />
<CollectionProducts
disabled={disabled}
collection={collection}
currentChannels={currentChannels}
{...collectionProductsProps}
/>
<CardSpacer />
<SeoForm
description={data.seoDescription}
disabled={disabled}
Expand Down
Loading
Loading