Skip to content

Commit 379f60f

Browse files
committed
add support for Ember Bootstrap <= 4.4
1 parent e8f3e2e commit 379f60f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
- ember-canary
6363
- ember-default-with-jquery
6464
- ember-classic
65+
- ember-bootstrap-4.4
6566
steps:
6667
- name: Checkout code
6768
uses: actions/checkout@v2

addon/components/bs-form/element.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { not, notEmpty, and, readOnly } from '@ember/object/computed';
2-
import { defineProperty } from '@ember/object';
2+
import { defineProperty, get } from '@ember/object';
33
import BsFormElement from 'ember-bootstrap/components/bs-form/element';
44

55
export default class ValidatedBsFormElement extends BsFormElement {
@@ -25,6 +25,10 @@ export default class ValidatedBsFormElement extends BsFormElement {
2525
warnings;
2626

2727
setupValidations() {
28-
defineProperty(this, '_attrValidations', readOnly(`args.model.validations.attrs.${this.args.property}`));
28+
if (typeof this.args === 'object') {
29+
defineProperty(this, '_attrValidations', readOnly(`args.model.validations.attrs.${this.args.property}`));
30+
} else {
31+
defineProperty(this, '_attrValidations', readOnly(`model.validations.attrs.${this.property}`));
32+
}
2933
}
3034
}

config/ember-try.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ module.exports = async function() {
7373
edition: 'classic'
7474
}
7575
}
76-
}
76+
},
77+
{
78+
name: 'ember-bootstrap-4.4',
79+
npm: {
80+
devDependencies: {
81+
'ember-bootstrap': '~4.4.0'
82+
}
83+
}
84+
},
7785
]
7886
};
7987
};

0 commit comments

Comments
 (0)