Skip to content

Commit

Permalink
feat(Field): Add Rich text to field schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaledgarbaya committed Nov 8, 2018
1 parent a188371 commit 0bc8906
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ Creates a field with provided `id`.
- `Boolean`
- `Object`
- `Location`
- `RichText`
- `Array` (requires `items`)
- `Link` (requires `linkType`)
- **`items : Object`** _(required for type 'Array')_ – Defines the items of an Array field.
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface Movement {
afterField(field: string)
}

type FieldType = 'Symbol' | 'Text' | 'Integer' | 'Number' | 'Date' | 'Boolean' | 'Object' | 'Location' | 'Array' | 'Link'
type FieldType = 'Symbol' | 'Text' | 'Integer' | 'Number' | 'Date' | 'Boolean' | 'Object' | 'Location' | 'RichText' | 'Array' | 'Link'

export interface IFieldOptions {
newId?: string
Expand Down
3 changes: 2 additions & 1 deletion src/lib/offline-api/validator/schema/fields-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ const fieldSchema = Joi.object().keys({
'Object',
'Link',
'Array',
'Location'
'Location',
'RichText'
).required(),
linkType: enforceDependency({
valid: Joi.string().valid('Asset', 'Entry'),
Expand Down
2 changes: 1 addition & 1 deletion test/end-to-end/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ module.exports = {
},
propertyOneOf: function (prop, id) {
return result => {
const oneOf = '["Symbol", "Text", "Integer", "Number", "Date", "Boolean", "Object", "Link", "Array", "Location"]';
const oneOf = '["Symbol", "Text", "Integer", "Number", "Date", "Boolean", "Object", "Link", "Array", "Location", "RichText"]';
expect(result.code).to.eql(1);
expect(result.stdout).not.to.be.empty();
expect(result.stderr).not.to.be.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ describe('payload validation', function () {
'Date',
'Boolean',
'Object',
'Location'
'Location',
'RichText'
]

for (const type of types) {
Expand Down Expand Up @@ -97,7 +98,7 @@ describe('payload validation', function () {
.name('invalid')
}, [])

const valid = `["Symbol", "Text", "Integer", "Number", "Date", "Boolean", "Object", "Link", "Array", "Location"]`
const valid = `["Symbol", "Text", "Integer", "Number", "Date", "Boolean", "Object", "Link", "Array", "Location", "RichText"]`
expect(errors).to.eql([
[
{
Expand Down

0 comments on commit 0bc8906

Please sign in to comment.