Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Ember 3.13 (redux) #668

Merged
merged 3 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions addon/-private/ember-internals.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import Ember from 'ember';
import { A } from '@ember/array';

let __EMBER_METAL__;
if (Ember.__loader.registry['@ember/-internals/metal']) {
__EMBER_METAL__ = Ember.__loader.require('@ember/-internals/metal');
let emberMetalPaths = [
'@ember/-internals/metal', // ember-source from 3.10
'@ember/-internals/metal/index' // ember-source from 3.13
];
let metalPath = A(emberMetalPaths).find(path => Ember.__loader.registry[path]);
if (metalPath) {
__EMBER_METAL__ = Ember.__loader.require(metalPath);
}

export function getDependentKeys(descriptorOrDecorator) {
if (__EMBER_METAL__ && __EMBER_METAL__.descriptorForDecorator) {
let descriptor = __EMBER_METAL__.descriptorForDecorator(
descriptorOrDecorator
);
return descriptor._dependentKeys;
return descriptor._dependentKeys || [descriptor.altKey];
} else {
return descriptorOrDecorator._dependentKeys;
}
Expand Down
2 changes: 2 additions & 0 deletions addon/validations/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ function getCPDependentKeysFor(attribute, model, validations) {
dependentKeys.push('model.isDeleted');
}

dependentKeys = dependentKeys.filter(dependentKey => !!dependentKey);
offirgolan marked this conversation as resolved.
Show resolved Hide resolved

dependentKeys = dependentKeys.map(d => {
return d.replace(/^model\./, `${ATTRS_MODEL}.`);
});
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"babel-eslint": "^8.2.6",
"bootstrap-sass": "^3.3.7",
"broccoli-asset-rev": "^2.7.0",
"ember-bootstrap": "^1.2.2",
"ember-cli": "~3.6.1",
"ember-bootstrap": "3.0.0-rc.3",
"ember-cli": "~3.12.0",
"ember-cli-app-version": "^3.1.3",
"ember-cli-autoprefixer": "^0.7.0",
"ember-cli-changelog": "0.3.4",
Expand Down Expand Up @@ -61,7 +61,7 @@
"ember-qunit": "^3.4.1",
"ember-qunit-nice-errors": "^1.2.0",
"ember-resolver": "^5.0.1",
"ember-source": "~3.8.0",
"ember-source": "~3.13.0",
"ember-source-channel-url": "^1.1.0",
"ember-test-selectors": "^0.3.8",
"ember-truth-helpers": "2.0.0",
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/validations/factory-general-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import DefaultMessages from 'dummy/validators/messages';
import PresenceValidator from 'dummy/validators/presence';
import LengthValidator from 'dummy/validators/length';
import { validator, buildValidations } from 'ember-cp-validations';
import { module, test } from 'qunit';
import { module, test, skip } from 'qunit';
import { setupTest } from 'ember-qunit';
import { ATTRS_MODEL } from 'ember-cp-validations/-private/symbols';

Expand Down Expand Up @@ -1040,7 +1040,8 @@ module('Integration | Validations | Factory - General', function(hooks) {
assert.equal(child.get('validations.errors.length'), 1);
});

test('call super in validations class with no super property', function(assert) {
// https://github.com/offirgolan/ember-cp-validations/pull/656
skip('call super in validations class with no super property', function(assert) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we not want to address this before moving forward here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision from @offirgolan was to skip for now. At this point getting this updated for Ember 3.13 is getting past critical as it's a blocker for many apps to provide feedback on the Octane beta.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay... I would just be worried about apps not working correctly if we skip this test. 🤔

Copy link
Contributor Author

@jrjohnson jrjohnson Oct 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too, I don't actually know what any of this stuff does! I'm just playing referee to get the approved path merged. I'm happy to investigate and do more, but getting this merged has been a very long process so far. Makes me hesitant to add any more complexity that could delay it further.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Turbo87 skipping as this is already broken on the latest beta. Will have to circle back and figure out a good solution for this.

// see https://github.com/offirgolan/ember-cp-validations/issues/149
assert.expect(1);

Expand Down
Loading