Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Ember Upgrade to 3.28.6 #674

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
66 changes: 36 additions & 30 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,64 @@

module.exports = {
root: true,
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
legacyDecorators: true,
},
// This is specific babel-config. If grows consider creating a babel config file
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'prettier'],
env: {
browser: true
browser: true,
},
rules: {
//'ember/new-module-imports': 'off',
'no-console': 1,
'ember/no-observers': 1
'ember/no-observers': 1,
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js',
'server/**/*.js'
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script'
sourceType: 'script',
},
env: {
browser: false,
node: true,
es6: 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'
})
}
]
'node/no-unpublished-require': 'off',
},
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
singleQuote: true,
};
12 changes: 11 additions & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
'use strict';

module.exports = {
extends: 'octane',
plugins: ['ember-template-lint-plugin-prettier'],

extends: ['recommended', 'ember-template-lint-plugin-prettier:recommended'],
overrides: [
{
files: '**/tests/**/*.{js,gts,gjs}',
rules: {
prettier: false,
},
},
],
};
14 changes: 4 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
language: node_js
node_js:
- "8"
- "12"

sudo: false
dist: bionic
dist: xenial

addons:
chrome: stable
Expand All @@ -26,10 +25,5 @@ before_install:
- export PATH=$HOME/.yarn/bin:$PATH
- export TZ=America/Anchorage

install:
- yarn install --non-interactive
#
# script:
# - yarn lint:hbs
# - yarn lint:js
# - yarn test
script:
# - yarn test
Binary file added .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
3 changes: 1 addition & 2 deletions app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Adapter
from 'ember-local-storage/adapters/adapter';
import Adapter from 'ember-local-storage/adapters/adapter';

export default Adapter.extend({});
41 changes: 19 additions & 22 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,18 @@ import Resolver from 'ember-resolver';
import {
computed,
defineProperty,
getWithDefault,
get,
//set
} from '@ember/object';
import {
isNone
} from '@ember/utils';
import {
assert
} from '@ember/debug';
import { isNone } from '@ember/utils';
import { assert } from '@ember/debug';
// import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import config from 'mdeditor/config/environment';

let events = {
// add support for the blur event
blur: 'blur'
}
blur: 'blur',
};

export default class App extends Application {
modulePrefix = config.modulePrefix;
Expand All @@ -47,14 +41,14 @@ loadInitializers(App, config.modulePrefix);

//for bootstrap
LinkComponent.reopen({
attributeBindings: ['data-toggle', 'data-placement']
attributeBindings: ['data-toggle', 'data-placement'],
});
//for crumbly
Route.reopen({
//breadCrumb: null
currentRouteModel: function () {
return this.modelFor(this.routeName);
}
},
});
//for profiles
Component.reopen({
Expand All @@ -66,7 +60,7 @@ Component.reopen({
let visibility = this.visibility;
let isVisible = isNone(visibility) ? true : visibility;

if(path !== undefined) {
if (path !== undefined) {
assert(`${path} is not a profile path!`, path.charAt(0) !== '.');

// generate profile definition
Expand All @@ -81,18 +75,21 @@ Component.reopen({
// return pp;
// }, '');

defineProperty(this, 'isVisible', computed(
'profile.active',
function () {
if(!profile.activeComponents) {
defineProperty(
this,
'isVisible',
computed('profile.active', function () {
if (!profile.activeComponents) {
return isVisible;
}

return getWithDefault(profile.activeComponents, path,
isVisible);
}));
return profile.activeComponents && profile.activeComponents[path]
? profile.activeComponents[path]
: isVisible;
}),
);
}
}
},
});

/**
Expand Down
25 changes: 25 additions & 0 deletions app/components/control/md-alert-table/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Component from '@ember/component';
import { computed } from '@ember/object';

export default Component.extend({
classNames: ['alert', 'md-alert-table'],
classNameBindings: ['alertType'],
required: false,
title: '',
target: null,

alertType: computed('required', function () {
return 'alert-' + (this.required ? 'danger' : 'info');
}),
tipType: computed('required', function () {
return this.required ? 'danger' : 'info';
}),
tipIcon: computed('required', function () {
return this.required ? 'alert-circle' : 'info';
}),
actions: {
addItem(target) {
this.addItem(target);
},
},
});
27 changes: 27 additions & 0 deletions app/components/control/md-alert-table/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<h4>No
<span class={{if this.required 'required'}}>{{this.title}}</span>
found.
<button
type='button'
class='btn btn-success btn-md'
{{action 'addItem' this.target}}
>
<FlightIcon @name='plus' />
Add
{{singularize this.title}}
</button>
{{yield}}
</h4>
<h4>
{{#if this.tipMessage}}
<span class='md-{{this.tipType}}'>
<FlightIcon @name={{this.tipIcon}} />
<EmberTooltip
@side='right'
@tooltipClass={{concat 'ember-tooltip md-tooltip ' this.tipType}}
>
{{this.tipMessage}}
</EmberTooltip>
</span>
{{/if}}
</h4>
21 changes: 21 additions & 0 deletions app/components/control/md-breadcrumbs-item/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';

export default class ControlMdBreadcrumbsItemComponent extends Component {
@service('breadcrumbs') breadcrumbsService;

@tracked element = null;

@action
registerSelf(element) {
this.element = element;
}

get current() {
const crumbs = this.breadcrumbsService.containers[0].element.children;
const lastCrumb = crumbs[crumbs.length - 1];
return lastCrumb.isEqualNode(this.element);
}
}
16 changes: 16 additions & 0 deletions app/components/control/md-breadcrumbs-item/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{#each this.breadcrumbsService.containers as |container|}}
{{#in-element container.element insertBefore=null}}
<Hds::Breadcrumb::Item
@text={{@text}}
@icon={{@icon}}
@route={{@route}}
@models={{@models}}
@query={{@query}}
@model={{@model}}
@current={{this.current}}
...attributes
{{did-insert this.registerSelf}}
data-test-breadcrumbs-item
/>
{{/in-element}}
{{/each}}
Loading