DB rename blurImage to imageBlurred

This commit is contained in:
ogerly 2019-12-12 10:42:52 +01:00
parent a30a7ac8b0
commit a6cbbbeaf1
10 changed files with 38 additions and 38 deletions

View File

@ -39,6 +39,6 @@ module.exports = {
default: () => new Date().toISOString(),
},
language: { type: 'string', allow: [null] },
blurImage: { type: 'boolean', default: false },
imageBlurred: { type: 'boolean', default: false },
imageAspectRatio: { type: 'float', default: 1.0 },
}

View File

@ -316,7 +316,7 @@ export default {
'language',
'pinnedAt',
'pinned',
'blurImage',
'imageBlurred',
'imageAspectRatio',
],
hasMany: {

View File

@ -82,7 +82,7 @@ input _PostFilter {
emotions_none: _PostEMOTEDFilter
emotions_single: _PostEMOTEDFilter
emotions_every: _PostEMOTEDFilter
blurImage: Boolean
imageBlurred: Boolean
}
enum _PostOrdering {
@ -128,7 +128,7 @@ type Post {
createdAt: String
updatedAt: String
language: String
blurImage: Boolean
imageBlurred: Boolean
pinnedAt: String @cypher(
statement: "MATCH (this)<-[pinned:PINNED]-(:User) WHERE NOT this.deleted = true AND NOT this.disabled = true RETURN pinned.createdAt"
)
@ -184,7 +184,7 @@ type Mutation {
language: String
categoryIds: [ID]
contentExcerpt: String
blurImage: Boolean
imageBlurred: Boolean
imageAspectRatio: Float
): Post
UpdatePost(
@ -198,7 +198,7 @@ type Mutation {
visibility: Visibility
language: String
categoryIds: [ID]
blurImage: Boolean
imageBlurred: Boolean
imageAspectRatio: Float
): Post
DeletePost(id: ID!): Post
@ -220,7 +220,7 @@ type Query {
createdAt: String
updatedAt: String
language: String
blurImage: Boolean
imageBlurred: Boolean
first: Int
offset: Int
orderBy: [_PostOrdering]

View File

@ -352,7 +352,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
language: sample(languages),
image: faker.image.unsplash.food(300, 169),
categoryIds: ['cat16'],
blurImage: true,
imageBlurred: true,
imageAspectRatio: 300 / 169,
}),
factory.create('Post', {
@ -361,7 +361,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
language: sample(languages),
image: faker.image.unsplash.technology(300, 1500),
categoryIds: ['cat1'],
blurImage: false,
imageBlurred: false,
imageAspectRatio: 300 / 1500,
}),
factory.create('Post', {
@ -369,21 +369,21 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
id: 'p3',
language: sample(languages),
categoryIds: ['cat3'],
blurImage: false,
imageBlurred: false,
}),
factory.create('Post', {
author: dewey,
id: 'p4',
language: sample(languages),
categoryIds: ['cat4'],
blurImage: false,
imageBlurred: false,
}),
factory.create('Post', {
author: louie,
id: 'p5',
language: sample(languages),
categoryIds: ['cat5'],
blurImage: false,
imageBlurred: false,
}),
factory.create('Post', {
authorId: 'u1',
@ -391,7 +391,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
language: sample(languages),
image: faker.image.unsplash.buildings(300, 857),
categoryIds: ['cat6'],
blurImage: false,
imageBlurred: false,
imageAspectRatio: 300 / 857,
}),
factory.create('Post', {
@ -399,13 +399,13 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
id: 'p9',
language: sample(languages),
categoryIds: ['cat9'],
blurImage: false,
imageBlurred: false,
}),
factory.create('Post', {
author: dewey,
id: 'p10',
categoryIds: ['cat10'],
blurImage: true,
imageBlurred: true,
}),
factory.create('Post', {
author: louie,
@ -413,7 +413,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
language: sample(languages),
image: faker.image.unsplash.people(300, 901),
categoryIds: ['cat11'],
blurImage: false,
imageBlurred: false,
imageAspectRatio: 300 / 901,
}),
factory.create('Post', {
@ -421,7 +421,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
id: 'p13',
language: sample(languages),
categoryIds: ['cat13'],
blurImage: false,
imageBlurred: false,
}),
factory.create('Post', {
author: jennyRostock,
@ -429,7 +429,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
language: sample(languages),
image: faker.image.unsplash.objects(300, 200),
categoryIds: ['cat14'],
blurImage: false,
imageBlurred: false,
imageAspectRatio: 300 / 450,
}),
factory.create('Post', {
@ -437,7 +437,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
id: 'p15',
language: sample(languages),
categoryIds: ['cat15'],
blurImage: false,
imageBlurred: false,
}),
])
@ -456,7 +456,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
$title: String!
$content: String!
$categoryIds: [ID]
$blurImage: Boolean
$imageBlurred: Boolean
$imageAspectRatio: Float
) {
CreatePost(
@ -464,7 +464,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
title: $title
content: $content
categoryIds: $categoryIds
blurImage: $blurImage
imageBlurred: $imageBlurred
imageAspectRatio: $imageAspectRatio
) {
id
@ -480,7 +480,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
title: `Nature Philosophy Yoga`,
content: hashtag1,
categoryIds: ['cat2'],
blurImage: false,
imageBlurred: false,
imageAspectRatio: 300 / 200,
},
}),
@ -491,7 +491,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
title: 'This is post #7',
content: `${mention1} ${faker.lorem.paragraph()}`,
categoryIds: ['cat7'],
blurImage: false,
imageBlurred: false,
imageAspectRatio: 300 / 180,
},
}),
@ -503,7 +503,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
title: `Quantum Flow Theory explains Quantum Gravity`,
content: hashtagAndMention1,
categoryIds: ['cat8'],
blurImage: false,
imageBlurred: false,
imageAspectRatio: 300 / 900,
},
}),
@ -514,7 +514,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
title: 'This is post #12',
content: `${mention2} ${faker.lorem.paragraph()}`,
categoryIds: ['cat12'],
blurImage: false,
imageBlurred: false,
imageAspectRatio: 300 / 200,
},
}),

View File

@ -200,7 +200,7 @@ describe('ContributionForm.vue', () => {
imageUpload: null,
imageAspectRatio: null,
image: null,
blurImage: false,
imageBlurred: false,
},
}
postTitleInput = wrapper.find('.ds-input')

View File

@ -170,7 +170,7 @@ export default {
? languageOptions.find(o => this.contribution.language === o.value)
: null
form.categoryIds = this.categoryIds(this.contribution.categories)
form.checkbox = this.contribution.blurImage
form.checkbox = this.contribution.imageBlurred
}
return {
@ -234,7 +234,7 @@ export default {
language,
image,
imageUpload: teaserImage,
blurImage: this.blurImage,
imageBlurred: this.blurImage,
imageAspectRatio,
},
})

View File

@ -6,7 +6,7 @@
'post-card': true,
'disabled-content': post.disabled,
'--pinned': isPinned,
'--blur-image': post.blurImage,
'--blur-image': post.imageBlurred,
}"
>
<!-- Post Link Target -->

View File

@ -54,7 +54,7 @@ export const postFragment = lang => gql`
slug
image
language
blurImage
imageBlurred
author {
...user
}

View File

@ -9,7 +9,7 @@ export default () => {
$language: String
$categoryIds: [ID]
$imageUpload: Upload
$blurImage: Boolean
$imageBlurred: Boolean
$imageAspectRatio: Float
) {
CreatePost(
@ -18,7 +18,7 @@ export default () => {
language: $language
categoryIds: $categoryIds
imageUpload: $imageUpload
blurImage: $blurImage
imageBlurred: $imageBlurred
imageAspectRatio: $imageAspectRatio
) {
title
@ -26,7 +26,7 @@ export default () => {
content
contentExcerpt
language
blurImage
imageBlurred
}
}
`,
@ -39,7 +39,7 @@ export default () => {
$imageUpload: Upload
$categoryIds: [ID]
$image: String
$blurImage: Boolean
$imageBlurred: Boolean
$imageAspectRatio: Float
) {
UpdatePost(
@ -50,7 +50,7 @@ export default () => {
imageUpload: $imageUpload
categoryIds: $categoryIds
image: $image
blurImage: $blurImage
imageBlurred: $imageBlurred
imageAspectRatio: $imageAspectRatio
) {
id
@ -59,7 +59,7 @@ export default () => {
content
contentExcerpt
language
blurImage
imageBlurred
pinnedBy {
id
name

View File

@ -10,7 +10,7 @@
'--blur-image': blurred,
}"
>
<aside v-show="post.blurImage" class="blur-toggle">
<aside v-show="post.imageBlurred" class="blur-toggle">
<img v-show="blurred" :src="post.image | proxyApiUrl" class="preview" />
<ds-button :icon="blurred ? 'eye' : 'eye-slash'" primary @click="blurred = !blurred" />
</aside>
@ -139,7 +139,7 @@ export default {
Post(post) {
this.post = post[0] || {}
this.title = this.post.title
this.blurred = this.post.blurImage
this.blurred = this.post.imageBlurred
},
},
mounted() {