Merge pull request #311 from hashicorp/release

Release v0.1.0
This commit is contained in:
Randall Morey authored and GitHub committed 2020-10-07 14:33:00 -04:00
commit 31f7b575a9
228 files changed
+4399 -1229

No files matched your search

+2 -7
View File
@@ -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']
}
]
};
-60
View File
@@ -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
View File
Whitespace-only changes.
+1
View File
@@ -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';
+2 -2
View File
@@ -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);
+7 -1
View File
@@ -1,6 +1,7 @@
import GeneratedAccountModel from '../generated/models/account';
import { fragment } from 'ember-data-model-fragments/attributes';
import { computed } from '@ember/object';
import { equal } from '@ember/object/computed';
export default class AccountModel extends GeneratedAccountModel {
@@ -12,11 +13,16 @@ export default class AccountModel extends GeneratedAccountModel {
*/
@fragment('fragment-account-attributes', { defaultValue: {} }) attributes;
/**
* @type {boolean}
*/
@equal('type', 'password') isPassword;
/**
* 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 -2
View File
@@ -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 = {};
+1 -5
View File
@@ -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))
@@ -46,8 +46,6 @@ export default class GroupModel extends GeneratedGroupModel {
memberIDs,
};
// There is no "deep merge" in ES.
// All of this nonsense is here to ensure we get
// a decent merge of `adapterOptions`.
return this.save({
...options,
adapterOptions: {
@@ -71,8 +69,6 @@ export default class GroupModel extends GeneratedGroupModel {
memberIDs,
};
// There is no "deep merge" in ES.
// All of this nonsense is here to ensure we get
// a decent merge of `adapterOptions`.
return this.save({
...options,
adapterOptions: {
-4
View File
@@ -53,8 +53,6 @@ export default class RoleModel extends GeneratedRoleModel {
principalIDs,
};
// There is no "deep merge" in ES.
// All of this nonsense is here to ensure we get
// a decent merge of `adapterOptions`.
return this.save({
...options,
adapterOptions: {
@@ -78,8 +76,6 @@ export default class RoleModel extends GeneratedRoleModel {
principalIDs,
};
// There is no "deep merge" in ES.
// All of this nonsense is here to ensure we get
// a decent merge of `adapterOptions`.
return this.save({
...options,
adapterOptions: {
+11
View File
@@ -1,7 +1,18 @@
import GeneratedSessionModel from '../generated/models/session';
import { computed } from '@ember/object';
export default class SessionModel extends GeneratedSessionModel {
// =attributes
/**
* @type {boolean}
*/
@computed('status')
get isCancelable() {
return this.status?.match(/(active)|(pending)/i);
}
// =methods
/**
+1 -5
View File
@@ -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 }) => ({
@@ -52,8 +52,6 @@ export default class TargetModel extends GeneratedTargetModel {
hostSetIDs,
};
// There is no "deep merge" in ES.
// All of this nonsense is here to ensure we get
// a decent merge of `adapterOptions`.
return this.save({
...options,
adapterOptions: {
@@ -77,8 +75,6 @@ export default class TargetModel extends GeneratedTargetModel {
hostSetIDs,
};
// There is no "deep merge" in ES.
// All of this nonsense is here to ensure we get
// a decent merge of `adapterOptions`.
return this.save({
...options,
adapterOptions: {
-4
View File
@@ -33,8 +33,6 @@ export default class UserModel extends GeneratedUserModel {
accountIDs,
};
// There is no "deep merge" in ES.
// All of this nonsense is here to ensure we get
// a decent merge of `adapterOptions`.
return this.save({
...options,
adapterOptions: {
@@ -58,8 +56,6 @@ export default class UserModel extends GeneratedUserModel {
accountIDs,
};
// There is no "deep merge" in ES.
// All of this nonsense is here to ensure we get
// a decent merge of `adapterOptions`.
return this.save({
...options,
adapterOptions: {
+4 -1
View File
@@ -37,8 +37,11 @@ export default class ApplicationSerializer extends RESTSerializer {
* @param {String} key
* @param {Object} attribute
*/
serializeAttribute(snapshot, json, key, { options }) {
serializeAttribute(snapshot, json, key, attribute) {
const { type, options } = attribute;
let value = super.serializeAttribute(...arguments);
// Convert empty strings to null.
if (type === 'string' && json[key] === '') json[key] = null;
// Do not serialize read-only attributes.
if (options.readOnly) delete json[key];
// Version is sent only if it has a non-nullish value
View File
Whitespace-only changes.
+11 -13
View File
@@ -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
View File
@@ -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 -1
View File
@@ -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;
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
+1 -1
View File
@@ -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;
Whitespace-only changes.
@@ -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"
]
}
]
}
]
}
+1 -1
View File
@@ -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) {
View File
Whitespace-only changes.
Whitespace-only changes.
+2 -2
View File
@@ -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');
+17 -1
View File
@@ -4,10 +4,26 @@ import { setupTest } from 'ember-qunit';
module('Unit | Model | session', function(hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('session', {});
assert.ok(model);
assert.notOk(model.isCancelable);
});
test('it allows cancellation of an active session', function(assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('session', {
status: 'active'
});
assert.ok(model.isCancelable);
});
test('it allows cancellation of a pending session', function(assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('session', {
status: 'pending'
});
assert.ok(model.isCancelable);
});
});
@@ -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({
@@ -70,6 +70,21 @@ module('Unit | Serializer | application', function (hooks) {
});
});
test('it serializes empty strings to null', function (assert) {
assert.expect(1);
const store = this.owner.lookup('service:store');
const record = store.createRecord('user', {
name: '',
description: '',
version: null,
});
let serializedRecord = record.serialize();
assert.deepEqual(serializedRecord, {
name: null,
description: null,
});
});
test('it serializes non-nullish version fields', function (assert) {
assert.expect(2);
const store = this.owner.lookup('service:store');
View File
Whitespace-only changes.
+2 -6
View File
@@ -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']
}
]
};
-66
View File
@@ -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
View File
Whitespace-only changes.
+11 -13
View File
@@ -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
View File
@@ -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 -1
View File
@@ -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;
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
+1 -1
View File
@@ -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;
Whitespace-only changes.
@@ -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"
]
}
]
}
]
}
+1 -1
View File
@@ -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) {
View File
Whitespace-only changes.
Whitespace-only changes.
+2 -2
View File
@@ -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';
View File
Whitespace-only changes.
+1 -3
View File
@@ -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']
}
]
};
-66
View File
@@ -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
View File
Whitespace-only changes.
@@ -4,6 +4,7 @@
$xs: sizing.rems(xs); // 8
$xxs: sizing.rems(xxs); // 4
$chevron: "data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231b1f26' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z'></path></svg>";
$chevronWhite: "data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%23ffffff' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z'></path></svg>";
.rose-dropdown {
position: relative;
@@ -13,12 +14,11 @@ $chevron: "data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231b1f26' xm
@include type.type(button, semibold);
cursor: default;
overflow: hidden;
display: flex;
align-items: center;
$yPadding: sizing.rems(xxs) + sizing.rems(xxxs);
padding: $yPadding sizing.rems(m) $yPadding sizing.rems(l);
color: var(--stark);
border-radius: sizing.rems(xxxs);
white-space: nowrap;
// Hide default twistie triangle
// Webkit / Chromium
@@ -63,6 +63,10 @@ $chevron: "data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231b1f26' xm
background-repeat: no-repeat;
background-position: right sizing.rems(m) center;
background-size: sizing.rems(m);
@media (prefers-color-scheme: dark) {
background-image: url($chevronWhite);
}
}
// Hide default twistie triangle
View File
Whitespace-only changes.
+11 -13
View File
@@ -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
View File
@@ -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 -1
View File
@@ -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;
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
+1 -1
View File
@@ -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;
Whitespace-only changes.
@@ -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"
]
}
]
}
]
}
+1 -1
View File
@@ -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) {
View File
Whitespace-only changes.
Whitespace-only changes.
@@ -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) {
+2 -2
View File
@@ -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';
View File
Whitespace-only changes.
+1 -1
View File
@@ -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": {
+4 -7
View File
@@ -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'
})
}
}
]
};
+7
View File
@@ -0,0 +1,7 @@
files:
include: 'app/styles/**/*.s+(a|c)ss'
rules:
leading-zero: 0
mixins-before-declarations: 0
nesting-depth: 0
placeholder-in-extend: 0
+2 -2
View File
@@ -4,7 +4,7 @@ module.exports = {
extends: 'octane',
rules: {
'no-bare-strings': true,
'no-curly-component-invocation': { allow: ['app-name'] },
'no-implicit-this': { allow: ['app-name'] }
'no-curly-component-invocation': { allow: ['app-name', 'company-name', 'company-copyright'] },
'no-implicit-this': { allow: ['app-name', 'company-name', 'company-copyright', 'doc-url'] }
}
};
-33
View File
@@ -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
View File
@@ -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;
+3 -3
View File
@@ -63,7 +63,7 @@ export default class PasswordAuthenticator extends BasePasswordAuthenticator {
authenticate() {
return super.authenticate(...arguments).then((data) => {
const token = data?.token;
if (token) this.addTokenToAuthorization(token);
this.addTokenToAuthorization(token);
return data;
});
}
@@ -77,7 +77,7 @@ export default class PasswordAuthenticator extends BasePasswordAuthenticator {
*/
restore(data) {
const token = data?.token;
if (token) this.addTokenToAuthorization(token);
this.addTokenToAuthorization(token);
return super.restore(data);
}
@@ -93,6 +93,6 @@ export default class PasswordAuthenticator extends BasePasswordAuthenticator {
const headers = adapterPrototype?.headers;
if (!headers) adapterPrototype.headers = {};
adapterPrototype.headers.Authorization = null;
if (token) adapterPrototype.headers.Authorization = `Bearer ${token}`;
adapterPrototype.headers.Authorization = `Bearer ${token}`;
}
}
+22 -21
View File
@@ -1,20 +1,21 @@
{{#if this.isClipboardLibrarySupported}}
<span
id={{this.id}}
class="copyable"
{{did-insert this.register}}
{{will-destroy this.destroy}}
>
{{#if this.copied}}
<mark class="copyable-content">
{{yield}}
</mark>
{{else}}
<span class="copyable-content">
{{yield}}
</span>
{{/if}}
<span
id={{this.id}}
class="copyable"
{{did-insert this.register}}
{{will-destroy this.destroy}}
>
{{#if this.copied}}
<mark class="copyable-content">
{{yield}}
</mark>
{{else}}
<span class="copyable-content">
{{yield}}
</span>
{{/if}}
{{#if this.isClipboardLibrarySupported}}
<Rose::Button
id={{this.copyableButtonId}}
aria-describedby={{this.id}}
@@ -22,8 +23,8 @@
@style="ghost"
@iconOnly={{if this.copied this.successIcon this.actionIcon}}
title={{if this.copied this.successText this.actionText}}
>{{this.actionText}}</Rose::Button>
</span>
{{else}}
{{yield}}
{{/if}}
>
{{this.actionText}}
</Rose::Button>
{{/if}}
</span>
+16 -19
View File
@@ -3,7 +3,6 @@ import ClipboardJS from 'clipboard';
import { action } from '@ember/object';
import { generateComponentID } from 'rose/utilities/component-auto-id';
import { task, timeout } from 'ember-concurrency';
import { bind } from '@ember/runloop';
import { tracked } from '@glimmer/tracking';
export default class CopyableComponent extends Component {
@@ -20,6 +19,8 @@ export default class CopyableComponent extends Component {
@tracked copied = false;
clipboard = null;
/**
* A Ember Concurrency-based task that updates copy icon to a success state
* and back after 1 second. This icon flash indicates success on
@@ -30,13 +31,12 @@ export default class CopyableComponent extends Component {
* is an attribute.
* @type {Task}
*/
/* istanbul ignore next */
@task(function * () {
this.copied = true;
yield timeout(1000);
this.copied = false;
}).drop() successIconTimer;
// =methods
}).drop() confirmCopyTimer;
/**
* Checks for ClipboardJS support.
@@ -46,14 +46,6 @@ export default class CopyableComponent extends Component {
return ClipboardJS.isSupported();
}
/**
* When copy to clipboard is successful, begin timer to show success icon.
*/
onCopySuccess(clipboardEvent) {
clipboardEvent.clearSelection();
this.successIconTimer.perform();
}
// =actions
/**
@@ -61,12 +53,16 @@ export default class CopyableComponent extends Component {
*/
@action
register() {
if (!this.clipboard) {
this.clipboard = new ClipboardJS(`#${this.copyableButtonId}`, {
text: () => this.args.text,
});
this.clipboard.on('success', bind(this, this.onCopySuccess));
}
this.destroy();
/* istanbul ignore next */
this.clipboard = new ClipboardJS(`#${this.copyableButtonId}`, {
text: () => this.args.text,
});
/* istanbul ignore next */
this.clipboard.on('success', (clipboardEvent) => {
clipboardEvent.clearSelection();
this.confirmCopyTimer.perform();
});
}
/**
@@ -75,7 +71,8 @@ export default class CopyableComponent extends Component {
@action
destroy() {
this.clipboard?.destroy();
this.successIconTimer.cancelAll();
this.clipboard = null;
this.confirmCopyTimer.cancelAll();
}
}
@@ -0,0 +1,8 @@
<a
class="doc-link"
href={{doc-url @doc}}
target="_blank"
rel="noreferrer noopener"
title={{t "actions.get-topic-help"}}>
<Rose::Icon @name="help-circle-outline" @size={{@iconSize}} />
</a>
@@ -1,6 +1,6 @@
<Rose::Form
class="full-width"
@onSubmit={{fn this.submit @submit}}
@onSubmit={{fn this.submit @submit this.currentPassword this.newPassword}}
@cancel={{fn this.cancel @cancel}}
@disabled={{@model.isSaving}}
@error={{@model.errors.base}}
@@ -44,7 +44,7 @@
</form.input>
<form.actions
@disabled={{this.cannotSave}}
@submitDisabled={{this.cannotSave}}
@submitText={{t "actions.save"}}
@cancelText={{t "actions.cancel"}} />
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { computed } from '@ember/object';
import { action } from '@ember/object';
import { next } from '@ember/runloop';
import { run } from '@ember/runloop';
export default class FormAccountPasswordChangePasswordIndexComponent extends Component {
@@ -50,13 +50,13 @@ export default class FormAccountPasswordChangePasswordIndexComponent extends Com
* Call passed submit function with passwords.
* Unset passwords before callack.
* @param {function} fn
* @param {string} currentPassword
* @param {string} newPassword
*/
@action
submit(fn) {
const currentPassword = this.currentPassword;
const newPassword = this.newPassword;
next(() => this.resetPasswords());
fn(currentPassword, newPassword);
submit(fn, currentPassword, newPassword) {
run(() => this.resetPasswords());
run(() => fn(currentPassword, newPassword));
}
/**
@@ -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}} />
@@ -1,6 +1,5 @@
<Rose::Form
@onSubmit={{fn this.submit @submit}}
@cancel={{fn this.cancel @cancel}}
@onSubmit={{fn this.submit @submit this.password}}
@disabled={{@model.isSaving}}
@error={{@model.errors.base}}
as |form|
@@ -26,8 +25,9 @@
</form.input>
<form.actions
@disabled={{this.cannotSave}}
@submitDisabled={{this.cannotSave}}
@showCancel={{false}}
@submitText={{t "actions.save"}}
@cancelText={{t "actions.cancel"}} />
</Rose::Form>
</Rose::Form>
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { computed } from '@ember/object';
import { action } from '@ember/object';
import { next } from '@ember/runloop';
import { run } from '@ember/runloop';
export default class FormAccountPasswordSetPasswordIndexComponent extends Component {
// =properties
@@ -36,21 +36,11 @@ export default class FormAccountPasswordSetPasswordIndexComponent extends Compon
* Submit with password value when it is allowed.
* Callback with no arguments otherwise.
* @param {function} fn
* @param {string} password
*/
@action
submit(fn) {
const password = this.password;
next(() => this.resetPassword());
fn(password);
}
/**
* Unset password value before callback.
* @param {function} fn
*/
@action
cancel(fn) {
this.resetPassword();
fn();
submit(fn, password) {
run(() => this.resetPassword());
run(() => fn(password));
}
}
@@ -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}} />
@@ -39,10 +39,14 @@
{{#unless this.availableUsers}}
<Rose::Layout::Centered>
<Rose::Message @title={{t "titles.no-available-users"}} as |message|>
<message.description>
{{t "descriptions.no-available-users"}}
</message.description>
</Rose::Message>
<Rose::Message @title={{t "resources.group.messages.no-members.title"}} as |message|>
<message.description>
{{t "resources.group.messages.no-members.description"}}
</message.description>
<message.link @route="scopes.scope.groups.group.members">
<Rose::Icon @name="chevron-left" />
{{t "actions.back"}}
</message.link>
</Rose::Message>
</Rose::Layout::Centered>
{{/unless}}
@@ -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));
@@ -1,50 +0,0 @@
<Rose::Form
class="full-width"
@onSubmit={{@submit}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
@error={{@model.errors.base}}
as |form|
>
<form.actions
@disabled={{if @model.cannotSave @model.cannotSave}}
@submitText={{t "actions.save"}}
@cancelText={{t "actions.cancel"}} />
{{!--
{{#if @model.errors.host_ids}}
<input.errors as |errors|>
{{#each @model.errors.host_ids as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</input.errors>
{{/if}}
--}}
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.address.label'}}</row.headerCell>
</header.row>
</table.header>
<table.body as |body|>
{{#each this.options as |option|}}
<body.row as |row|>
<row.cell>
<form.checkbox
@label={{option.host.id}}
@description={{option.host.description}}
@checked={{option.selected}}
onChange={{fn @toggleHost option.host}} />
</row.cell>
<row.cell>{{option.host.name}}</row.cell>
<row.cell>{{option.host.attributes.address}}</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
</Rose::Form>
@@ -1,21 +0,0 @@
import Component from '@glimmer/component';
import { computed } from '@ember/object';
export default class FormHostSetHostsComponent extends Component {
// =attributes
/**
* An array of wrapped `HostModel` instances where the wrapper includes
* a `selected` boolean field indicating if the host is represented
* in `model.host_ids`.
* @type {[{host: HostModel, selected: boolean}]}
*/
@computed('args.{hosts.[],model.host_ids.[]}')
get options() {
const { hosts, model: hostSet } = this.args;
return hosts.map((host) => ({
host,
selected: Boolean(hostSet.host_ids.findBy('value', host.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}} />
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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}} />
Loaded 100 of 228 files, more files were not shown because too many files have changed in this diff. Show more