2020-06-30 17:41:43 +00:00
|
|
|
import useAppState from "@saleor/hooks/useAppState";
|
|
|
|
import { defaultDataIdFromObject, InMemoryCache } from "apollo-cache-inmemory";
|
2019-06-19 14:40:52 +00:00
|
|
|
import { ApolloClient } from "apollo-client";
|
|
|
|
import { ApolloLink } from "apollo-link";
|
2020-06-30 17:41:43 +00:00
|
|
|
import { BatchHttpLink } from "apollo-link-batch-http";
|
|
|
|
import { createUploadLink } from "apollo-upload-client";
|
|
|
|
import React from "react";
|
2019-06-19 14:40:52 +00:00
|
|
|
import { ApolloProvider } from "react-apollo";
|
2020-06-30 17:41:43 +00:00
|
|
|
import { render } from "react-dom";
|
|
|
|
import ErrorBoundary from "react-error-boundary";
|
|
|
|
import TagManager from "react-gtm-module";
|
|
|
|
import { useIntl } from "react-intl";
|
|
|
|
import { BrowserRouter, Route, Switch } from "react-router-dom";
|
|
|
|
|
2020-07-22 10:54:15 +00:00
|
|
|
import AppsSection from "./apps";
|
|
|
|
import { appsSection } from "./apps/urls";
|
2019-08-09 11:14:35 +00:00
|
|
|
import AttributeSection from "./attributes";
|
2020-06-30 17:41:43 +00:00
|
|
|
import { attributeSection } from "./attributes/urls";
|
2020-07-23 13:37:39 +00:00
|
|
|
import Auth from "./auth";
|
2020-07-14 08:11:43 +00:00
|
|
|
import AuthProvider, { useAuth } from "./auth/AuthProvider";
|
2020-06-30 17:41:43 +00:00
|
|
|
import LoginLoading from "./auth/components/LoginLoading/LoginLoading";
|
|
|
|
import SectionRoute from "./auth/components/SectionRoute";
|
2020-07-23 13:37:39 +00:00
|
|
|
import authLink from "./auth/link";
|
2020-06-30 17:41:43 +00:00
|
|
|
import { hasPermission } from "./auth/misc";
|
2019-06-19 14:40:52 +00:00
|
|
|
import CategorySection from "./categories";
|
Multichannel (#833)
* add multichannel to configuration view
* create multichannels list view
* create multichannels list view
* add ChannelsCreate view
* update channels in configuration
* add stories
* update default messages
* fix ChannelForm props
* update channels list styles
* update snapshots
* update channel form currency input
* update Channels fragments
* extract messages
* remove tabs from channelsList
* channel details, channel delete modal (#598)
* create Channel details view
* create ChannelDeleteDialog
* add channels delete dialog to channels list
* update messages and types
* fixes after review
* channels availability (#609)
* create Channel details view
* update messages and types
* create ChannelsAvailability component
* create more product channels components
* create channels stories, update fixtures, types
* update product views with channels data
* update schema and snapshots
* update defaultMessages
* update ProductUpdate view
* create ChannelsAvailabilityDropdown component
* add product channels to local storage
* update globalTypes
* Update to new schema and resolve issues
* Update messages
* create deleteChannel mutation
* add channels availability component to product create view
* refactor ProductCreate and ProductUpdate views
* CollectionProducts view cleanup
* add disabled prop to ActionDialog
* use updateChannels mutation in ProductCreate view
* ProductCreate - update submit function
* fixes after review
* update snapshots and messages
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
* channels shipping components (#655)
* create PricingCard, OrderValue and OrderWeight components
* create ShippingZoneRatesPage and DeleteShippingRateDialog
* update ChannelsAvailability component
* updates after review
* channels shipping views (#662)
* update ChannelsAvailability component
* updates after review
* create PriceRate views, update types
* create weight rates views
* update shipping views, stories, messages
* update snapshots
* update snapshots
* update useChannels hook
* orders channels components (#698)
* create OrderChannelSectionCard component
* update OrderDetailsPage
* update DraftOrderChannelCard
* update snapshots
* update fixtures
* small change after review, update snapshots
* product pricing (#702)
* update product types
* update Pricing in simple product view
* use productVariantCreate mutation in simple product view
* update snapshots and messages
* handle create variant (#715)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update snapshots and messages
* fix update and create product handlers
* update pricing types
* channels modal - new styles, search input (#717)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* fix search input label styles
* update toggleAllChannels function
* update variant creator (#724)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* add channelLisitngs to variant creator
* update variant creator price styles
* update product variant creator reducer tests
* update createVariants tests
* update error handling in product variant creator
* add Skip pricing for now option
* use PriceField instead of TextField in ProductVariantCreatorSummary
* create price validation function
* fix errors handling in ProductVariantPrice component
* fixes after review
* Product List - remove publish/unpublish buttons (#727)
* ProductList - remove publish and unpublish buttons
* update messages
* update snapshots, messages
* revert changes in ChannelsAvailabilityDropdown
* products/shipping/discount list settings (#739)
* create ChannelSettingsDialog component
* update snapshots
* ProductList - open settings modal when there is no selected channel
* add settings modal to vouchers list
* add settings dialog to sales list
* add setting modal to shipping list
* update shipping
* update snapshots, messages
* useChannelsSettings - remove selectedChannelSlug
* fix channels update handler in product and shipping view
* messages update in ChannelSettingsDialog
* handle product/discount list when there is no channels
* update onSettingsOpen prop
* collection availability dropdown (#743)
* add availability dropdown to collection products list
* update channelListingProduct fragment name
* update voucher view/components with channels (#746)
* update voucher view/components with channels
* update VoucherSummary, remove defaultCurrency from voucher components
* update snapshots
* move getChannelsVariables func to discounts handlers
* update voucher messages
* sale view/components with channels (#750)
* update sale views with channels
* small fixes in discounts
* order views with channels (#752)
* update draft orders with channels
* add channel activate/deactivate mutations
* remove sort by total in orders list
* add error notification on channel activate/deactivate
* product variants channel select (#755)
* add channels selector to ProductVariants component
* remove selectedChannel from ProductUpdate, update messages and snapshots
* update product fragments
* update translations (#762)
* update translations
* fix translation types
* update messages
* update Availability component (#766)
* update ChannelsAvailability component
* update product fixtures
* update collection and channel fixtures
* ChannelsAvailability - handle errors
* update product handlers
* update ChannelsAvailability styles
* update ProductVariant
* update snapshots
* fix missing things in multichannel (#785)
* add availability dropdown to discount products list
* fix error handling in shipping components
* update product views and components
* update messages
* update category view/components
* update CategoryProducts styles
* remove defaultCurrency from shipping components
* create ChannelsSelect component
* update channels error handling after review
* another fixes after review
* Add channels to collection views/components (#791)
** update collection components and views
* update create collection view
* update error handling in collection
* remove filter bar from collection list
* update products fragments
* small fix in collection create view
* use collectionFragment in useCatalogSearch
* update defaultMessages and snapshots
* update homepage view/drop defaultCurrency (#801)
* update homepage view
* drop defaultCurrency prop
* fix onChannelChange function in home view
* remove visibility from product list filters
* update export products with channels (#803)
* update ProductExportDialog with channels
* add new channel error code
* remover VISIBLE from product export dialog Financial information
* fix input size in ProductVariantCreatorSummary (#804)
* channels currency code select (#806)
* create select with currency codes
* fix ChannelDeleteDialog
* update defaultMessages, remove unneeded ChannelDetails handlers
* fixes after rebase
* replace channelListing with channelListings
* [multichannel] Update schema]
* Fix product create test
Co-authored-by: AlicjaSzu <alicja.szukuc@gmail.com>
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
2020-11-17 16:10:42 +00:00
|
|
|
import ChannelsSection from "./channels";
|
|
|
|
import { channelsSection } from "./channels/urls";
|
2019-06-19 14:40:52 +00:00
|
|
|
import CollectionSection from "./collections";
|
2020-06-30 17:41:43 +00:00
|
|
|
import AppLayout from "./components/AppLayout";
|
2020-11-23 09:39:24 +00:00
|
|
|
import useAppChannel, {
|
|
|
|
AppChannelProvider
|
|
|
|
} from "./components/AppLayout/AppChannelContext";
|
2020-06-24 11:44:35 +00:00
|
|
|
import { DateProvider } from "./components/Date";
|
2020-06-30 17:41:43 +00:00
|
|
|
import { LocaleProvider } from "./components/Locale";
|
|
|
|
import MessageManagerProvider from "./components/messages";
|
|
|
|
import { ShopProvider } from "./components/Shop";
|
|
|
|
import ThemeProvider from "./components/Theme";
|
|
|
|
import { WindowTitle } from "./components/WindowTitle";
|
|
|
|
import { API_URI, APP_MOUNT_URI, GTM_ID } from "./config";
|
|
|
|
import ConfigurationSection, { createConfigurationMenu } from "./configuration";
|
|
|
|
import AppStateProvider from "./containers/AppState";
|
|
|
|
import BackgroundTasksProvider from "./containers/BackgroundTasks";
|
|
|
|
import { CustomerSection } from "./customers";
|
2019-06-19 14:40:52 +00:00
|
|
|
import DiscountSection from "./discounts";
|
|
|
|
import HomePage from "./home";
|
2020-06-30 17:41:43 +00:00
|
|
|
import { commonMessages } from "./intl";
|
2019-06-19 14:40:52 +00:00
|
|
|
import NavigationSection from "./navigation";
|
2020-06-30 17:41:43 +00:00
|
|
|
import { navigationSection } from "./navigation/urls";
|
2019-06-19 14:40:52 +00:00
|
|
|
import { NotFound } from "./NotFound";
|
|
|
|
import OrdersSection from "./orders";
|
|
|
|
import PageSection from "./pages";
|
2020-11-19 14:42:14 +00:00
|
|
|
import PageTypesSection from "./pageTypes";
|
2020-05-14 09:30:32 +00:00
|
|
|
import PermissionGroupSection from "./permissionGroups";
|
2019-08-21 14:30:56 +00:00
|
|
|
import PluginsSection from "./plugins";
|
2019-06-19 14:40:52 +00:00
|
|
|
import ProductSection from "./products";
|
|
|
|
import ProductTypesSection from "./productTypes";
|
|
|
|
import ShippingSection from "./shipping";
|
|
|
|
import SiteSettingsSection from "./siteSettings";
|
|
|
|
import StaffSection from "./staff";
|
|
|
|
import TaxesSection from "./taxes";
|
|
|
|
import TranslationsSection from "./translations";
|
2020-06-30 17:41:43 +00:00
|
|
|
import { PermissionEnum } from "./types/globalTypes";
|
2020-01-30 11:46:35 +00:00
|
|
|
import WarehouseSection from "./warehouses";
|
2020-06-24 11:44:35 +00:00
|
|
|
import { warehouseSection } from "./warehouses/urls";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
2020-11-23 09:39:24 +00:00
|
|
|
if (process.env.GTM_ID) {
|
2020-05-25 23:36:56 +00:00
|
|
|
TagManager.initialize({ gtmId: GTM_ID });
|
|
|
|
}
|
|
|
|
|
2019-08-09 11:14:35 +00:00
|
|
|
// DON'T TOUCH THIS
|
|
|
|
// These are separate clients and do not share configs between themselves
|
|
|
|
// so we need to explicitly set them
|
2019-06-19 14:40:52 +00:00
|
|
|
const linkOptions = {
|
2020-07-23 13:37:39 +00:00
|
|
|
credentials: "include",
|
2019-06-19 14:40:52 +00:00
|
|
|
uri: API_URI
|
|
|
|
};
|
|
|
|
const uploadLink = createUploadLink(linkOptions);
|
2019-08-09 11:14:35 +00:00
|
|
|
const batchLink = new BatchHttpLink({
|
|
|
|
batchInterval: 100,
|
|
|
|
...linkOptions
|
|
|
|
});
|
2019-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
const link = ApolloLink.split(
|
|
|
|
operation => operation.getContext().useBatching,
|
|
|
|
batchLink,
|
|
|
|
uploadLink
|
|
|
|
);
|
|
|
|
|
|
|
|
const apolloClient = new ApolloClient({
|
|
|
|
cache: new InMemoryCache({
|
|
|
|
dataIdFromObject: (obj: any) => {
|
|
|
|
// We need to set manually shop's ID, since it is singleton and
|
|
|
|
// API does not return its ID
|
|
|
|
if (obj.__typename === "Shop") {
|
|
|
|
return "shop";
|
|
|
|
}
|
|
|
|
return defaultDataIdFromObject(obj);
|
|
|
|
}
|
|
|
|
}),
|
2020-07-23 13:37:39 +00:00
|
|
|
link: authLink.concat(link)
|
2019-06-19 14:40:52 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const App: React.FC = () => {
|
|
|
|
const isDark = localStorage.getItem("theme") === "true";
|
|
|
|
|
|
|
|
return (
|
2019-08-09 11:14:35 +00:00
|
|
|
<ApolloProvider client={apolloClient}>
|
|
|
|
<BrowserRouter basename={APP_MOUNT_URI}>
|
|
|
|
<ThemeProvider isDefaultDark={isDark}>
|
|
|
|
<DateProvider>
|
|
|
|
<LocaleProvider>
|
2020-06-30 17:41:43 +00:00
|
|
|
<MessageManagerProvider>
|
2020-06-23 12:31:27 +00:00
|
|
|
<BackgroundTasksProvider>
|
|
|
|
<AppStateProvider>
|
|
|
|
<ShopProvider>
|
2020-07-14 08:11:43 +00:00
|
|
|
<AuthProvider>
|
2020-11-23 09:39:24 +00:00
|
|
|
<AppChannelProvider>
|
|
|
|
<Routes />
|
|
|
|
</AppChannelProvider>
|
2020-07-14 08:11:43 +00:00
|
|
|
</AuthProvider>
|
2020-06-23 12:31:27 +00:00
|
|
|
</ShopProvider>
|
|
|
|
</AppStateProvider>
|
|
|
|
</BackgroundTasksProvider>
|
2020-06-30 17:41:43 +00:00
|
|
|
</MessageManagerProvider>
|
2019-08-09 11:14:35 +00:00
|
|
|
</LocaleProvider>
|
|
|
|
</DateProvider>
|
|
|
|
</ThemeProvider>
|
|
|
|
</BrowserRouter>
|
|
|
|
</ApolloProvider>
|
2019-06-19 14:40:52 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2019-08-26 12:56:31 +00:00
|
|
|
const Routes: React.FC = () => {
|
|
|
|
const intl = useIntl();
|
2019-11-14 14:10:52 +00:00
|
|
|
const [, dispatchAppState] = useAppState();
|
2020-07-14 08:11:43 +00:00
|
|
|
const {
|
|
|
|
hasToken,
|
|
|
|
isAuthenticated,
|
|
|
|
tokenAuthLoading,
|
|
|
|
tokenVerifyLoading,
|
|
|
|
user
|
|
|
|
} = useAuth();
|
2020-11-23 09:39:24 +00:00
|
|
|
const { channel } = useAppChannel(false);
|
2019-08-26 12:56:31 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<WindowTitle title={intl.formatMessage(commonMessages.dashboard)} />
|
2020-11-23 09:39:24 +00:00
|
|
|
{channel &&
|
|
|
|
isAuthenticated &&
|
|
|
|
!tokenAuthLoading &&
|
|
|
|
!tokenVerifyLoading ? (
|
2020-07-14 08:11:43 +00:00
|
|
|
<AppLayout>
|
|
|
|
<ErrorBoundary
|
|
|
|
onError={() =>
|
|
|
|
dispatchAppState({
|
|
|
|
payload: {
|
|
|
|
error: "unhandled"
|
|
|
|
},
|
|
|
|
type: "displayError"
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<Switch>
|
|
|
|
<SectionRoute exact path="/" component={HomePage} />
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_PRODUCTS]}
|
|
|
|
path="/categories"
|
|
|
|
component={CategorySection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_PRODUCTS]}
|
|
|
|
path="/collections"
|
|
|
|
component={CollectionSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_USERS]}
|
|
|
|
path="/customers"
|
|
|
|
component={CustomerSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_DISCOUNTS]}
|
|
|
|
path="/discounts"
|
|
|
|
component={DiscountSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_PAGES]}
|
|
|
|
path="/pages"
|
|
|
|
component={PageSection}
|
|
|
|
/>
|
2020-11-19 14:42:14 +00:00
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_PAGES]}
|
|
|
|
path="/page-types"
|
|
|
|
component={PageTypesSection}
|
|
|
|
/>
|
2020-07-14 08:11:43 +00:00
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_PLUGINS]}
|
|
|
|
path="/plugins"
|
|
|
|
component={PluginsSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_ORDERS]}
|
|
|
|
path="/orders"
|
|
|
|
component={OrdersSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_PRODUCTS]}
|
|
|
|
path="/products"
|
|
|
|
component={ProductSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
Multichannel (#833)
* add multichannel to configuration view
* create multichannels list view
* create multichannels list view
* add ChannelsCreate view
* update channels in configuration
* add stories
* update default messages
* fix ChannelForm props
* update channels list styles
* update snapshots
* update channel form currency input
* update Channels fragments
* extract messages
* remove tabs from channelsList
* channel details, channel delete modal (#598)
* create Channel details view
* create ChannelDeleteDialog
* add channels delete dialog to channels list
* update messages and types
* fixes after review
* channels availability (#609)
* create Channel details view
* update messages and types
* create ChannelsAvailability component
* create more product channels components
* create channels stories, update fixtures, types
* update product views with channels data
* update schema and snapshots
* update defaultMessages
* update ProductUpdate view
* create ChannelsAvailabilityDropdown component
* add product channels to local storage
* update globalTypes
* Update to new schema and resolve issues
* Update messages
* create deleteChannel mutation
* add channels availability component to product create view
* refactor ProductCreate and ProductUpdate views
* CollectionProducts view cleanup
* add disabled prop to ActionDialog
* use updateChannels mutation in ProductCreate view
* ProductCreate - update submit function
* fixes after review
* update snapshots and messages
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
* channels shipping components (#655)
* create PricingCard, OrderValue and OrderWeight components
* create ShippingZoneRatesPage and DeleteShippingRateDialog
* update ChannelsAvailability component
* updates after review
* channels shipping views (#662)
* update ChannelsAvailability component
* updates after review
* create PriceRate views, update types
* create weight rates views
* update shipping views, stories, messages
* update snapshots
* update snapshots
* update useChannels hook
* orders channels components (#698)
* create OrderChannelSectionCard component
* update OrderDetailsPage
* update DraftOrderChannelCard
* update snapshots
* update fixtures
* small change after review, update snapshots
* product pricing (#702)
* update product types
* update Pricing in simple product view
* use productVariantCreate mutation in simple product view
* update snapshots and messages
* handle create variant (#715)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update snapshots and messages
* fix update and create product handlers
* update pricing types
* channels modal - new styles, search input (#717)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* fix search input label styles
* update toggleAllChannels function
* update variant creator (#724)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* add channelLisitngs to variant creator
* update variant creator price styles
* update product variant creator reducer tests
* update createVariants tests
* update error handling in product variant creator
* add Skip pricing for now option
* use PriceField instead of TextField in ProductVariantCreatorSummary
* create price validation function
* fix errors handling in ProductVariantPrice component
* fixes after review
* Product List - remove publish/unpublish buttons (#727)
* ProductList - remove publish and unpublish buttons
* update messages
* update snapshots, messages
* revert changes in ChannelsAvailabilityDropdown
* products/shipping/discount list settings (#739)
* create ChannelSettingsDialog component
* update snapshots
* ProductList - open settings modal when there is no selected channel
* add settings modal to vouchers list
* add settings dialog to sales list
* add setting modal to shipping list
* update shipping
* update snapshots, messages
* useChannelsSettings - remove selectedChannelSlug
* fix channels update handler in product and shipping view
* messages update in ChannelSettingsDialog
* handle product/discount list when there is no channels
* update onSettingsOpen prop
* collection availability dropdown (#743)
* add availability dropdown to collection products list
* update channelListingProduct fragment name
* update voucher view/components with channels (#746)
* update voucher view/components with channels
* update VoucherSummary, remove defaultCurrency from voucher components
* update snapshots
* move getChannelsVariables func to discounts handlers
* update voucher messages
* sale view/components with channels (#750)
* update sale views with channels
* small fixes in discounts
* order views with channels (#752)
* update draft orders with channels
* add channel activate/deactivate mutations
* remove sort by total in orders list
* add error notification on channel activate/deactivate
* product variants channel select (#755)
* add channels selector to ProductVariants component
* remove selectedChannel from ProductUpdate, update messages and snapshots
* update product fragments
* update translations (#762)
* update translations
* fix translation types
* update messages
* update Availability component (#766)
* update ChannelsAvailability component
* update product fixtures
* update collection and channel fixtures
* ChannelsAvailability - handle errors
* update product handlers
* update ChannelsAvailability styles
* update ProductVariant
* update snapshots
* fix missing things in multichannel (#785)
* add availability dropdown to discount products list
* fix error handling in shipping components
* update product views and components
* update messages
* update category view/components
* update CategoryProducts styles
* remove defaultCurrency from shipping components
* create ChannelsSelect component
* update channels error handling after review
* another fixes after review
* Add channels to collection views/components (#791)
** update collection components and views
* update create collection view
* update error handling in collection
* remove filter bar from collection list
* update products fragments
* small fix in collection create view
* use collectionFragment in useCatalogSearch
* update defaultMessages and snapshots
* update homepage view/drop defaultCurrency (#801)
* update homepage view
* drop defaultCurrency prop
* fix onChannelChange function in home view
* remove visibility from product list filters
* update export products with channels (#803)
* update ProductExportDialog with channels
* add new channel error code
* remover VISIBLE from product export dialog Financial information
* fix input size in ProductVariantCreatorSummary (#804)
* channels currency code select (#806)
* create select with currency codes
* fix ChannelDeleteDialog
* update defaultMessages, remove unneeded ChannelDetails handlers
* fixes after rebase
* replace channelListing with channelListings
* [multichannel] Update schema]
* Fix product create test
Co-authored-by: AlicjaSzu <alicja.szukuc@gmail.com>
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
2020-11-17 16:10:42 +00:00
|
|
|
permissions={[PermissionEnum.MANAGE_PRODUCTS]}
|
2020-07-14 08:11:43 +00:00
|
|
|
path="/product-types"
|
|
|
|
component={ProductTypesSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_STAFF]}
|
|
|
|
path="/staff"
|
|
|
|
component={StaffSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_STAFF]}
|
|
|
|
path="/permission-groups"
|
|
|
|
component={PermissionGroupSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_SETTINGS]}
|
|
|
|
path="/site-settings"
|
|
|
|
component={SiteSettingsSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_SETTINGS]}
|
|
|
|
path="/taxes"
|
|
|
|
component={TaxesSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_SHIPPING]}
|
|
|
|
path="/shipping"
|
|
|
|
component={ShippingSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_TRANSLATIONS]}
|
|
|
|
path="/translations"
|
|
|
|
component={TranslationsSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_MENUS]}
|
|
|
|
path={navigationSection}
|
|
|
|
component={NavigationSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
Multichannel (#833)
* add multichannel to configuration view
* create multichannels list view
* create multichannels list view
* add ChannelsCreate view
* update channels in configuration
* add stories
* update default messages
* fix ChannelForm props
* update channels list styles
* update snapshots
* update channel form currency input
* update Channels fragments
* extract messages
* remove tabs from channelsList
* channel details, channel delete modal (#598)
* create Channel details view
* create ChannelDeleteDialog
* add channels delete dialog to channels list
* update messages and types
* fixes after review
* channels availability (#609)
* create Channel details view
* update messages and types
* create ChannelsAvailability component
* create more product channels components
* create channels stories, update fixtures, types
* update product views with channels data
* update schema and snapshots
* update defaultMessages
* update ProductUpdate view
* create ChannelsAvailabilityDropdown component
* add product channels to local storage
* update globalTypes
* Update to new schema and resolve issues
* Update messages
* create deleteChannel mutation
* add channels availability component to product create view
* refactor ProductCreate and ProductUpdate views
* CollectionProducts view cleanup
* add disabled prop to ActionDialog
* use updateChannels mutation in ProductCreate view
* ProductCreate - update submit function
* fixes after review
* update snapshots and messages
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
* channels shipping components (#655)
* create PricingCard, OrderValue and OrderWeight components
* create ShippingZoneRatesPage and DeleteShippingRateDialog
* update ChannelsAvailability component
* updates after review
* channels shipping views (#662)
* update ChannelsAvailability component
* updates after review
* create PriceRate views, update types
* create weight rates views
* update shipping views, stories, messages
* update snapshots
* update snapshots
* update useChannels hook
* orders channels components (#698)
* create OrderChannelSectionCard component
* update OrderDetailsPage
* update DraftOrderChannelCard
* update snapshots
* update fixtures
* small change after review, update snapshots
* product pricing (#702)
* update product types
* update Pricing in simple product view
* use productVariantCreate mutation in simple product view
* update snapshots and messages
* handle create variant (#715)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update snapshots and messages
* fix update and create product handlers
* update pricing types
* channels modal - new styles, search input (#717)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* fix search input label styles
* update toggleAllChannels function
* update variant creator (#724)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* add channelLisitngs to variant creator
* update variant creator price styles
* update product variant creator reducer tests
* update createVariants tests
* update error handling in product variant creator
* add Skip pricing for now option
* use PriceField instead of TextField in ProductVariantCreatorSummary
* create price validation function
* fix errors handling in ProductVariantPrice component
* fixes after review
* Product List - remove publish/unpublish buttons (#727)
* ProductList - remove publish and unpublish buttons
* update messages
* update snapshots, messages
* revert changes in ChannelsAvailabilityDropdown
* products/shipping/discount list settings (#739)
* create ChannelSettingsDialog component
* update snapshots
* ProductList - open settings modal when there is no selected channel
* add settings modal to vouchers list
* add settings dialog to sales list
* add setting modal to shipping list
* update shipping
* update snapshots, messages
* useChannelsSettings - remove selectedChannelSlug
* fix channels update handler in product and shipping view
* messages update in ChannelSettingsDialog
* handle product/discount list when there is no channels
* update onSettingsOpen prop
* collection availability dropdown (#743)
* add availability dropdown to collection products list
* update channelListingProduct fragment name
* update voucher view/components with channels (#746)
* update voucher view/components with channels
* update VoucherSummary, remove defaultCurrency from voucher components
* update snapshots
* move getChannelsVariables func to discounts handlers
* update voucher messages
* sale view/components with channels (#750)
* update sale views with channels
* small fixes in discounts
* order views with channels (#752)
* update draft orders with channels
* add channel activate/deactivate mutations
* remove sort by total in orders list
* add error notification on channel activate/deactivate
* product variants channel select (#755)
* add channels selector to ProductVariants component
* remove selectedChannel from ProductUpdate, update messages and snapshots
* update product fragments
* update translations (#762)
* update translations
* fix translation types
* update messages
* update Availability component (#766)
* update ChannelsAvailability component
* update product fixtures
* update collection and channel fixtures
* ChannelsAvailability - handle errors
* update product handlers
* update ChannelsAvailability styles
* update ProductVariant
* update snapshots
* fix missing things in multichannel (#785)
* add availability dropdown to discount products list
* fix error handling in shipping components
* update product views and components
* update messages
* update category view/components
* update CategoryProducts styles
* remove defaultCurrency from shipping components
* create ChannelsSelect component
* update channels error handling after review
* another fixes after review
* Add channels to collection views/components (#791)
** update collection components and views
* update create collection view
* update error handling in collection
* remove filter bar from collection list
* update products fragments
* small fix in collection create view
* use collectionFragment in useCatalogSearch
* update defaultMessages and snapshots
* update homepage view/drop defaultCurrency (#801)
* update homepage view
* drop defaultCurrency prop
* fix onChannelChange function in home view
* remove visibility from product list filters
* update export products with channels (#803)
* update ProductExportDialog with channels
* add new channel error code
* remover VISIBLE from product export dialog Financial information
* fix input size in ProductVariantCreatorSummary (#804)
* channels currency code select (#806)
* create select with currency codes
* fix ChannelDeleteDialog
* update defaultMessages, remove unneeded ChannelDetails handlers
* fixes after rebase
* replace channelListing with channelListings
* [multichannel] Update schema]
* Fix product create test
Co-authored-by: AlicjaSzu <alicja.szukuc@gmail.com>
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
2020-11-17 16:10:42 +00:00
|
|
|
permissions={[PermissionEnum.MANAGE_PRODUCTS]}
|
2020-07-14 08:11:43 +00:00
|
|
|
path={attributeSection}
|
|
|
|
component={AttributeSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_APPS]}
|
|
|
|
path={appsSection}
|
|
|
|
component={AppsSection}
|
|
|
|
/>
|
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_PRODUCTS]}
|
|
|
|
path={warehouseSection}
|
|
|
|
component={WarehouseSection}
|
|
|
|
/>
|
Multichannel (#833)
* add multichannel to configuration view
* create multichannels list view
* create multichannels list view
* add ChannelsCreate view
* update channels in configuration
* add stories
* update default messages
* fix ChannelForm props
* update channels list styles
* update snapshots
* update channel form currency input
* update Channels fragments
* extract messages
* remove tabs from channelsList
* channel details, channel delete modal (#598)
* create Channel details view
* create ChannelDeleteDialog
* add channels delete dialog to channels list
* update messages and types
* fixes after review
* channels availability (#609)
* create Channel details view
* update messages and types
* create ChannelsAvailability component
* create more product channels components
* create channels stories, update fixtures, types
* update product views with channels data
* update schema and snapshots
* update defaultMessages
* update ProductUpdate view
* create ChannelsAvailabilityDropdown component
* add product channels to local storage
* update globalTypes
* Update to new schema and resolve issues
* Update messages
* create deleteChannel mutation
* add channels availability component to product create view
* refactor ProductCreate and ProductUpdate views
* CollectionProducts view cleanup
* add disabled prop to ActionDialog
* use updateChannels mutation in ProductCreate view
* ProductCreate - update submit function
* fixes after review
* update snapshots and messages
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
* channels shipping components (#655)
* create PricingCard, OrderValue and OrderWeight components
* create ShippingZoneRatesPage and DeleteShippingRateDialog
* update ChannelsAvailability component
* updates after review
* channels shipping views (#662)
* update ChannelsAvailability component
* updates after review
* create PriceRate views, update types
* create weight rates views
* update shipping views, stories, messages
* update snapshots
* update snapshots
* update useChannels hook
* orders channels components (#698)
* create OrderChannelSectionCard component
* update OrderDetailsPage
* update DraftOrderChannelCard
* update snapshots
* update fixtures
* small change after review, update snapshots
* product pricing (#702)
* update product types
* update Pricing in simple product view
* use productVariantCreate mutation in simple product view
* update snapshots and messages
* handle create variant (#715)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update snapshots and messages
* fix update and create product handlers
* update pricing types
* channels modal - new styles, search input (#717)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* fix search input label styles
* update toggleAllChannels function
* update variant creator (#724)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* add channelLisitngs to variant creator
* update variant creator price styles
* update product variant creator reducer tests
* update createVariants tests
* update error handling in product variant creator
* add Skip pricing for now option
* use PriceField instead of TextField in ProductVariantCreatorSummary
* create price validation function
* fix errors handling in ProductVariantPrice component
* fixes after review
* Product List - remove publish/unpublish buttons (#727)
* ProductList - remove publish and unpublish buttons
* update messages
* update snapshots, messages
* revert changes in ChannelsAvailabilityDropdown
* products/shipping/discount list settings (#739)
* create ChannelSettingsDialog component
* update snapshots
* ProductList - open settings modal when there is no selected channel
* add settings modal to vouchers list
* add settings dialog to sales list
* add setting modal to shipping list
* update shipping
* update snapshots, messages
* useChannelsSettings - remove selectedChannelSlug
* fix channels update handler in product and shipping view
* messages update in ChannelSettingsDialog
* handle product/discount list when there is no channels
* update onSettingsOpen prop
* collection availability dropdown (#743)
* add availability dropdown to collection products list
* update channelListingProduct fragment name
* update voucher view/components with channels (#746)
* update voucher view/components with channels
* update VoucherSummary, remove defaultCurrency from voucher components
* update snapshots
* move getChannelsVariables func to discounts handlers
* update voucher messages
* sale view/components with channels (#750)
* update sale views with channels
* small fixes in discounts
* order views with channels (#752)
* update draft orders with channels
* add channel activate/deactivate mutations
* remove sort by total in orders list
* add error notification on channel activate/deactivate
* product variants channel select (#755)
* add channels selector to ProductVariants component
* remove selectedChannel from ProductUpdate, update messages and snapshots
* update product fragments
* update translations (#762)
* update translations
* fix translation types
* update messages
* update Availability component (#766)
* update ChannelsAvailability component
* update product fixtures
* update collection and channel fixtures
* ChannelsAvailability - handle errors
* update product handlers
* update ChannelsAvailability styles
* update ProductVariant
* update snapshots
* fix missing things in multichannel (#785)
* add availability dropdown to discount products list
* fix error handling in shipping components
* update product views and components
* update messages
* update category view/components
* update CategoryProducts styles
* remove defaultCurrency from shipping components
* create ChannelsSelect component
* update channels error handling after review
* another fixes after review
* Add channels to collection views/components (#791)
** update collection components and views
* update create collection view
* update error handling in collection
* remove filter bar from collection list
* update products fragments
* small fix in collection create view
* use collectionFragment in useCatalogSearch
* update defaultMessages and snapshots
* update homepage view/drop defaultCurrency (#801)
* update homepage view
* drop defaultCurrency prop
* fix onChannelChange function in home view
* remove visibility from product list filters
* update export products with channels (#803)
* update ProductExportDialog with channels
* add new channel error code
* remover VISIBLE from product export dialog Financial information
* fix input size in ProductVariantCreatorSummary (#804)
* channels currency code select (#806)
* create select with currency codes
* fix ChannelDeleteDialog
* update defaultMessages, remove unneeded ChannelDetails handlers
* fixes after rebase
* replace channelListing with channelListings
* [multichannel] Update schema]
* Fix product create test
Co-authored-by: AlicjaSzu <alicja.szukuc@gmail.com>
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
2020-11-17 16:10:42 +00:00
|
|
|
<SectionRoute
|
|
|
|
permissions={[PermissionEnum.MANAGE_CHANNELS]}
|
|
|
|
path={channelsSection}
|
|
|
|
component={ChannelsSection}
|
|
|
|
/>
|
2020-07-14 08:11:43 +00:00
|
|
|
{createConfigurationMenu(intl).filter(menu =>
|
|
|
|
menu.menuItems.map(item => hasPermission(item.permission, user))
|
|
|
|
).length > 0 && (
|
|
|
|
<SectionRoute
|
|
|
|
exact
|
|
|
|
path="/configuration"
|
|
|
|
component={ConfigurationSection}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
<Route component={NotFound} />
|
|
|
|
</Switch>
|
|
|
|
</ErrorBoundary>
|
|
|
|
</AppLayout>
|
2020-11-23 09:39:24 +00:00
|
|
|
) : (isAuthenticated && !channel) || (hasToken && tokenVerifyLoading) ? (
|
2020-07-14 08:11:43 +00:00
|
|
|
<LoginLoading />
|
|
|
|
) : (
|
2020-07-21 16:49:20 +00:00
|
|
|
<Auth />
|
2020-07-14 08:11:43 +00:00
|
|
|
)}
|
2019-08-26 12:56:31 +00:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2019-06-19 14:40:52 +00:00
|
|
|
render(<App />, document.querySelector("#dashboard-app"));
|