Skip to content

Commit

Permalink
Merge branch 'main' into customization/blaze_slider
Browse files Browse the repository at this point in the history
  • Loading branch information
aoltean-plenty authored Jan 15, 2025
2 parents bec15a5 + 40fb275 commit ecadc33
Show file tree
Hide file tree
Showing 46 changed files with 319 additions and 297 deletions.
2 changes: 1 addition & 1 deletion apps/web/__tests__/support/failOnError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Cypress.on("window:before:load", (win) => {
})
});

Cypress.on('uncaught:exception', (err, runnable) => {
Cypress.on('uncaught:exception', (err) => {
if (ignoreErrors.some(ignore => err.message.includes(ignore) || err.stack?.includes(ignore))) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/__tests__/support/pageObjects/CartPageObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class CartPageObject extends PageObject {
}

checkCart() {
cy.getFixture('products').then((fixture) => {
cy.getFixture('products').then(() => {
this.assertCartPreviewElements();
});
}
Expand Down
10 changes: 7 additions & 3 deletions apps/web/__tests__/support/pageObjects/CategoryObject.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { PageObject } from "./PageObject";

export class CategoryPageObject extends PageObject {
get filterClickShouldReloadCategory() {
get categoryFilter() {
return cy.getByTestId('category-filter-0');
}

filterClickShouldReloadCategory = () => {
cy.intercept('/plentysystems/getFacet').as('getFacet');
cy.getByTestId('category-filter-0').first().click();

this.categoryFilter.first().click();
cy.wait('@getFacet').its('response.statusCode').should('eq', 200)
return this;
}
}
2 changes: 1 addition & 1 deletion apps/web/__tests__/support/pageObjects/CookieBarObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class CookieBarObject extends PageObject {
}

checkExternalScript() {
return cy.document().then((doc) => {
return cy.document().then(() => {
document.head.innerHTML.includes('test-cookie-external-script.js')
})
}
Expand Down
32 changes: 0 additions & 32 deletions apps/web/__tests__/support/pageObjects/LoginPageObject.ts

This file was deleted.

49 changes: 0 additions & 49 deletions apps/web/__tests__/support/pageObjects/PasswordPageObject.ts

This file was deleted.

18 changes: 0 additions & 18 deletions apps/web/__tests__/support/pageObjects/SignupPageObject.ts

This file was deleted.

8 changes: 2 additions & 6 deletions apps/web/__tests__/test/feature/languageSelect.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,12 @@ describe('Feature: Language Selector', () => {
});

function setMobileState(
url: string = paths.home,
width: number = 390,
height: number = 844,
acceptCookie = true
) {
cy.visitAndHydrate(paths.home);
cy.viewport(width, height)

if (acceptCookie) {
cookieBar.acceptAll();
}

cookieBar.acceptAll();
}
});
2 changes: 1 addition & 1 deletion apps/web/__tests__/test/smoke/categoryPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Smoke: Category Page', () => {
// This way we are independet from the language and the url.
cy.visitAndHydrate('/living-room');

category.filterClickShouldReloadCategory;
category.filterClickShouldReloadCategory();
})

it('[smoke] Category should load DE SSR on first visit where there are no browser cookies', () => {
Expand Down
29 changes: 0 additions & 29 deletions apps/web/__tests__/test/smoke/loginPage.cy.ts

This file was deleted.

26 changes: 0 additions & 26 deletions apps/web/__tests__/test/smoke/passwordPage.cy.ts

This file was deleted.

12 changes: 0 additions & 12 deletions apps/web/__tests__/test/smoke/signupPage.cy.ts

This file was deleted.

19 changes: 11 additions & 8 deletions apps/web/components/Editor/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

<script setup lang="ts">
import { SfIconCancel } from '@storefront-ui/vue';
import { watchDebounced } from '@vueuse/core';
const props = defineProps<{
block: Block | null;
Expand All @@ -37,17 +38,19 @@ const { jsonText, errorMessage, lineCount, textarea, lineNumberContainer, syncSc
JSON.stringify(props.block, null, 2),
);
watch(
() => props.block,
(updatedData) => {
jsonText.value = JSON.stringify(updatedData, null, 2);
},
{ immediate: true, deep: true },
);
const closeEditor = () => {
emit('update', props.index, JSON.parse(jsonText.value));
const { isEditing } = useEditor();
isEditing.value = false;
};
watchDebounced(
() => jsonText.value,
() => {
if (jsonText.value !== '') {
emit('update', props.index, JSON.parse(jsonText.value));
}
},
{ debounce: 100 },
);
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</h2>
<div v-if="text?.subtitle" class="text-2xl pb-1">{{ text.subtitle }}</div>
<div
class="typography-text-sm md:typography-text-lg font-normal"
v-if="text?.htmlDescription"
class="typography-text-sm md:typography-text-lg font-normal"
v-html="text.htmlDescription"
></div>
<ProductSlider v-if="recommendedProducts?.length" :items="recommendedProducts" />
Expand Down
38 changes: 38 additions & 0 deletions apps/web/components/TextContent/TextContent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template>
<div :class="['w-full', 'space-y-4', textAlignmentClass]">
<div v-if="text?.pretitle" class="text-xl font-bold mb-2">{{ text.pretitle }}</div>
<h2 v-if="text?.title" class="text-2xl font-semibold mb-4">{{ text.title }}</h2>
<div v-if="text?.subtitle" class="text-lg font-semibold">{{ text.subtitle }}</div>
<div v-if="text?.htmlDescription" class="text-base" v-html="text.htmlDescription" />
<UiButton
v-if="button?.label && button?.link"
:tag="NuxtLink"
:to="localePath(button?.link ?? '')"
:variant="button?.variant ?? 'primary'"
class="mt-3 px-4 py-2"
>
{{ button?.label }}
</UiButton>
</div>
</template>

<script setup lang="ts">
import { defineProps, computed } from 'vue';
import type { TextContentProps } from '~/components/TextContent/types';
const props = defineProps<TextContentProps>();
const localePath = useLocalePath();
const NuxtLink = resolveComponent('NuxtLink');
const textAlignmentClass = computed(() => {
switch (props.text?.textAlignment) {
case 'center':
return 'text-center items-center';
case 'right':
return 'text-right items-end';
default:
return 'text-left items-start';
}
});
</script>
14 changes: 14 additions & 0 deletions apps/web/components/TextContent/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type TextContentProps = {
text?: {
pretitle?: string;
title?: string;
subtitle?: string;
htmlDescription?: string;
textAlignment?: 'left' | 'center' | 'right';
};
button?: {
label?: string;
link?: string;
variant?: 'primary' | 'secondary';
};
};
4 changes: 2 additions & 2 deletions apps/web/components/ui/AccordionItem/AccordionItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<slot name="summary">
<p>{{ summary }}</p>
</slot>
<SfIconChevronLeft :class="['text-neutral-500', modelValue ? 'rotate-90' : '-rotate-90']" />
<SfIconChevronLeft :class="['text-neutral-500', internalModelValue ? 'rotate-90' : '-rotate-90']" />
</template>
<div class="py-2 px-4">
<slot />
Expand All @@ -18,7 +18,7 @@ import { useVModel } from '@vueuse/core';
import type { AccordionItemProps } from '~/components/ui/AccordionItem/types';
const props = defineProps<AccordionItemProps>();
const { modelValue = false, summary = '', summaryClass = '' } = props;
const { summary = '', summaryClass = '' } = props;
const emit = defineEmits(['update:modelValue']);
const internalModelValue = useVModel(props, 'modelValue', emit, { passive: true });
Expand Down
Loading

0 comments on commit ecadc33

Please sign in to comment.