Skip to content

Commit

Permalink
Merge pull request #1 from lypborges/greenkeeper/initial
Browse files Browse the repository at this point in the history
Update dependencies to enable Greenkeeper 🌴
  • Loading branch information
lypborges authored Jun 12, 2018
2 parents 8c5af2a + 6330f79 commit 55a2f6d
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 169 deletions.
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 10.4.0
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "4"
- "8"

sudo: false
dist: trusty
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Quickstart
==============================================================================

[![Greenkeeper badge](https://badges.greenkeeper.io/lypborges/ui-components.svg)](https://greenkeeper.io/)

This addon is a wrapper from other addons that have solved some complex UI components that almost all application needs. You can see the list in the todo section.
So to keep consistence over any other application we have created this addon to expose and include the most common used components

Expand Down
3 changes: 3 additions & 0 deletions addon/components/ui-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export default Component.extend({
init() {
this._super(...arguments);
this.setDefaultActions();
this.set('locale', 'en');
this.set('altFormat','Y-m-d');

},
setDefaultActions(){
let onChange = this.get('onChange');
Expand Down
2 changes: 2 additions & 0 deletions addon/components/ui-daterange.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export default Component.extend({
this._super(...arguments);
this.setDefaultActions();
this.set('mode',"range");
this.set('locale', 'en');
this.set('altFormat','Y-m-d');
},
setDefaultActions(){
let onChange = this.get('onChange');
Expand Down
16 changes: 15 additions & 1 deletion addon/components/ui-multi-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,19 @@ import Component from '@ember/component';
import layout from '../templates/components/ui-multi-select';

export default Component.extend({
layout
layout,
init() {
this._super(...arguments);
this.setDefaultActions();
},
setDefaultActions(){
let onChange = this.get('onChange');
let defaultOnChange = this.get('defaultOnChange');
if (!onChange) {
this.set('onChange', defaultOnChange);
}
},
defaultOnChange(selected) {
this.set('selected', selected);
}
});
14 changes: 14 additions & 0 deletions addon/components/ui-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,18 @@ import layout from '../templates/components/ui-select';

export default Component.extend({
layout,
init() {
this._super(...arguments);
this.setDefaultActions();
},
setDefaultActions(){
let onChange = this.get('onChange');
let defaultOnChange = this.get('defaultOnChange');
if (!onChange) {
this.set('onChange', defaultOnChange);
}
},
defaultOnChange(selected) {
this.set('selected', selected);
}
});
10 changes: 6 additions & 4 deletions addon/components/ui-table/ui-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ export default Component.extend({

fetchRecords: task(function*() {
let url = this.get('modelName');
let records = yield this.get('store').query(url, this.getProperties(['page', 'limit', 'sort', 'dir']));
this.get('model').pushObjects(records.toArray());
this.set('meta', records.get('meta'));
this.set('canLoadMore', !isEmpty(records));
if (url) {
let records = yield this.get('store').query(url, this.getProperties(['page', 'limit', 'sort', 'dir']));
this.get('model').pushObjects(records.toArray());
this.set('meta', records.get('meta'));
this.set('canLoadMore', !isEmpty(records));
}
}).restartable(),

loadMore: task(function*(){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"ember-data": "^3.1.1",
"ember-disable-prototype-extensions": "^1.1.2",
"ember-export-application-global": "^2.0.0",
"ember-fetch": "^4.0.1",
"ember-fetch": "^5.0.0",
"ember-flatpickr": "^2.5.0",
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
Expand Down
8 changes: 0 additions & 8 deletions tests/integration/components/ui-button-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,5 @@ module('Integration | Component | ui-button', function(hooks) {

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#ui-button}}
template block text
{{/ui-button}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
});
});
12 changes: 2 additions & 10 deletions tests/integration/components/ui-datepicker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,10 @@ module('Integration | Component | ui-datepicker', function(hooks) {
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });

await render(hbs`{{ui-datepicker}}`);
this.set('date', '2018-10-09')
await render(hbs`{{ui-datepicker dateValue=date}}`);

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#ui-datepicker}}
template block text
{{/ui-datepicker}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
});
});
12 changes: 2 additions & 10 deletions tests/integration/components/ui-daterange-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,10 @@ module('Integration | Component | ui-daterange', function(hooks) {
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });

await render(hbs`{{ui-daterange}}`);
this.set('date', '2018-10-09')
await render(hbs`{{ui-daterange dateValue=date}}`);

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#ui-daterange}}
template block text
{{/ui-daterange}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
});
});
8 changes: 0 additions & 8 deletions tests/integration/components/ui-input-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,5 @@ module('Integration | Component | ui-input', function(hooks) {

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#ui-input}}
template block text
{{/ui-input}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
});
});
8 changes: 0 additions & 8 deletions tests/integration/components/ui-multi-select-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,5 @@ module('Integration | Component | ui-multi-select', function(hooks) {

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#ui-multi-select}}
template block text
{{/ui-multi-select}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
});
});
8 changes: 0 additions & 8 deletions tests/integration/components/ui-select-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,5 @@ module('Integration | Component | ui-select', function(hooks) {

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#ui-select}}
template block text
{{/ui-select}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
});
});
8 changes: 0 additions & 8 deletions tests/integration/components/ui-table-loader-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,5 @@ module('Integration | Component | ui-table-loader', function(hooks) {

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#ui-table-loader}}
template block text
{{/ui-table-loader}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
});
});
21 changes: 10 additions & 11 deletions tests/integration/components/ui-table-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ module('Integration | Component | ui-table', function(hooks) {
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
let columns = [{
label: 'First Name',
valuePath: 'firstName',
}, {
label: 'Last Name',
valuePath: 'lastName',
}]
this.set('columns', columns);
await render(hbs`{{ui-table columns=columns}}`);

await render(hbs`{{ui-table}}`);
assert.equal(this.element.querySelectorAll('th').length, 2);

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#ui-table}}
template block text
{{/ui-table}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
});
});
Loading

0 comments on commit 55a2f6d

Please sign in to comment.