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

Fix/426 pictures are not shown in the right places #573

Merged
merged 35 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
669f243
fix: create new cms component
Michal-Dziedzinski Mar 19, 2020
b8cb334
Merge branch 'master' into fix/509-cms-two-columns-boxed
Michal-Dziedzinski Mar 19, 2020
53958b3
fix: remove ::v-deep directive
Michal-Dziedzinski Mar 19, 2020
72810a3
fix: fix different cms looks
Michal-Dziedzinski Mar 23, 2020
00d63a4
fix: tests added
Michal-Dziedzinski Mar 25, 2020
3ca4ab2
Merge branch 'master' into fix/509-cms-two-columns-boxed
Michal-Dziedzinski Mar 26, 2020
565ccb6
fix: add SwImageTwoColumn component
Michal-Dziedzinski Mar 30, 2020
0024b71
fix: add SwImageThreeColumn component
Michal-Dziedzinski Mar 30, 2020
ab758d7
fix: add SwImageThreeColumn component
Michal-Dziedzinski Mar 30, 2020
d310609
fix: add SwImageFourColumn component
Michal-Dziedzinski Mar 30, 2020
47a584e
fix: add SwImageHighLightRow component
Michal-Dziedzinski Mar 30, 2020
d2a33c1
fix: fix SwImageBubbleRow component
Michal-Dziedzinski Mar 31, 2020
7529ff5
fix: add SwImageSimpleGrid component
Michal-Dziedzinski Mar 31, 2020
822da4c
fix: add SwCenterText component
Michal-Dziedzinski Mar 31, 2020
331907e
fix: add unit tests
Michal-Dziedzinski Mar 31, 2020
9cc48d6
Merge branch 'master' into fix/426-pictures-are-not-shown-in-the-righ…
Michal-Dziedzinski Mar 31, 2020
0a722e4
fix: remove console.log
Michal-Dziedzinski Mar 31, 2020
e9e6195
fix: fix lint scripts and use prettier
Michal-Dziedzinski Apr 1, 2020
cf911fa
fix: add js notes to public interfaces, enums and functions
Michal-Dziedzinski Apr 1, 2020
2c81ee7
fix: changed md files
Michal-Dziedzinski Apr 1, 2020
897e343
Merge branch 'master' into fix/426-pictures-are-not-shown-in-the-righ…
Michal-Dziedzinski Apr 6, 2020
382c35a
fix: add SwImageTextCover
Michal-Dziedzinski Apr 6, 2020
7f87e46
Merge branch 'master' into fix/426-pictures-are-not-shown-in-the-righ…
Michal-Dziedzinski Apr 8, 2020
330a258
fix: set fixed height of images
Michal-Dziedzinski Apr 10, 2020
7ae691e
Merge branch 'master' into fix/426-pictures-are-not-shown-in-the-righ…
Michal-Dziedzinski Apr 10, 2020
f2f51fc
Merge branch 'master' into fix/426-pictures-are-not-shown-in-the-righ…
patzick Apr 15, 2020
d449c1f
Merge branch 'master' into fix/426-pictures-are-not-shown-in-the-righ…
Michal-Dziedzinski Apr 27, 2020
ff327e1
fix: update cms blocks after cms structure changes
Michal-Dziedzinski Apr 28, 2020
5f374bc
Merge branch 'master' into fix/426-pictures-are-not-shown-in-the-righ…
Michal-Dziedzinski Apr 28, 2020
fddd5e6
fix: fix height styles, improve html structure
Michal-Dziedzinski Apr 29, 2020
606ce69
Merge branch 'fix/426-pictures-are-not-shown-in-the-right-places' of …
Michal-Dziedzinski Apr 29, 2020
7489892
fix: include desktop-size mixin
Michal-Dziedzinski Apr 29, 2020
ebd9283
fix: add boxed size as modifikator for section default
Michal-Dziedzinski Apr 29, 2020
4c13663
Merge branch 'master' into fix/426-pictures-are-not-shown-in-the-righ…
patzick Apr 29, 2020
0837433
Apply suggestions from code review
patzick Apr 29, 2020
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dev:debug": "node --inspect scripts/dev.js",
"build": "node scripts/build.js",
"postinstall": "node scripts/linkDependencies.js && lerna link",
"lint": "prettier --write --parser typescript 'packages/**/*.ts'",
"lint": "prettier --write --parser typescript \"packages/**/*.ts\"",
"test": "jest",
"test:e2e": "jest --e2e=true --runInBand",
"test:cypress": "cypress run",
Expand Down
12 changes: 12 additions & 0 deletions packages/commons/interfaces/models/content/cms/CmsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,31 @@ export interface CmsBlock {
slots: CmsSlot[];
}

/**
* @alpha
*/
export enum SectionType {
DEFAULT = "default",
}

/**
* @alpha
*/
export enum SizingMode {
BOXED = "boxed",
}

/**
* @alpha
*/
export enum MobileBehavior {
BOXED = "boxed",
WRAP = "wrap",
}

/**
* @alpha
*/
export enum BackgroundMediaMode {
COVER = "cover",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,4 @@ export default {
</script>

<style lang="scss" scoped>
@import '../settings.scss';

.cms-block-category-navigation {
@include desktop-size;
}
</style>
64 changes: 64 additions & 0 deletions packages/default-theme/cms/blocks/CmsBlockCenterText.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<template>
<article class="cms-block-center-text">
<CmsGenericElement :content="getLeftContent" class="cms-block-center-text__image"/>
<CmsGenericElement :content="getCenterContent" class="cms-block-center-text__text"/>
<CmsGenericElement :content="getRightContent" class="cms-block-center-text__image"/>
</article>
</template>

<script>
import CmsGenericElement from 'sw-cms/CmsGenericElement'

export default {
name: 'CmsBlockCenterText',
components: {
CmsGenericElement
},
props: {
content: {
type: Object,
default: () => ({})
}
},
computed: {
getSlots() {
return this.content.slots || []
},
getLeftContent() {
return this.getSlots.find(({slot}) => slot === 'left')
},
getCenterContent() {
return this.getSlots.find(({slot}) => slot === 'center')
},
getRightContent() {
return this.getSlots.find(({slot}) => slot === 'right')
},
}
};
</script>

<style lang="scss">
@import '~@storefront-ui/vue/styles.scss';

.cms-block-center-text {
display: flex;
flex-direction: column;

&__image, &__text {
margin: var(--spacer-sm);
flex: 1;
& img {
height: 340px;
object-fit: cover;
width: 100%;
}
}

@include for-desktop {
flex-direction: row;
justify-content: space-around;
align-items: center;
}
}

</style>
2 changes: 1 addition & 1 deletion packages/default-theme/cms/blocks/CmsBlockDefault.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ export default {
@import '../settings.scss';

.cms-block-default {
@include desktop-size;
@include sizing-mode-boxed;
}
</style>
12 changes: 6 additions & 6 deletions packages/default-theme/cms/blocks/CmsBlockImageBubbleRow.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="cms-block-image-bubble-row">
<article class="cms-block-image-bubble-row">
<CmsGenericElement
:content="getLeftContent"
class="cms-block-image-bubble-row__image"
Expand All @@ -12,17 +12,17 @@
:content="getRightContent"
class="cms-block-image-bubble-row__image"
/>
</div>
</article>
</template>

<script>
import CmsGenericElement from 'sw-cms/CmsGenericElement'

export default {
name: 'CmsBlockImageBubbleRow',
components: {
CmsGenericElement,
},
name: 'CmsBlockImageBubbleRow',
props: {
content: {
type: Object,
Expand All @@ -34,13 +34,13 @@ export default {
return this.content.slots || []
},
getLeftContent() {
return this.getSlots.find((element) => element.slot === 'left')
return this.getSlots.find(({slot}) => slot === 'left')
},
getCenterContent() {
return this.getSlots.find((element) => element.slot === 'center')
return this.getSlots.find(({slot}) => slot === 'center')
},
getRightContent() {
return this.getSlots.find((element) => element.slot === 'right')
return this.getSlots.find(({slot}) => slot === 'right')
},
},
}
Expand Down
6 changes: 2 additions & 4 deletions packages/default-theme/cms/blocks/CmsBlockImageCover.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="cms-block-image-cover">
<article class="cms-block-image-cover">
<CmsGenericElement v-if="getContent" :content="getContent" />
</div>
</article>
</template>

<script>
Expand Down Expand Up @@ -30,7 +30,5 @@ export default {
</script>

<style lang="scss" scoped>
@import '../settings.scss';


</style>
68 changes: 68 additions & 0 deletions packages/default-theme/cms/blocks/CmsBlockImageFourColumn.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<template>
<article class="cms-block-image-four-column">
<CmsGenericElement :content="getLeftContent" class="cms-block-image-four-column__image"/>
<CmsGenericElement :content="getCenterLeftContent" class="cms-block-image-four-column__image"/>
<CmsGenericElement :content="getCenterRightContent" class="cms-block-image-four-column__image"/>
<CmsGenericElement :content="getRightContent" class="cms-block-image-four-column__image"/>
</article>
</template>

<script>
import CmsGenericElement from 'sw-cms/CmsGenericElement'

export default {
name: 'CmsBlockImageFourColumn',
components: {
CmsGenericElement,
},
props: {
content: {
type: Object,
default: () => ({})
}
},
computed: {
getSlots() {
return this.content.slots || []
},
getLeftContent() {
return this.getSlots.find(({slot}) => slot === 'left')
},
getCenterLeftContent() {
return this.getSlots.find(({slot}) => slot === 'center-left')
},
getCenterRightContent() {
return this.getSlots.find(({slot}) => slot === 'center-right')
},
getRightContent() {
return this.getSlots.find(({slot}) => slot === 'right')
},
}
};
</script>

<style lang="scss">
@import '~@storefront-ui/vue/styles.scss';

.cms-block-image-four-column {
display: flex;
flex-direction: column;

&__image {
margin: var(--spacer-sm);
flex: 1;
& img {
height: 340px;
object-fit: cover;
width: 100%;
}
}

@include for-desktop {
flex-direction: row;
justify-content: space-around;
align-items: center;
}
}

</style>
65 changes: 65 additions & 0 deletions packages/default-theme/cms/blocks/CmsBlockImageHighlightRow.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<template>
<article class="cms-block-image-highlight-row">
<CmsGenericElement :content="getLeftContent" class="cms-block-image-highlight-row__image"/>
<CmsGenericElement :content="getCenterContent" class="cms-block-image-highlight-row__image"/>
<CmsGenericElement :content="getRightContent" class="cms-block-image-highlight-row__image"/>
</article>
</template>

<script>
import CmsGenericElement from 'sw-cms/CmsGenericElement'

export default {
name: 'CmsBlockImageHighlightRow',
components: {
CmsGenericElement,
},
props: {
content: {
type: Object,
default: () => ({})
}
},
computed: {
getSlots() {
return this.content.slots || []
},
getLeftContent() {
return this.getSlots.find(({slot}) => slot === 'left')
},
getCenterContent() {
return this.getSlots.find(({slot}) => slot === 'center')
},
getRightContent() {
return this.getSlots.find(({slot}) => slot === 'right')
},
},
};
</script>

<style lang="scss">
@import '~@storefront-ui/vue/styles.scss';

.cms-block-image-highlight-row {
display: flex;
flex-direction: column;

&__image {
margin: var(--spacer-sm);
flex: 1;
border: 12px solid #fff;
& img {
height: 340px;
object-fit: cover;
width: 100%;
}
}

@include for-desktop {
flex-direction: row;
justify-content: space-around;
align-items: center;
}
}

</style>
Loading