Merge pull request #292 from hashicorp/chore-ember-lts-upgrade
Chore ember lts upgrade
This commit is contained in:
66 files changed
+3235
-584
No files matched your search
@@ -20,10 +20,7 @@ module.exports = {
|
||||
env: {
|
||||
browser: true
|
||||
},
|
||||
rules: {
|
||||
'ember/no-jquery': 'error',
|
||||
'ember/no-new-mixins': 0
|
||||
},
|
||||
rules: {},
|
||||
overrides: [
|
||||
// node files
|
||||
{
|
||||
@@ -51,9 +48,7 @@ module.exports = {
|
||||
node: true
|
||||
},
|
||||
plugins: ['node'],
|
||||
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
|
||||
// add your custom rules and overrides for node files here
|
||||
})
|
||||
extends: ['plugin:node/recommended']
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
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
|
||||
- "10"
|
||||
|
||||
dist: trusty
|
||||
|
||||
addons:
|
||||
chrome: stable
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.npm
|
||||
|
||||
env:
|
||||
global:
|
||||
# See https://git.io/vdao3 for details.
|
||||
- JOBS=1
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
# npm version tags
|
||||
- /^v\d+\.\d+\.\d+/
|
||||
|
||||
jobs:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- env: EMBER_TRY_SCENARIO=ember-canary
|
||||
|
||||
include:
|
||||
# runs linting and tests with current locked deps
|
||||
- stage: "Tests"
|
||||
name: "Tests"
|
||||
script:
|
||||
- npm run lint:hbs
|
||||
- npm run lint:js
|
||||
- npm test
|
||||
|
||||
- stage: "Additional Tests"
|
||||
name: "Floating Dependencies"
|
||||
install:
|
||||
- npm install --no-package-lock
|
||||
script:
|
||||
- npm test
|
||||
|
||||
# we recommend new addons test the current and previous LTS
|
||||
# as well as latest stable release (bonus points to beta/canary)
|
||||
- env: EMBER_TRY_SCENARIO=ember-lts-3.12
|
||||
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
|
||||
- env: EMBER_TRY_SCENARIO=ember-release
|
||||
- env: EMBER_TRY_SCENARIO=ember-beta
|
||||
- env: EMBER_TRY_SCENARIO=ember-canary
|
||||
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
|
||||
- env: EMBER_TRY_SCENARIO=ember-classic
|
||||
|
||||
script:
|
||||
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
|
||||
@@ -1,5 +1,6 @@
|
||||
import RESTAdapter from '@ember-data/adapter/rest';
|
||||
import { serializeIntoHash } from '@ember-data/adapter/-private';
|
||||
/* eslint-disable-next-line ember/no-mixins */
|
||||
import AdapterBuildURLMixin from '../mixins/adapter-build-url';
|
||||
import config from 'ember-get-config';
|
||||
import { get, getWithDefault } from '@ember/object';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import Mixin from '@ember/object/mixin';
|
||||
import { get } from '@ember/object';
|
||||
|
||||
/**
|
||||
* Overrides URL-building methods in an adpater for greater flexibility.
|
||||
@@ -12,6 +11,7 @@ import { get } from '@ember/object';
|
||||
* way URLs are generated by default. Override methods in the adapter that
|
||||
* uses this mixin to alter generated URLs.
|
||||
*/
|
||||
/* eslint-disable-next-line ember/no-new-mixins */
|
||||
export default Mixin.create({
|
||||
// =methods
|
||||
|
||||
@@ -57,7 +57,7 @@ export default Mixin.create({
|
||||
_buildPrefixedURL(modelName, id, snapshot) {
|
||||
let path;
|
||||
let url = [];
|
||||
const host = get(this, 'host');
|
||||
const host = this.host;
|
||||
const prefix = this.urlPrefix(null, null, modelName, id, snapshot);
|
||||
if (modelName) {
|
||||
path = this.pathForType(modelName);
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class AccountModel extends GeneratedAccountModel {
|
||||
* Convenience for getting username in account.
|
||||
* @type {string}
|
||||
*/
|
||||
@computed('type', 'attributes.{login_name}')
|
||||
@computed('type', 'attributes.login_name')
|
||||
get username() {
|
||||
let username = '';
|
||||
switch (this.type) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import Model from '@ember-data/model';
|
||||
import { fragment } from 'ember-data-model-fragments/attributes';
|
||||
import { computed } from '@ember/object';
|
||||
import { get } from '@ember/object';
|
||||
|
||||
/**
|
||||
* Base model class provides common functionality for all models.
|
||||
@@ -51,7 +50,7 @@ export default class BaseModel extends Model {
|
||||
*/
|
||||
@computed('scope.scope_id')
|
||||
get scopeID() {
|
||||
return get(this, 'scope.scope_id');
|
||||
return this?.scope?.scope_id;
|
||||
}
|
||||
set scopeID(id) {
|
||||
if (!this.scope) this.scope = {};
|
||||
|
||||
@@ -23,7 +23,7 @@ export default class GroupModel extends GeneratedGroupModel {
|
||||
* @type {[UserModel]}
|
||||
*/
|
||||
// TODO: Use fragments array to read cross scope members.
|
||||
@computed('member_ids.[]')
|
||||
@computed('member_ids.[]', 'store')
|
||||
get members() {
|
||||
return this.member_ids
|
||||
.map((id) => this.store.peekRecord('user', id))
|
||||
|
||||
@@ -26,7 +26,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
* instances). Unresolvable instances are excluded from the array.
|
||||
* @type {[{model: HostSetModel, hostCatalog: HostCatalogModel}]}
|
||||
*/
|
||||
@computed('host_sets.[]')
|
||||
@computed('host_sets.[]', 'store')
|
||||
get hostSets() {
|
||||
return this.host_sets
|
||||
.map(({ host_set_id, host_catalog_id }) => ({
|
||||
|
||||
@@ -21,6 +21,14 @@ module.exports = async function () {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ember-lts-3.20',
|
||||
npm: {
|
||||
devDependencies: {
|
||||
'ember-source': '~3.20.5'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'ember-release',
|
||||
npm: {
|
||||
@@ -45,16 +53,6 @@ module.exports = async function () {
|
||||
},
|
||||
},
|
||||
},
|
||||
// The default `.travis.yml` runs this scenario via `npm test`,
|
||||
// not via `ember try`. It's still included here so that running
|
||||
// `ember try:each` manually or from a customized CI config will run it
|
||||
// along with all the other scenarios.
|
||||
{
|
||||
name: 'ember-default',
|
||||
npm: {
|
||||
devDependencies: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ember-default-with-jquery',
|
||||
env: {
|
||||
@@ -64,9 +62,9 @@ module.exports = async function () {
|
||||
},
|
||||
npm: {
|
||||
devDependencies: {
|
||||
'@ember/jquery': '^0.5.1',
|
||||
},
|
||||
},
|
||||
'@ember/jquery': '^1.1.0'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'ember-classic',
|
||||
|
||||
+17
-15
@@ -10,35 +10,34 @@
|
||||
"scripts": {
|
||||
"build:development": "ember build",
|
||||
"build": "ember build --environment=production",
|
||||
"lint": "yarn lint:js",
|
||||
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
|
||||
"lint:js": "eslint .",
|
||||
"format": "npm run format:js",
|
||||
"format:js": "prettier --write '{addon,app,config,stories,tests}/**/*.js' *.js",
|
||||
"start": "ember serve",
|
||||
"test": "ember test",
|
||||
"test:all": "ember try:each",
|
||||
"test:ember-compatibility": "ember try:each",
|
||||
"doc:toc": "doctoc README.md"
|
||||
},
|
||||
"dependencies": {
|
||||
"ember-cli-babel": "^7.17.2",
|
||||
"ember-cli-htmlbars": "^4.2.2"
|
||||
"ember-cli-babel": "^7.21.0",
|
||||
"ember-cli-htmlbars": "^5.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ember/optional-features": "^1.3.0",
|
||||
"@glimmer/component": "^1.0.0",
|
||||
"@glimmer/component": "^1.0.1",
|
||||
"@glimmer/tracking": "^1.0.0",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"broccoli-asset-rev": "^3.0.0",
|
||||
"doctoc": "^1.4.0",
|
||||
"ember-auto-import": "^1.5.3",
|
||||
"ember-cli": "~3.16.1",
|
||||
"ember-auto-import": "^1.6.0",
|
||||
"ember-cli": "~3.20.2",
|
||||
"ember-cli-dependency-checker": "^3.2.0",
|
||||
"ember-cli-eslint": "^5.1.0",
|
||||
"ember-cli-inject-live-reload": "^2.0.2",
|
||||
"ember-cli-mirage": "^1.1.7",
|
||||
"ember-cli-sri": "^2.1.1",
|
||||
"ember-cli-template-lint": "^1.0.0-beta.3",
|
||||
"ember-cli-uglify": "^3.0.0",
|
||||
"ember-cli-update": "^0.54.6",
|
||||
"ember-copy": "^1.0.0",
|
||||
"ember-data": "^3.16.0",
|
||||
"ember-data-model-fragments": "5.0.0-beta.0",
|
||||
@@ -48,15 +47,18 @@
|
||||
"ember-load-initializers": "^2.1.1",
|
||||
"ember-maybe-import-regenerator": "^0.1.6",
|
||||
"ember-qunit": "^4.6.0",
|
||||
"ember-resolver": "^7.0.0",
|
||||
"ember-source": "~3.16.0",
|
||||
"ember-resolver": "^8.0.0",
|
||||
"ember-source": "~3.20.2",
|
||||
"ember-source-channel-url": "^2.0.1",
|
||||
"ember-template-lint": "^2.9.1",
|
||||
"ember-try": "^1.4.0",
|
||||
"eslint-plugin-ember": "^7.7.2",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"eslint": "^7.5.0",
|
||||
"eslint-plugin-ember": "^8.9.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"loader.js": "^4.7.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.0.5",
|
||||
"qunit-dom": "^1.0.0"
|
||||
"qunit-dom": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "10.* || >= 12"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Application from '@ember/application';
|
||||
import Resolver from 'ember-resolver';
|
||||
import loadInitializers from 'ember-load-initializers';
|
||||
import config from './config/environment';
|
||||
import config from 'dummy/config/environment';
|
||||
|
||||
export default class App extends Application {
|
||||
modulePrefix = config.modulePrefix;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import EmberRouter from '@ember/routing/router';
|
||||
import config from './config/environment';
|
||||
import config from 'dummy/config/environment';
|
||||
|
||||
export default class Router extends EmberRouter {
|
||||
location = config.locationType;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"schemaVersion": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"name": "ember-cli",
|
||||
"version": "3.20.2",
|
||||
"blueprints": [
|
||||
{
|
||||
"name": "addon",
|
||||
"outputRepo": "https://github.com/ember-cli/ember-addon-output",
|
||||
"codemodsSource": "ember-addon-codemods-manifest@1",
|
||||
"isBaseBlueprint": true,
|
||||
"options": [
|
||||
"--no-welcome"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,7 +6,7 @@ const browsers = [
|
||||
'last 1 Safari versions',
|
||||
];
|
||||
|
||||
const isCI = !!process.env.CI;
|
||||
const isCI = Boolean(process.env.CI);
|
||||
const isProduction = process.env.EMBER_ENV === 'production';
|
||||
|
||||
if (isCI || isProduction) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Application from '../app';
|
||||
import config from '../config/environment';
|
||||
import Application from 'dummy/app';
|
||||
import config from 'dummy/config/environment';
|
||||
import { setApplication } from '@ember/test-helpers';
|
||||
import { start } from 'ember-qunit';
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import RESTAdapter from '@ember-data/adapter/rest';
|
||||
/* eslint-disable-next-line ember/no-mixins */
|
||||
import AdapterBuildURLMixin from 'api/mixins/adapter-build-url';
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
@@ -8,6 +9,7 @@ module('Unit | Mixin | build-url', function (hooks) {
|
||||
|
||||
test('it does not interfere with basic URLs', function (assert) {
|
||||
assert.expect(1);
|
||||
/* eslint-disable-next-line ember/no-new-mixins */
|
||||
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin);
|
||||
this.owner.register('adapter:adapter', Adapter);
|
||||
const adapter = this.owner.lookup('adapter:adapter');
|
||||
@@ -17,6 +19,7 @@ module('Unit | Mixin | build-url', function (hooks) {
|
||||
|
||||
test('it does not interfere with namespaced URLs', function (assert) {
|
||||
assert.expect(1);
|
||||
/* eslint-disable-next-line ember/no-new-mixins */
|
||||
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin, {
|
||||
namespace: 'api/v1',
|
||||
});
|
||||
@@ -28,6 +31,7 @@ module('Unit | Mixin | build-url', function (hooks) {
|
||||
|
||||
test('it can prepend a prefix', function (assert) {
|
||||
assert.expect(1);
|
||||
/* eslint-disable-next-line ember/no-new-mixins */
|
||||
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin, {
|
||||
urlPrefix() {
|
||||
return '/foo/bars';
|
||||
@@ -41,6 +45,7 @@ module('Unit | Mixin | build-url', function (hooks) {
|
||||
|
||||
test('it can append a suffix', function (assert) {
|
||||
assert.expect(1);
|
||||
/* eslint-disable-next-line ember/no-new-mixins */
|
||||
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin, {
|
||||
urlSuffix() {
|
||||
return ':method';
|
||||
|
||||
@@ -61,6 +61,7 @@ module('Unit | Model | group', function (hooks) {
|
||||
member_ids: ['123_abc', 'foobar'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
});
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -91,6 +92,7 @@ module('Unit | Model | group', function (hooks) {
|
||||
member_ids: ['1', '3'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
});
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -121,6 +123,7 @@ module('Unit | Model | group', function (hooks) {
|
||||
member_ids: ['3'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
});
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
|
||||
@@ -20,6 +20,7 @@ module('Unit | Model | role', function (hooks) {
|
||||
grant_strings: ['grant1', 'grant2'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
});
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -50,6 +51,7 @@ module('Unit | Model | role', function (hooks) {
|
||||
principal_ids: ['123_abc', 'foobar'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
});
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -85,6 +87,7 @@ module('Unit | Model | role', function (hooks) {
|
||||
principal_ids: ['1', '3'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
@@ -121,6 +124,7 @@ module('Unit | Model | role', function (hooks) {
|
||||
principal_ids: ['3'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
|
||||
@@ -80,6 +80,7 @@ module('Unit | Model | target', function (hooks) {
|
||||
host_set_ids: ['123_abc', 'foobar'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
});
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -115,6 +116,7 @@ module('Unit | Model | target', function (hooks) {
|
||||
host_set_ids: ['1', '3'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
@@ -151,6 +153,7 @@ module('Unit | Model | target', function (hooks) {
|
||||
host_set_ids: ['3'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
|
||||
@@ -14,6 +14,7 @@ module('Unit | Model | user', function (hooks) {
|
||||
account_ids: ['123_abc', 'foobar'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
});
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -44,6 +45,7 @@ module('Unit | Model | user', function (hooks) {
|
||||
account_ids: ['1', '3'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
});
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -74,6 +76,7 @@ module('Unit | Model | user', function (hooks) {
|
||||
account_ids: ['3'],
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
});
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
|
||||
@@ -20,9 +20,7 @@ module.exports = {
|
||||
env: {
|
||||
browser: true
|
||||
},
|
||||
rules: {
|
||||
'ember/no-jquery': 'error'
|
||||
},
|
||||
rules: {},
|
||||
overrides: [
|
||||
// node files
|
||||
{
|
||||
@@ -50,9 +48,7 @@ module.exports = {
|
||||
node: true
|
||||
},
|
||||
plugins: ['node'],
|
||||
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
|
||||
// add your custom rules and overrides for node files here
|
||||
})
|
||||
extends: ['plugin:node/recommended']
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -1,66 +0,0 @@
|
||||
---
|
||||
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
|
||||
- "10"
|
||||
|
||||
dist: trusty
|
||||
|
||||
addons:
|
||||
chrome: stable
|
||||
|
||||
cache:
|
||||
yarn: true
|
||||
|
||||
env:
|
||||
global:
|
||||
# See https://git.io/vdao3 for details.
|
||||
- JOBS=1
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
# npm version tags
|
||||
- /^v\d+\.\d+\.\d+/
|
||||
|
||||
jobs:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- env: EMBER_TRY_SCENARIO=ember-canary
|
||||
|
||||
include:
|
||||
# runs linting and tests with current locked deps
|
||||
- stage: "Tests"
|
||||
name: "Tests"
|
||||
script:
|
||||
- yarn lint:hbs
|
||||
- yarn lint:js
|
||||
- yarn test
|
||||
|
||||
- stage: "Additional Tests"
|
||||
name: "Floating Dependencies"
|
||||
install:
|
||||
- yarn install --no-lockfile --non-interactive
|
||||
script:
|
||||
- yarn test
|
||||
|
||||
# we recommend new addons test the current and previous LTS
|
||||
# as well as latest stable release (bonus points to beta/canary)
|
||||
- env: EMBER_TRY_SCENARIO=ember-lts-3.12
|
||||
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
|
||||
- env: EMBER_TRY_SCENARIO=ember-release
|
||||
- env: EMBER_TRY_SCENARIO=ember-beta
|
||||
- env: EMBER_TRY_SCENARIO=ember-canary
|
||||
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
|
||||
- env: EMBER_TRY_SCENARIO=ember-classic
|
||||
|
||||
before_install:
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
- export PATH=$HOME/.yarn/bin:$PATH
|
||||
|
||||
install:
|
||||
- yarn install --non-interactive
|
||||
|
||||
script:
|
||||
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
|
||||
@@ -22,6 +22,14 @@ module.exports = async function () {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ember-lts-3.20',
|
||||
npm: {
|
||||
devDependencies: {
|
||||
'ember-source': '~3.20.5'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'ember-release',
|
||||
npm: {
|
||||
@@ -46,16 +54,6 @@ module.exports = async function () {
|
||||
},
|
||||
},
|
||||
},
|
||||
// The default `.travis.yml` runs this scenario via `yarn test`,
|
||||
// not via `ember try`. It's still included here so that running
|
||||
// `ember try:each` manually or from a customized CI config will run it
|
||||
// along with all the other scenarios.
|
||||
{
|
||||
name: 'ember-default',
|
||||
npm: {
|
||||
devDependencies: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ember-default-with-jquery',
|
||||
env: {
|
||||
@@ -65,9 +63,9 @@ module.exports = async function () {
|
||||
},
|
||||
npm: {
|
||||
devDependencies: {
|
||||
'@ember/jquery': '^0.5.1',
|
||||
},
|
||||
},
|
||||
'@ember/jquery': '^1.1.0'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'ember-classic',
|
||||
|
||||
+17
-15
@@ -8,35 +8,34 @@
|
||||
"ember-addon"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "yarn lint:js",
|
||||
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
|
||||
"lint:js": "eslint .",
|
||||
"format": "npm run format:js",
|
||||
"format:js": "prettier --write '{addon,app,config,stories,tests}/**/*.js' *.js",
|
||||
"start": "ember serve",
|
||||
"test": "ember test",
|
||||
"test:all": "ember try:each",
|
||||
"test:ember-compatibility": "ember try:each",
|
||||
"doc:toc": "doctoc README.md"
|
||||
},
|
||||
"dependencies": {
|
||||
"ember-cli-babel": "^7.17.2",
|
||||
"ember-cli-htmlbars": "^4.2.2"
|
||||
"ember-cli-babel": "^7.21.0",
|
||||
"ember-cli-htmlbars": "^5.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ember/optional-features": "^1.3.0",
|
||||
"@glimmer/component": "^1.0.0",
|
||||
"@glimmer/component": "^1.0.1",
|
||||
"@glimmer/tracking": "^1.0.0",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"broccoli-asset-rev": "^3.0.0",
|
||||
"doctoc": "^1.4.0",
|
||||
"ember-auto-import": "^1.5.3",
|
||||
"ember-cli": "~3.16.1",
|
||||
"ember-auto-import": "^1.6.0",
|
||||
"ember-cli": "~3.20.2",
|
||||
"ember-cli-dependency-checker": "^3.2.0",
|
||||
"ember-cli-eslint": "^5.1.0",
|
||||
"ember-cli-inject-live-reload": "^2.0.2",
|
||||
"ember-cli-mirage": "^1.1.7",
|
||||
"ember-cli-sri": "^2.1.1",
|
||||
"ember-cli-template-lint": "^1.0.0-beta.3",
|
||||
"ember-cli-uglify": "^3.0.0",
|
||||
"ember-cli-update": "^0.54.6",
|
||||
"ember-cookies": "^0.5.2",
|
||||
"ember-data": "^3.16.0",
|
||||
"ember-disable-prototype-extensions": "^1.1.3",
|
||||
@@ -45,16 +44,19 @@
|
||||
"ember-load-initializers": "^2.1.1",
|
||||
"ember-maybe-import-regenerator": "^0.1.6",
|
||||
"ember-qunit": "^4.6.0",
|
||||
"ember-resolver": "^7.0.0",
|
||||
"ember-resolver": "^8.0.0",
|
||||
"ember-simple-auth": "^3.0.0",
|
||||
"ember-source": "~3.16.0",
|
||||
"ember-source": "~3.20.2",
|
||||
"ember-source-channel-url": "^2.0.1",
|
||||
"ember-template-lint": "^2.9.1",
|
||||
"ember-try": "^1.4.0",
|
||||
"eslint-plugin-ember": "^7.7.2",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"eslint": "^7.5.0",
|
||||
"eslint-plugin-ember": "^8.9.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"loader.js": "^4.7.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.0.5",
|
||||
"qunit-dom": "^1.0.0"
|
||||
"qunit-dom": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "10.* || >= 12"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Application from '@ember/application';
|
||||
import Resolver from 'ember-resolver';
|
||||
import loadInitializers from 'ember-load-initializers';
|
||||
import config from './config/environment';
|
||||
import config from 'dummy/config/environment';
|
||||
|
||||
export default class App extends Application {
|
||||
modulePrefix = config.modulePrefix;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import EmberRouter from '@ember/routing/router';
|
||||
import config from './config/environment';
|
||||
import config from 'dummy/config/environment';
|
||||
|
||||
export default class Router extends EmberRouter {
|
||||
location = config.locationType;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"schemaVersion": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"name": "ember-cli",
|
||||
"version": "3.20.2",
|
||||
"blueprints": [
|
||||
{
|
||||
"name": "addon",
|
||||
"outputRepo": "https://github.com/ember-cli/ember-addon-output",
|
||||
"codemodsSource": "ember-addon-codemods-manifest@1",
|
||||
"isBaseBlueprint": true,
|
||||
"options": [
|
||||
"--no-welcome"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,7 +6,7 @@ const browsers = [
|
||||
'last 1 Safari versions',
|
||||
];
|
||||
|
||||
const isCI = !!process.env.CI;
|
||||
const isCI = Boolean(process.env.CI);
|
||||
const isProduction = process.env.EMBER_ENV === 'production';
|
||||
|
||||
if (isCI || isProduction) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Application from '../app';
|
||||
import config from '../config/environment';
|
||||
import Application from 'dummy/app';
|
||||
import config from 'dummy/config/environment';
|
||||
import { setApplication } from '@ember/test-helpers';
|
||||
import { start } from 'ember-qunit';
|
||||
|
||||
|
||||
@@ -51,9 +51,7 @@ module.exports = {
|
||||
node: true
|
||||
},
|
||||
plugins: ['node'],
|
||||
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
|
||||
// add your custom rules and overrides for node files here
|
||||
})
|
||||
extends: ['plugin:node/recommended']
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -1,66 +0,0 @@
|
||||
---
|
||||
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
|
||||
- "10"
|
||||
|
||||
dist: trusty
|
||||
|
||||
addons:
|
||||
chrome: stable
|
||||
|
||||
cache:
|
||||
yarn: true
|
||||
|
||||
env:
|
||||
global:
|
||||
# See https://git.io/vdao3 for details.
|
||||
- JOBS=1
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
# npm version tags
|
||||
- /^v\d+\.\d+\.\d+/
|
||||
|
||||
jobs:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- env: EMBER_TRY_SCENARIO=ember-canary
|
||||
|
||||
include:
|
||||
# runs linting and tests with current locked deps
|
||||
- stage: "Tests"
|
||||
name: "Tests"
|
||||
script:
|
||||
- yarn lint:hbs
|
||||
- yarn lint:js
|
||||
- yarn test
|
||||
|
||||
- stage: "Additional Tests"
|
||||
name: "Floating Dependencies"
|
||||
install:
|
||||
- yarn install --no-lockfile --non-interactive
|
||||
script:
|
||||
- yarn test
|
||||
|
||||
# we recommend new addons test the current and previous LTS
|
||||
# as well as latest stable release (bonus points to beta/canary)
|
||||
- env: EMBER_TRY_SCENARIO=ember-lts-3.12
|
||||
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
|
||||
- env: EMBER_TRY_SCENARIO=ember-release
|
||||
- env: EMBER_TRY_SCENARIO=ember-beta
|
||||
- env: EMBER_TRY_SCENARIO=ember-canary
|
||||
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
|
||||
- env: EMBER_TRY_SCENARIO=ember-classic
|
||||
|
||||
before_install:
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
- export PATH=$HOME/.yarn/bin:$PATH
|
||||
|
||||
install:
|
||||
- yarn install --non-interactive
|
||||
|
||||
script:
|
||||
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
|
||||
@@ -22,6 +22,14 @@ module.exports = async function () {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ember-lts-3.20',
|
||||
npm: {
|
||||
devDependencies: {
|
||||
'ember-source': '~3.20.5'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'ember-release',
|
||||
npm: {
|
||||
@@ -46,16 +54,6 @@ module.exports = async function () {
|
||||
},
|
||||
},
|
||||
},
|
||||
// The default `.travis.yml` runs this scenario via `yarn test`,
|
||||
// not via `ember try`. It's still included here so that running
|
||||
// `ember try:each` manually or from a customized CI config will run it
|
||||
// along with all the other scenarios.
|
||||
{
|
||||
name: 'ember-default',
|
||||
npm: {
|
||||
devDependencies: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ember-default-with-jquery',
|
||||
env: {
|
||||
@@ -65,9 +63,9 @@ module.exports = async function () {
|
||||
},
|
||||
npm: {
|
||||
devDependencies: {
|
||||
'@ember/jquery': '^0.5.1',
|
||||
},
|
||||
},
|
||||
'@ember/jquery': '^1.1.0'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'ember-classic',
|
||||
|
||||
+17
-15
@@ -10,7 +10,7 @@
|
||||
"scripts": {
|
||||
"build:development": "ember build",
|
||||
"build": "ember build --environment=production",
|
||||
"lint": "yarn lint:hbs && yarn lint:js && yarn lint:sass",
|
||||
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
|
||||
"lint:hbs": "ember-template-lint .",
|
||||
"lint:js": "eslint .",
|
||||
"lint:sass": "sass-lint -v -q",
|
||||
@@ -19,7 +19,7 @@
|
||||
"format:sass": "prettier --write addon/**/*.scss",
|
||||
"start": "ember serve",
|
||||
"test": "ember test",
|
||||
"test:all": "ember try:each",
|
||||
"test:ember-compatibility": "ember try:each",
|
||||
"prestorybook": "yarn build && yarn storybook:build",
|
||||
"storybook": "start-storybook -p 6006 -s dist",
|
||||
"storybook:build": "build-storybook -s dist",
|
||||
@@ -27,12 +27,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-loader": "^8.1.0",
|
||||
"ember-cli-babel": "^7.17.2",
|
||||
"ember-cli-htmlbars": "^4.2.2"
|
||||
"ember-cli-babel": "^7.21.0",
|
||||
"ember-cli-htmlbars": "^5.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ember/optional-features": "^1.3.0",
|
||||
"@glimmer/component": "^1.0.0",
|
||||
"@glimmer/component": "^1.0.1",
|
||||
"@glimmer/tracking": "^1.0.0",
|
||||
"@hashicorp/structure-icons": "^1.8.1",
|
||||
"@storybook/addon-actions": "^6.0.21",
|
||||
@@ -40,18 +40,17 @@
|
||||
"@storybook/addon-knobs": "^6.0.21",
|
||||
"@storybook/ember": "^6.0.21",
|
||||
"@storybook/ember-cli-storybook": "^0.2.1",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"broccoli-asset-rev": "^3.0.0",
|
||||
"doctoc": "^1.4.0",
|
||||
"ember-auto-import": "^1.5.3",
|
||||
"ember-cli": "~3.16.1",
|
||||
"ember-auto-import": "^1.6.0",
|
||||
"ember-cli": "~3.20.2",
|
||||
"ember-cli-dependency-checker": "^3.2.0",
|
||||
"ember-cli-eslint": "^5.1.0",
|
||||
"ember-cli-inject-live-reload": "^2.0.2",
|
||||
"ember-cli-sass": "^10.0.1",
|
||||
"ember-cli-sri": "^2.1.1",
|
||||
"ember-cli-template-lint": "^1.0.0-beta.3",
|
||||
"ember-cli-uglify": "^3.0.0",
|
||||
"ember-cli-update": "^0.54.6",
|
||||
"ember-disable-prototype-extensions": "^1.1.3",
|
||||
"ember-export-application-global": "^2.0.1",
|
||||
"ember-inline-svg": "^1.0.0",
|
||||
@@ -60,17 +59,20 @@
|
||||
"ember-modifier": "^1.0.3",
|
||||
"ember-qunit": "^4.6.0",
|
||||
"ember-radio-button": "^2.0.1",
|
||||
"ember-resolver": "^7.0.0",
|
||||
"ember-source": "~3.16.0",
|
||||
"ember-resolver": "^8.0.0",
|
||||
"ember-source": "~3.20.2",
|
||||
"ember-source-channel-url": "^2.0.1",
|
||||
"ember-template-lint": "^2.9.1",
|
||||
"ember-try": "^1.4.0",
|
||||
"ember-uuid": "^2.1.0",
|
||||
"emberx-select": "github:adopted-ember-addons/emberx-select#bc5f774",
|
||||
"eslint-plugin-ember": "^7.7.2",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"eslint": "^7.5.0",
|
||||
"eslint-plugin-ember": "^8.9.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"loader.js": "^4.7.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.0.5",
|
||||
"qunit-dom": "^1.0.0",
|
||||
"qunit-dom": "^1.2.0",
|
||||
"sass": "^1.26.5",
|
||||
"sass-lint": "^1.13.1"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Application from '@ember/application';
|
||||
import Resolver from 'ember-resolver';
|
||||
import loadInitializers from 'ember-load-initializers';
|
||||
import config from './config/environment';
|
||||
import config from 'dummy/config/environment';
|
||||
|
||||
export default class App extends Application {
|
||||
modulePrefix = config.modulePrefix;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import EmberRouter from '@ember/routing/router';
|
||||
import config from './config/environment';
|
||||
import config from 'dummy/config/environment';
|
||||
|
||||
export default class Router extends EmberRouter {
|
||||
location = config.locationType;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"schemaVersion": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"name": "ember-cli",
|
||||
"version": "3.20.2",
|
||||
"blueprints": [
|
||||
{
|
||||
"name": "addon",
|
||||
"outputRepo": "https://github.com/ember-cli/ember-addon-output",
|
||||
"codemodsSource": "ember-addon-codemods-manifest@1",
|
||||
"isBaseBlueprint": true,
|
||||
"options": [
|
||||
"--no-welcome"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,7 +6,7 @@ const browsers = [
|
||||
'last 1 Safari versions',
|
||||
];
|
||||
|
||||
const isCI = !!process.env.CI;
|
||||
const isCI = Boolean(process.env.CI);
|
||||
const isProduction = process.env.EMBER_ENV === 'production';
|
||||
|
||||
if (isCI || isProduction) {
|
||||
|
||||
@@ -7,8 +7,8 @@ module('Integration | Component | rose/button', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`<Rose::Button>Button 🌈</Rose::Button>`);
|
||||
assert.equal(this.element.textContent.trim(), 'Button 🌈');
|
||||
await render(hbs`<Rose::Button>Button</Rose::Button>`);
|
||||
assert.equal(this.element.textContent.trim(), 'Button');
|
||||
});
|
||||
|
||||
test('it is type="button" by default', async function (assert) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Application from '../app';
|
||||
import config from '../config/environment';
|
||||
import Application from 'dummy/app';
|
||||
import config from 'dummy/config/environment';
|
||||
import { setApplication } from '@ember/test-helpers';
|
||||
import { start } from 'ember-qunit';
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
"compliance:audit": "bash ./scripts/yarn-audit.sh",
|
||||
"precommit": "yarn compliance:licenses && yarn compliance:audit && yarn lint && yarn test",
|
||||
"commit": "git-cz",
|
||||
"compliance:licenses": "license-checker --onlyAllow 'Apache*;Apache License, Version 2.0;Apache-2.0;BSD;BSD-3-Clause;CC-BY-3.0;CC-BY-4.0;CC0-1.0;ISC;MIT;MPL-2.0;Public Domain;Unicode-TOU;Unlicense;WTFPL' --excludePackages 'boundary-ui;core@0.0.0;base64-js@0.0.2'",
|
||||
"compliance:licenses": "license-checker --onlyAllow 'Apache*;Apache License, Version 2.0;Apache-2.0;Artistic-2.0;BSD;BSD-3-Clause;CC-BY-3.0;CC-BY-4.0;CC0-1.0;ISC;MIT;MPL-2.0;Public Domain;Unicode-TOU;Unlicense;WTFPL' --excludePackages 'boundary-ui;core@0.0.0;base64-js@0.0.2'",
|
||||
"doc:toc": "doctoc README.md"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -20,9 +20,7 @@ module.exports = {
|
||||
env: {
|
||||
browser: true
|
||||
},
|
||||
rules: {
|
||||
'ember/no-jquery': 'error'
|
||||
},
|
||||
rules: {},
|
||||
overrides: [
|
||||
// node files
|
||||
{
|
||||
@@ -44,13 +42,12 @@ module.exports = {
|
||||
node: true
|
||||
},
|
||||
plugins: ['node'],
|
||||
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
|
||||
// add your custom rules and overrides for node files here
|
||||
|
||||
extends: ['plugin:node/recommended'],
|
||||
rules: {
|
||||
// this can be removed once the following is fixed
|
||||
// https://github.com/mysticatea/eslint-plugin-node/issues/77
|
||||
'node/no-unpublished-require': 'off'
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -1,33 +0,0 @@
|
||||
---
|
||||
language: node_js
|
||||
node_js:
|
||||
- "10"
|
||||
|
||||
dist: trusty
|
||||
|
||||
addons:
|
||||
chrome: stable
|
||||
|
||||
cache:
|
||||
yarn: true
|
||||
|
||||
env:
|
||||
global:
|
||||
# See https://git.io/vdao3 for details.
|
||||
- JOBS=1
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
before_install:
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
- export PATH=$HOME/.yarn/bin:$PATH
|
||||
|
||||
install:
|
||||
- yarn install --non-interactive
|
||||
|
||||
script:
|
||||
- yarn lint:hbs
|
||||
- yarn lint:js
|
||||
- yarn test
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import Application from '@ember/application';
|
||||
import Resolver from 'ember-resolver';
|
||||
import loadInitializers from 'ember-load-initializers';
|
||||
import config from './config/environment';
|
||||
import config from 'core/config/environment';
|
||||
|
||||
export default class App extends Application {
|
||||
modulePrefix = config.modulePrefix;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
as |form|
|
||||
>
|
||||
<form.input
|
||||
@value={{t (concat 'resources.account.types.' @model.type)}}
|
||||
@value={{@model.type}}
|
||||
@label={{t "form.type.label"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
as |form|
|
||||
>
|
||||
<form.input
|
||||
@value={{t (concat 'resources.auth-method.types.' @model.type)}}
|
||||
@value={{@model.type}}
|
||||
@label={{t "form.type.label"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class FormGroupAddMembersComponent extends Component {
|
||||
* Host sets not already added to the target.
|
||||
* @type {[UserModel]}
|
||||
*/
|
||||
@computed('args.{model.members_ids.[],users.[]}')
|
||||
@computed('args.{model.member_ids.[],users.[]}')
|
||||
get availableUsers() {
|
||||
const memberIDs = this.args.model.member_ids;
|
||||
const users = this.args.users;
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class FormHostSetAddHostsIndexComponent extends Component {
|
||||
* @param {[HostModel]} filteredHosts
|
||||
* @type {boolean}
|
||||
*/
|
||||
@computed('filteredHosts')
|
||||
@computed('filteredHosts.length')
|
||||
get hasAvailableHosts() {
|
||||
return this.filteredHosts.length > 0;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ export default class FormHostSetAddHostsIndexComponent extends Component {
|
||||
* Hosts currently not assigned to current host set.
|
||||
* @type {[HostModel]}
|
||||
*/
|
||||
@computed('args.{model,hosts}')
|
||||
@computed('args.{model,model.host_ids,hosts}')
|
||||
get filteredHosts() {
|
||||
const currentHostIDs = this.args.model.host_ids.map((host) => host.value);
|
||||
return this.args.hosts.filter(({ id }) => !currentHostIDs.includes(id));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{t (concat 'resources.host-set.types.' @model.type)}}
|
||||
@value={{@model.type}}
|
||||
@label={{t "form.type.label"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{t (concat 'resources.host.types.' @model.type)}}
|
||||
@value={{@model.type}}
|
||||
@label={{t "form.type.label"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
@@ -17,7 +17,7 @@ export default class FormRoleAddPrincipalsIndexComponent extends Component {
|
||||
* @param {[UserModel, GroupModel]} filteredPrincipals
|
||||
* @type {boolean}
|
||||
*/
|
||||
@computed('filteredPrincipals')
|
||||
@computed('filteredPrincipals.length')
|
||||
get hasAvailablePrincipals() {
|
||||
return this.filteredPrincipals.length > 0;
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export default class FormRoleAddPrincipalsIndexComponent extends Component {
|
||||
* Principals not currently assigned to a role.
|
||||
* @type {[UserModel, GroupModel]}
|
||||
*/
|
||||
@computed('args.{model,users,groups}')
|
||||
@computed('args.{model,model.principals.[],users,groups}')
|
||||
get filteredPrincipals() {
|
||||
// Retrieve principal IDs assigned to current role
|
||||
const currentPrincipalIDs = this.args.model.principals.map(
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class FormTargetAddHostSetsComponent extends Component {
|
||||
* @param {[HostSetModel]} filteredHostSets
|
||||
* @type {boolean}
|
||||
*/
|
||||
@computed('filteredHostSets')
|
||||
@computed('filteredHostSets.length')
|
||||
get hasAvailableHostSets() {
|
||||
return this.filteredHostSets.length > 0;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{t (concat 'resources.target.types.' @model.type)}}
|
||||
@value={{@model.type}}
|
||||
@label={{t "form.type.label"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class FormUserAddAccountsComponent extends Component {
|
||||
* @param {[AccountModel]} filteredAccounts
|
||||
* @type {boolean}
|
||||
*/
|
||||
@computed('filteredAccounts')
|
||||
@computed('filteredAccounts.length')
|
||||
get hasAvailableAccounts() {
|
||||
return this.filteredAccounts.length > 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import EmberRouter from '@ember/routing/router';
|
||||
import config from './config/environment';
|
||||
import config from 'core/config/environment';
|
||||
|
||||
export default class Router extends EmberRouter {
|
||||
location = config.locationType;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Route from '@ember/routing/route';
|
||||
/* eslint-disable-next-line ember/no-mixins */
|
||||
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
|
||||
import Ember from 'ember';
|
||||
import { getOwner } from '@ember/application';
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"schemaVersion": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"name": "ember-cli",
|
||||
"version": "3.20.2",
|
||||
"blueprints": [
|
||||
{
|
||||
"name": "app",
|
||||
"outputRepo": "https://github.com/ember-cli/ember-new-output",
|
||||
"codemodsSource": "ember-app-codemods-manifest@1",
|
||||
"isBaseBlueprint": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,7 +6,7 @@ const browsers = [
|
||||
'last 1 Safari versions',
|
||||
];
|
||||
|
||||
const isCI = !!process.env.CI;
|
||||
const isCI = Boolean(process.env.CI);
|
||||
const isProduction = process.env.EMBER_ENV === 'production';
|
||||
|
||||
if (isCI || isProduction) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import Ember from 'ember';
|
||||
import config from '../config/environment';
|
||||
import { authHandler, deauthHandler } from './route-handlers/auth';
|
||||
import { pickRandomStatusString } from './factories/session';
|
||||
@@ -321,14 +322,18 @@ export default function() {
|
||||
|
||||
// session
|
||||
|
||||
// To simulate changes to `session.status` that may occur in the backend,
|
||||
// we quietly randomize the value of the field on GET.
|
||||
this.get('/sessions', function ({ sessions }, { queryParams: { scope_id } }) {
|
||||
sessions.where(session => session.scopeId === scope_id)
|
||||
.models
|
||||
.forEach(session => session.update({
|
||||
status: pickRandomStatusString()
|
||||
}));
|
||||
// To simulate changes to `session.status` that may occur in the backend,
|
||||
// we quietly randomize the value of the field on GET.
|
||||
// But only if not in testing mode.
|
||||
// In tests, we need deterministic statuses.
|
||||
if (!Ember.testing) {
|
||||
sessions.where(session => session.scopeId === scope_id)
|
||||
.models
|
||||
.forEach(session => session.update({
|
||||
status: pickRandomStatusString()
|
||||
}));
|
||||
}
|
||||
return sessions.where(session => session.scopeId === scope_id)
|
||||
});
|
||||
this.get('/sessions/:id', function ({ sessions }, { params: { id } }) {
|
||||
|
||||
+20
-17
@@ -13,7 +13,7 @@
|
||||
"doc:toc": "doctoc README.md",
|
||||
"build:development": "ember build",
|
||||
"build": "ember build --environment=production",
|
||||
"lint": "yarn lint:hbs && yarn lint:js && yarn lint:sass",
|
||||
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
|
||||
"lint:hbs": "ember-template-lint .",
|
||||
"lint:js": "eslint .",
|
||||
"lint:sass": "sass-lint -v -q",
|
||||
@@ -23,45 +23,45 @@
|
||||
"start": "ember serve",
|
||||
"clean:coverage": "rm -rf coverage_*",
|
||||
"pretest": "yarn clean:coverage",
|
||||
"test": "COVERAGE=true ember exam --random",
|
||||
"test": "npm-run-all test:*",
|
||||
"test:ember": "COVERAGE=true ember exam --random",
|
||||
"posttest": "ember coverage-merge && yarn clean:coverage"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.9.6",
|
||||
"@ember/optional-features": "^1.3.0",
|
||||
"@ember/render-modifiers": "^1.0.2",
|
||||
"@glimmer/component": "^1.0.0",
|
||||
"@glimmer/component": "^1.0.1",
|
||||
"@glimmer/tracking": "^1.0.0",
|
||||
"api": "*",
|
||||
"auth": "*",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-loader": "^8.1.0",
|
||||
"broccoli-asset-rev": "^3.0.0",
|
||||
"clipboard": "^2.0.6",
|
||||
"doctoc": "^1.4.0",
|
||||
"ember-a11y-testing": "^3.0.0",
|
||||
"ember-auto-import": "^1.5.3",
|
||||
"ember-auto-import": "^1.6.0",
|
||||
"ember-breadcrumbs": "^0.2.3",
|
||||
"ember-cli": "~3.16.1",
|
||||
"ember-cli": "~3.20.2",
|
||||
"ember-cli-app-version": "^3.2.0",
|
||||
"ember-cli-babel": "^7.17.2",
|
||||
"ember-cli-babel": "^7.21.0",
|
||||
"ember-cli-code-coverage": "^1.0.0-beta.9",
|
||||
"ember-cli-content-security-policy": "^1.1.1",
|
||||
"ember-cli-dependency-checker": "^3.2.0",
|
||||
"ember-cli-eslint": "^5.1.0",
|
||||
"ember-cli-htmlbars": "^4.2.2",
|
||||
"ember-cli-htmlbars": "^5.2.0",
|
||||
"ember-cli-inject-live-reload": "^2.0.2",
|
||||
"ember-cli-mirage": "^1.1.6",
|
||||
"ember-cli-sass": "^10.0.1",
|
||||
"ember-cli-sri": "^2.1.1",
|
||||
"ember-cli-template-lint": "^1.0.0-beta.3",
|
||||
"ember-cli-uglify": "^3.0.0",
|
||||
"ember-cli-update": "^0.54.6",
|
||||
"ember-concurrency": "^1.3.0",
|
||||
"ember-data": "~3.16.0",
|
||||
"ember-data": "~3.20.0",
|
||||
"ember-data-model-fragments": "5.0.0-beta.0",
|
||||
"ember-exam": "^5.0.1",
|
||||
"ember-export-application-global": "^2.0.1",
|
||||
"ember-fetch": "^7.0.0",
|
||||
"ember-fetch": "^8.0.1",
|
||||
"ember-inline-svg": "^1.0.0",
|
||||
"ember-intl": "^5.1.1",
|
||||
"ember-load-initializers": "^2.1.1",
|
||||
@@ -71,19 +71,22 @@
|
||||
"ember-notify": "^6.0.0",
|
||||
"ember-page-title": "^5.2.1",
|
||||
"ember-qunit": "^4.6.0",
|
||||
"ember-resolver": "^7.0.0",
|
||||
"ember-resolver": "^8.0.0",
|
||||
"ember-route-action-helper": "^2.0.8",
|
||||
"ember-simple-auth": "^3.0.0",
|
||||
"ember-source": "~3.16.0",
|
||||
"ember-source": "~3.20.2",
|
||||
"ember-template-lint": "^2.9.1",
|
||||
"ember-uuid": "^2.1.0",
|
||||
"ember-welcome-page": "^4.0.0",
|
||||
"emberx-select": "github:adopted-ember-addons/emberx-select#bc5f774",
|
||||
"eslint-plugin-ember": "^7.7.2",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"eslint": "^7.5.0",
|
||||
"eslint-plugin-ember": "^8.9.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"faker": "^4.1.0",
|
||||
"loader.js": "^4.7.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.0.5",
|
||||
"qunit-dom": "^1.0.0",
|
||||
"qunit-dom": "^1.2.0",
|
||||
"rose": "*",
|
||||
"sass": "^1.26.5",
|
||||
"sass-lint": "^1.13.1",
|
||||
|
||||
@@ -66,10 +66,12 @@ module('Acceptance | accounts | change password', function (hooks) {
|
||||
|
||||
test('can change password for account', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.server.post('/accounts/:id', (_, { requestBody }) => {
|
||||
this.server.post('/accounts/:idMethod', (_, { params: { idMethod }, requestBody }) => {
|
||||
const attrs = JSON.parse(requestBody);
|
||||
assert.equal(attrs.current_password, 'current password', 'current password is provided');
|
||||
assert.equal(attrs.new_password, 'new password', 'new password is provided');
|
||||
const id = idMethod.split(':')[0];
|
||||
return { id };
|
||||
});
|
||||
await visit(urls.changePassword);
|
||||
await fillIn('[name="currentPassword"]', 'current password');
|
||||
|
||||
@@ -61,9 +61,11 @@ module('Acceptance | accounts | set password', function (hooks) {
|
||||
|
||||
test('can set a new password for account', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.server.post('/accounts/:id', (_, { requestBody }) => {
|
||||
this.server.post('/accounts/:idMethod', (_, { params: { idMethod }, requestBody }) => {
|
||||
const attrs = JSON.parse(requestBody);
|
||||
assert.equal(attrs.password, 'update password', 'new password is set');
|
||||
const id = idMethod.split(':')[0];
|
||||
return { id };
|
||||
});
|
||||
await visit(urls.setPassword);
|
||||
await fillIn('[name="password"]', 'update password');
|
||||
|
||||
@@ -58,9 +58,11 @@ module('Acceptance | roles | grants', function (hooks) {
|
||||
|
||||
test('update a grant', async function(assert) {
|
||||
assert.expect(1);
|
||||
this.server.post('/roles/:id', (_, { requestBody }) => {
|
||||
this.server.post('/roles/:idMethod', (_, { params: { idMethod }, requestBody }) => {
|
||||
const attrs = JSON.parse(requestBody);
|
||||
assert.equal(attrs.grant_strings[0], 'id=123,action=delete', "A grant is updated");
|
||||
const id = idMethod.split(':')[0];
|
||||
return { id };
|
||||
});
|
||||
await visit(urls.grants);
|
||||
await fillIn(`${grantsForm} [name="grant"]`, 'id=123,action=delete');
|
||||
@@ -90,7 +92,7 @@ module('Acceptance | roles | grants', function (hooks) {
|
||||
);
|
||||
});
|
||||
await visit(urls.grants);
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
grantsCount);
|
||||
await fillIn(`${grantsForm} [name="grant"]`, 'id=123,action=delete');
|
||||
await click('.rose-form-actions [type="submit"]:not(:disabled)');
|
||||
@@ -99,9 +101,11 @@ module('Acceptance | roles | grants', function (hooks) {
|
||||
|
||||
test('create a grant', async function(assert) {
|
||||
assert.expect(1);
|
||||
this.server.post('/roles/:id', (_, { requestBody }) => {
|
||||
this.server.post('/roles/:idMethod', (_, { params: { idMethod }, requestBody }) => {
|
||||
const attrs = JSON.parse(requestBody);
|
||||
assert.equal(attrs.grant_strings.length, grantsCount + 1, "A grant is created");
|
||||
const id = idMethod.split(':')[0];
|
||||
return { id };
|
||||
});
|
||||
await visit(urls.grants);
|
||||
await fillIn(`${newGrantForm} [name="grant"]`, 'id=123,action=delete');
|
||||
@@ -133,7 +137,7 @@ module('Acceptance | roles | grants', function (hooks) {
|
||||
);
|
||||
});
|
||||
await visit(urls.grants);
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
grantsCount);
|
||||
await fillIn(`${newGrantForm} [name="grant"]`, 'id=123,action=delete');
|
||||
await click(`${newGrantForm} [type="submit"]:not(:disabled)`);
|
||||
@@ -146,7 +150,7 @@ module('Acceptance | roles | grants', function (hooks) {
|
||||
await visit(urls.grants);
|
||||
await click(`${grantsForm} button:not([type="submit"])`);
|
||||
await click('.rose-form-actions [type="submit"]:not(:disabled)');
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
grantsCount - 1);
|
||||
});
|
||||
|
||||
@@ -173,7 +177,7 @@ module('Acceptance | roles | grants', function (hooks) {
|
||||
);
|
||||
});
|
||||
await visit(urls.grants);
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
grantsCount);
|
||||
await click(`${grantsForm} button:not([type="submit"])`);
|
||||
await click('.rose-form-actions [type="submit"]:not(:disabled)');
|
||||
|
||||
@@ -42,8 +42,9 @@ module('Acceptance | sessions', function (hooks) {
|
||||
this.server.createList('group', 1, { scope: instances.scopes.org }, 'withMembers');
|
||||
this.server.createList('host-catalog', 1, { scope: instances.scopes.project }, 'withChildren');
|
||||
this.server.createList('target', 1, { scope: instances.scopes.project }, 'withRandomHostSets');
|
||||
instances.sessions = this.server.createList('session', 10, {
|
||||
instances.sessions = this.server.createList('session', 3, {
|
||||
scope: instances.scopes.project,
|
||||
status: 'active'
|
||||
}, 'withAssociations');
|
||||
urls.sessions = `/scopes/${instances.scopes.org.id}/projects/${instances.scopes.project.id}/sessions`;
|
||||
});
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find, findAll } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | bread-crumbs', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
this.set('breadCrumbs', [{ label: 'Level 1' }]);
|
||||
|
||||
await render(hbs`<BreadCrumbs @breadCrumbs={{this.breadCrumbs}} />`);
|
||||
// Default index route
|
||||
assert.ok(find('.rose-nav-breadcrumbs a').href.match(/#$/));
|
||||
assert.equal(find('.rose-nav-breadcrumbs').textContent.trim(), 'Level 1');
|
||||
});
|
||||
|
||||
test('it renders with model', async function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let scope = store.createRecord('scope');
|
||||
|
||||
this.set('breadCrumbs', [
|
||||
{
|
||||
label: 'Level 1',
|
||||
path: 'scopes.scope',
|
||||
model: scope,
|
||||
},
|
||||
]);
|
||||
|
||||
await render(hbs`<BreadCrumbs @breadCrumbs={{this.breadCrumbs}} />`);
|
||||
assert.equal(find('.rose-nav-breadcrumbs').textContent.trim(), 'Level 1');
|
||||
});
|
||||
|
||||
test('it renders multiple breadCrumbs', async function (assert) {
|
||||
this.set('breadCrumbs', [
|
||||
{
|
||||
label: 'Level 1',
|
||||
},
|
||||
{
|
||||
label: 'Level 2',
|
||||
},
|
||||
{
|
||||
label: 'Level 3',
|
||||
},
|
||||
]);
|
||||
|
||||
await render(hbs`<BreadCrumbs @breadCrumbs={{this.breadCrumbs}} />`);
|
||||
assert.equal(findAll('a').length, 3);
|
||||
assert.equal(findAll('a')[0].textContent.trim(), 'Level 1');
|
||||
assert.equal(findAll('a')[1].textContent.trim(), 'Level 2');
|
||||
assert.equal(findAll('a')[2].textContent.trim(), 'Level 3');
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
import Application from '../app';
|
||||
import config from '../config/environment';
|
||||
import Application from 'core/app';
|
||||
import config from 'core/config/environment';
|
||||
import { setApplication } from '@ember/test-helpers';
|
||||
//import { start } from 'ember-qunit';
|
||||
import start from 'ember-exam/test-support/start';
|
||||
|
||||
Reference in new issue
Block a user