Skip to content

Commit

Permalink
Support type wysiwyg instead of appearance param
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrebodin committed Jul 23, 2019
1 parent 3fdc149 commit 1dea89c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 50 deletions.
7 changes: 2 additions & 5 deletions cypress/fixtures/api/product.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
{
"name": "description",
"params": {
"type": "text",
"appearance": {
"WYSIWYG": false
}
"type": "text"
}
},
{
Expand Down Expand Up @@ -56,4 +53,4 @@
}
}
]
}
}
1 change: 1 addition & 0 deletions packages/strapi-hook-bookshelf/lib/buildDatabaseSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ const getType = ({ definition, attribute, name, tableExists = false }) => {
switch (attribute.type) {
case 'uuid':
return client === 'pg' ? 'uuid' : 'varchar(36)';
case 'wysiwyg':
case 'text':
return client === 'pg' ? 'text' : 'longtext';
case 'json':
Expand Down
1 change: 1 addition & 0 deletions packages/strapi-hook-mongoose/lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module.exports = (mongoose = Mongoose) => {
case 'password':
case 'string':
case 'text':
case 'wysiwyg':
return 'String';
default:
return undefined;
Expand Down
5 changes: 1 addition & 4 deletions packages/strapi-plugin-graphql/test/graphqlCrud.test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ const postModel = {
{
name: 'name',
params: {
appearance: {
WYSIWYG: false,
},
multiple: false,
type: 'string',
type: 'wysiwyg',
},
},
{
Expand Down
15 changes: 3 additions & 12 deletions packages/strapi-plugin-graphql/test/graphqlRelations.test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,15 @@ const documentModel = {
{
name: 'name',
params: {
appearance: {
WYSIWYG: false,
},
multiple: false,
type: 'string',
type: 'wysiwyg',
},
},
{
name: 'content',
params: {
appearance: {
WYSIWYG: true,
},
multiple: false,
type: 'text',
type: 'wysiwyg',
},
},
],
Expand All @@ -45,11 +39,8 @@ const labelModel = {
{
name: 'name',
params: {
appearance: {
WYSIWYG: false,
},
multiple: false,
type: 'string',
type: 'wysiwyg',
},
},
{
Expand Down
31 changes: 2 additions & 29 deletions test/helpers/generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@ module.exports = {
{
name: 'title',
params: {
appearance: {
WYSIWYG: false,
},
multiple: false,
type: 'string',
},
},
{
name: 'content',
params: {
appearance: {
WYSIWYG: true,
},
multiple: false,
type: 'text',
type: 'wysiwyg',
},
},
{
Expand All @@ -42,9 +36,6 @@ module.exports = {
{
name: 'name',
params: {
appearance: {
WYSIWYG: false,
},
multiple: false,
type: 'string',
},
Expand All @@ -69,9 +60,6 @@ module.exports = {
{
name: 'name',
params: {
appearance: {
WYSIWYG: false,
},
multiple: false,
type: 'string',
},
Expand All @@ -95,9 +83,6 @@ module.exports = {
{
name: 'name',
params: {
appearance: {
WYSIWYG: false,
},
multiple: false,
type: 'string',
},
Expand Down Expand Up @@ -128,29 +113,20 @@ module.exports = {
{
name: 'name',
params: {
appearance: {
WYSIWYG: false,
},
multiple: false,
type: 'string',
},
},
{
name: 'description',
params: {
appearance: {
WYSIWYG: true,
},
multiple: false,
type: 'text',
type: 'wysiwyg',
},
},
{
name: 'published',
params: {
appearance: {
WYSIWYG: false,
},
multiple: false,
type: 'boolean',
},
Expand All @@ -166,9 +142,6 @@ module.exports = {
{
name: 'title',
params: {
appearance: {
WYSIWYG: false,
},
multiple: false,
type: 'string',
},
Expand Down

0 comments on commit 1dea89c

Please sign in to comment.