Skip to content

Commit

Permalink
[xprototype#50/feature] Update examples to interact with the new tabs…
Browse files Browse the repository at this point in the history
… feature

> current branch: master, issue link: xprototype#50
src/domains/Example/Test/Prototype/Test.js
src/domains/Example/Test/en-us.js
src/domains/Example/TestWithHooks/Prototype/TestWithHooks.js
  • Loading branch information
wilcorrea committed May 11, 2019
1 parent d602386 commit a43495b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/domains/Example/Test/Prototype/Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export default class Test extends Prototype {
*/
displayKey = 'name'

/**
* @type {string}
*/
grouping = 'tabs'

/**
* @type {TestService}
*/
Expand All @@ -35,9 +40,15 @@ export default class Test extends Prototype {
* Test constructor.
*/
construct () {
this.section('primaryKey')
this.section('personal')
this.section('extra')

this.fieldAsPrimaryKey()
.fieldSection('primaryKey')

this.addField('name')
.fieldSection('personal')
.fieldTableShow()
.fieldFormWidth(50)
.fieldFormAutofocus()
Expand All @@ -46,11 +57,13 @@ export default class Test extends Prototype {
})

this.addField('age')
.fieldSection('personal')
.fieldIsNumber()
.fieldRequired()
.fieldFormWidth(50)

this.addField('description')
.fieldSection('extra')
.fieldIsText()

this.action('edit')
Expand Down
5 changes: 5 additions & 0 deletions src/domains/Example/Test/en-us.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export default {
table: {
title: ''
},
sections: {
primaryKey: 'Primary Key',
personal: 'Personal',
extra: 'Extra'
},
fields: {
id: 'Id',
name: 'Name',
Expand Down
5 changes: 5 additions & 0 deletions src/domains/Example/TestWithHooks/Prototype/TestWithHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ export default class TestWithHooks extends Test {
*/
static domain = 'example.test'

/**
* @type {string}
*/
grouping = 'sections'

/**
* TestWithHooks constructor.
*/
Expand Down

0 comments on commit a43495b

Please sign in to comment.