@designcrowd/library.brand-page 6.2.2 → 6.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/{CreatedOnBrandCrowd-de-de-7P2gNr-R.js → CreatedOnBrandCrowd-de-de-Cn0M-eZ1.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-Dl7BymW6.js → CreatedOnBrandCrowd-en-us-DRLMSDZr.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-CO4FvWVw.js → CreatedOnBrandCrowd-es-es-BglTu73U.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DHNqakQu.js → CreatedOnBrandCrowd-fr-ca-Bj6YZ_el.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-DHNqakQu.js → CreatedOnBrandCrowd-fr-fr-Bj6YZ_el.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CGUC-ZbP.js → CreatedOnBrandCrowd-pt-br-DEoOmQ1F.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-CGUC-ZbP.js → CreatedOnBrandCrowd-pt-pt-DEoOmQ1F.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-Dvds-Vmy.js → CreatedOnDcom-de-de-BZ7gTt4Z.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-fd3C-8Tp.js → CreatedOnDcom-en-us-CD6Km5sH.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-DTXZW35-.js → CreatedOnDcom-es-es-CNpZHvEl.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-DRCYOKPs.js → CreatedOnDcom-fr-ca-URS-ydJ1.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DpIB8x2x.js → CreatedOnDcom-fr-fr-D2AVeA3H.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-Esnxy8wX.js → CreatedOnDcom-pt-br-C32frnFs.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-CaiVHFXR.js → CreatedOnDcom-pt-pt-TDYGjRXS.js} +1 -1
- package/lib/src/brand-page/models/brand-page-context.model.d.ts +0 -2
- package/lib/src/brand-page/models/brand-page-context.model.js +0 -12
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.js +0 -9
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/preview/Preview.mixin.d.ts +0 -14
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +0 -42
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-V7aqfuiB.js → lib-Dm9AuOJL.js} +10891 -10906
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +0 -42
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +0 -42
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +0 -42
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +0 -42
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +0 -56
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +0 -42
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +0 -42
- package/package.json +1 -1
- package/src/brand-page/models/brand-page-context.model.ts +0 -23
- package/src/brand-page-maker/components/action-bar/ActionBar.mixin.ts +0 -10
- package/src/brand-page-maker/components/action-bar/ActionBarNavigation.test.ts +8 -49
- package/src/brand-page-maker/components/action-bar/ActionBarNavigation.vue +1 -1
- package/src/shared/page-settings/store/page-settings-store.test.ts +0 -71
|
@@ -22,7 +22,6 @@ import { setLocaleAsync } from '@src/composables/useTranslate';
|
|
|
22
22
|
import { usePageNavigationStore } from '@src/shared/page-navigation/store/page-navigation-store';
|
|
23
23
|
import { useShopConfigStore } from '@shared/ecommerce-settings/store/shop-settings-store';
|
|
24
24
|
import { useEventTracker } from '@brand-page-maker/composables/useEventTracker';
|
|
25
|
-
import { useHistoryStore } from '@brand-page-maker/stores/history/history-store';
|
|
26
25
|
import { toPageModels } from '../utils';
|
|
27
26
|
|
|
28
27
|
vi.mock('../../../clients/brand-page-client', () => ({
|
|
@@ -678,53 +677,6 @@ describe('duplicatePage', () => {
|
|
|
678
677
|
).toBe(true);
|
|
679
678
|
});
|
|
680
679
|
|
|
681
|
-
test("deleting the copy's product leaves the source's product alone", async () => {
|
|
682
|
-
// The consequence the id rotation exists to prevent. `deleteProduct` filters
|
|
683
|
-
// the site-wide catalogue BY ID, so a copy that kept the source's ids would
|
|
684
|
-
// take the original's row down with it - silently, until the next save.
|
|
685
|
-
const { pageSettingsStore } = await initialiseAsync();
|
|
686
|
-
const shopConfigStore = useShopConfigStore();
|
|
687
|
-
|
|
688
|
-
const source = pageSettingsStore.addNewPage({ title: 'Shop' });
|
|
689
|
-
|
|
690
|
-
pageSettingsStore.setPageContents({
|
|
691
|
-
pageId: source.id,
|
|
692
|
-
contents: [
|
|
693
|
-
{
|
|
694
|
-
id: 'shop-1',
|
|
695
|
-
type: 'shop-section',
|
|
696
|
-
settings: {
|
|
697
|
-
content: {
|
|
698
|
-
id: 'shop-1',
|
|
699
|
-
type: 'shop-section',
|
|
700
|
-
products: [
|
|
701
|
-
{ id: 'product-1', name: 'Latte', variant: [], skus: [] },
|
|
702
|
-
],
|
|
703
|
-
shopPaymentConfig: { paymentConfig: { id: 'stripe-1' } },
|
|
704
|
-
},
|
|
705
|
-
},
|
|
706
|
-
} as unknown as ContentItem<Content>,
|
|
707
|
-
],
|
|
708
|
-
});
|
|
709
|
-
|
|
710
|
-
shopConfigStore.initialiseShopStore({
|
|
711
|
-
paymentConfig: { id: 'stripe-1' } as never,
|
|
712
|
-
pages: toPageModels(pageSettingsStore.pages) as never,
|
|
713
|
-
});
|
|
714
|
-
|
|
715
|
-
const copy = await pageSettingsStore.duplicatePage({ pageId: source.id });
|
|
716
|
-
|
|
717
|
-
const copyProductId = (
|
|
718
|
-
copy?.contents[0].settings.content as unknown as {
|
|
719
|
-
products: { id: string }[];
|
|
720
|
-
}
|
|
721
|
-
).products[0].id;
|
|
722
|
-
|
|
723
|
-
shopConfigStore.deleteProduct(copyProductId);
|
|
724
|
-
|
|
725
|
-
expect(shopConfigStore.products.map((p) => p.id)).toEqual(['product-1']);
|
|
726
|
-
});
|
|
727
|
-
|
|
728
680
|
test('adds the copy shop products to the site-wide catalogue', async () => {
|
|
729
681
|
// The catalogue is derived from the shop blocks and is what the save
|
|
730
682
|
// upserts. Without a re-derive the copy's fresh product ids never reach the
|
|
@@ -771,29 +723,6 @@ describe('duplicatePage', () => {
|
|
|
771
723
|
expect(shopConfigStore.paymentConfig?.id).toEqual('stripe-1');
|
|
772
724
|
});
|
|
773
725
|
|
|
774
|
-
test('undo removes both halves of a duplicate', async () => {
|
|
775
|
-
// duplicatePage writes to two stores - the page into page-settings, the
|
|
776
|
-
// route into page-navigation. A snapshot that caught only one would leave
|
|
777
|
-
// an orphan behind on undo.
|
|
778
|
-
const { pageSettingsStore, pageNavigationStore } = await initialiseAsync();
|
|
779
|
-
const historyStore = useHistoryStore();
|
|
780
|
-
|
|
781
|
-
const source = pageSettingsStore.addNewPage({ title: 'About' });
|
|
782
|
-
|
|
783
|
-
historyStore.captureBaseline();
|
|
784
|
-
|
|
785
|
-
const copy = await pageSettingsStore.duplicatePage({ pageId: source.id });
|
|
786
|
-
|
|
787
|
-
historyStore.capture({ source: 'manual_edit', actor: 'user' });
|
|
788
|
-
|
|
789
|
-
await historyStore.undo();
|
|
790
|
-
|
|
791
|
-
expect(pageSettingsStore.pages.map((p) => p.id)).not.toContain(copy?.id);
|
|
792
|
-
expect(pageNavigationStore.routes.some((r) => r.pageId === copy?.id)).toBe(
|
|
793
|
-
false,
|
|
794
|
-
);
|
|
795
|
-
});
|
|
796
|
-
|
|
797
726
|
test('is a no-op for an unknown page id', async () => {
|
|
798
727
|
const { pageSettingsStore } = await initialiseAsync();
|
|
799
728
|
|