Skip to content

Commit

Permalink
Upgrade to ember 3.16 and node 14.15 (#83)
Browse files Browse the repository at this point in the history
* upgrade ember 3.16

Fixes requirements. Selecting new delivery recipient is broken.
Re-enables jquery

* fix tests after 3.16 upgrade

Skipping onSearch duke-ds-user-search-fields test. This caused tests
to repeat again and again.

* Revert "fix tests after 3.16 upgrade"

This reverts commit 7bfd6da.

* fix tests and lint settings

lint settings:
ember/no-jquery off
ember/no-new-mixins off
ember/no-observers off

Fixes tests broken by upgrade to 3.16

* upgrade to node 14.15 for tests

Tests fail when using node 8.9 due to this issue:
jsdom/jsdom#2963

* set ci jobs to 1

This is to prevent an out of memory error on circle-ci based on
emberjs/ember.js#15641

* set JOBS 2 in circleci config
  • Loading branch information
johnbradley authored Jan 15, 2021
1 parent bafa2aa commit 92fe352
Show file tree
Hide file tree
Showing 25 changed files with 18,119 additions and 8,747 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:8.9-browsers
- image: circleci/node:14.15-browsers
environment:
JOBS: 2
working_directory: ~/repo
steps:
- checkout
Expand Down
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
26 changes: 21 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
'ember'
Expand All @@ -15,6 +21,9 @@ module.exports = {
browser: true
},
rules: {
'ember/no-jquery': 'off',
'ember/no-new-mixins': 'off',
'ember/no-observers': 'off'
},
overrides: [
// node files
Expand All @@ -30,13 +39,20 @@ module.exports = {
'server/**/*.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
sourceType: 'script'
},
env: {
browser: false,
node: true
}
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here

// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off'
})
}
]
};
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
extends: 'octane'
};
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM circleci/node:8.9-browsers as builder
FROM circleci/node:14.15-browsers as builder
# The base image sets USER to circleci.
# Reset user back to root so we have permissions for the ADDed files.
USER root
Expand Down
14 changes: 6 additions & 8 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Application from '@ember/application';
import Resolver from './resolver';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
});
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}

loadInitializers(App, config.modulePrefix);

export default App;
16 changes: 8 additions & 8 deletions app/components/duke-ds-user-search-fields.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { set } from '@ember/object';
import Component from '@ember/component';
import { action } from '@ember/object';

const KINDS = [
{mode: 'full_name_contains', name: 'Name', placeholder: 'Full or Partial Name'},
Expand All @@ -16,14 +17,13 @@ export default Component.extend({
kinds: KINDS,
kind: null,
onSearch: () => {}, // Default implementation
actions: {
search() {
let params = {};
const query = this.get('query');
const mode = this.get('kind.mode');
set(params, mode, query);
this.get('onSearch')(params);
}
@action
search() {
let params = {};
const query = this.get('query');
const mode = this.get('kind.mode');
set(params, mode, query);
this.get('onSearch')(params);
},
didReceiveAttrs() {
this._super(...arguments);
Expand Down
3 changes: 0 additions & 3 deletions app/resolver.js

This file was deleted.

10 changes: 4 additions & 6 deletions app/router.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import EmberRouter from '@ember/routing/router';
import config from './config/environment';

const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL
});
export default class Router extends EmberRouter {
location = config.locationType;
rootURL = config.rootURL;
}

Router.map(function() {
this.route('login');
Expand Down Expand Up @@ -32,5 +32,3 @@ Router.map(function() {
this.route('show', { path: '/:email_template_set_id'} );
});
});

export default Router;
Empty file removed app/templates/components/.gitkeep
Empty file.
13 changes: 10 additions & 3 deletions app/templates/components/duke-ds-user-search-fields.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form class="form-horizontal">
<form class="form-horizontal" onsubmit="return false;">
<fieldset>
<legend>{{labelText}}</legend>
<div class="row">
Expand All @@ -20,10 +20,17 @@
</div>
</div>
<div class="col-md-8">
{{input class="form-control query-field" value=this.query placeholder=kind.placeholder}}
<Input
class="form-control query-field"
@id="query-field"
@type="text"
@enter={{ this.search }}
@value={{ this.query }}
placeholder={{ kind.placeholder }}
/>
</div>
<div class="col-md-1">
{{#bs-button type="info" buttonType="submit" onClick=(action "search")}}Search{{/bs-button}}
<button class="btn btn-info" type="button" {{on "click" this.search}}>Search</button>
</div>
</div>
</fieldset>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/share-users-table.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</tbody>
<tfoot>
<tr>
<td colspan="4">
<td colspan="4" class="share-users-table-footer">
{{#bs-button type="primary" onClick=(action "addUser") class="share-users-table-add-user pull-right btn-sm"}}
Add User
{{/bs-button}}
Expand Down
2 changes: 1 addition & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function(environment) {
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Expand Down
5 changes: 4 additions & 1 deletion config/optional-features.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"jquery-integration": true
"application-template-wrapper": false,
"default-async-observers": true,
"jquery-integration": true,
"template-only-glimmer-components": true
}
Loading

0 comments on commit 92fe352

Please sign in to comment.