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

Tonkpils/ember upgrades v3 #660

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ff63e24
Fixup connection refused errors
Tonkpils Aug 24, 2023
4bb1a51
Fix livereload connection issue
Tonkpils Aug 25, 2023
a4afc8b
Ember v2.14.0...v2.18.2
Tonkpils Aug 25, 2023
e661e0f
Set port back to 4300
Tonkpils Aug 25, 2023
1c9f915
Bring back test-helper.js resolver business
Tonkpils Aug 25, 2023
10cf48c
Update ember-social-share for ember-cli-babel update
Tonkpils Aug 25, 2023
78b8f92
Turn off some lint rules to prevent test failures
Tonkpils Aug 25, 2023
9db50fc
Use brace expansion per linter rules
Tonkpils Aug 25, 2023
ffff88a
Resolve unused constants and missing ones
Tonkpils Aug 25, 2023
0c01fbe
Fix no function prototype extension
Tonkpils Aug 25, 2023
ed06e4f
Disable no side effects rule for now
Tonkpils Aug 25, 2023
53885a9
Update active-model-adapter for ember-cli-bable deprecation
Tonkpils Aug 25, 2023
5c271eb
Fix deprecation warning in tests
Tonkpils Aug 25, 2023
2aee2ad
Update ember-cli-bourbon for babel deprecation fix
Tonkpils Aug 25, 2023
567d748
Update emter-time-field to 0.3 for babel deprecation
Tonkpils Aug 25, 2023
e26b480
Update ember-power-select to 1.10 for babel and bunch other fixes
Tonkpils Aug 25, 2023
7bcd4dc
Update ember-i18n for babel deprecation fix
Tonkpils Aug 25, 2023
3422669
Update ember-simple-auth for bump in deps and misc fixes
Tonkpils Aug 25, 2023
81ca480
Make engine match what node-sass supports
Tonkpils Aug 25, 2023
7c55c3c
Use node 14 for development
Tonkpils Aug 25, 2023
78c3070
Update actions to ue matrix for new node version
Tonkpils Aug 25, 2023
2b60928
Add CI for next Node versions for fun
Tonkpils Aug 25, 2023
0d7cf73
Fix running tests in Node 14 and phantomJS
Tonkpils Aug 25, 2023
8b70a9f
Update bower to latest release
Tonkpils Aug 25, 2023
d155095
Update node-sass to 7.0.3
Tonkpils Aug 25, 2023
80c6538
Update ember-ajax
Tonkpils Aug 25, 2023
94a0448
Update ember-truth-helpers for ember bable update
Tonkpils Sep 4, 2023
3d9bd77
Update ember-truth-helpers to latest v3 release
Tonkpils Sep 4, 2023
19dfa2b
Update ember-ic-you for ember-bable deprecation
Tonkpils Sep 4, 2023
c89b1b5
Add some script helpers
Tonkpils Sep 4, 2023
89223d3
v2.18.2...v3.4.4
Tonkpils Sep 4, 2023
5bfc7e0
Fix linter errors from ember-template-lint
Tonkpils Sep 4, 2023
0af2b95
Migrate bourbon to npm and upgrade to 6.0.0
Tonkpils Sep 5, 2023
26c7adb
Update emter-g-recaptcha for Ember 3.4 support
Tonkpils Sep 5, 2023
b21c0e0
Update ember-scroll for latest ember support
Tonkpils Sep 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ on:
- main
- master

env:
NODE_VERSION: 12.22.6

jobs:
changes:
runs-on: ubuntu-latest
Expand All @@ -33,21 +30,51 @@ jobs:
- 'frontend/**'
- '.github/workflows/**'

test-app:
npm-test:
strategy:
matrix:
node_version: ['12.22.6', '14.21']
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 7
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm install -g npm@7.0.0
- run: npm install
working-directory: ./frontend
- run: npm run test
working-directory: ./frontend

node-next-test:
strategy:
matrix:
node_version: ['16', '18', '20']
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' }}
name: Test app
runs-on: ubuntu-latest
timeout-minutes: 7
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
node-version: ${{ matrix.node_version }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm install -g npm@7.0.0
- run: npm install
working-directory: ./frontend
- run: npm run test
working-directory: ./frontend

test-app:
name: Test app
needs: [ npm-test ]
runs-on: ubuntu-latest
steps:
- run: echo "done"
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ services:
- backend
ports:
- 4300:4300
- 65535:65535
volumes:
- ./frontend:/app
command: sh -c "cd /app && rm -rfd ./dist && ./node_modules/.bin/ember serve --port 4300 --proxy http://localhost:3000"
command: sh -c "cd /app && rm -rfd ./dist && ./node_modules/.bin/ember serve --port 4300 --proxy http://backend:3000 --live-reload-host frontend --live-reload-port 65535"
profiles:
- dev
app-setup:
Expand Down
18 changes: 18 additions & 0 deletions frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/coverage/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
36 changes: 34 additions & 2 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,47 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
'ember/new-module-imports': 'off',
'ember/avoid-leaking-state-in-ember-objects': 'off',
'ember/no-on-calls-in-components': 'off',
'ember/closure-actions': 'off',
'ember/no-side-effects': 'off',
},
globals: {
d3: true,
moment: true,
'Pusher': true
}
},
overrides: [
// node files
{
files: [
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
}
]
};
22 changes: 14 additions & 8 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/dist/
/tmp/

# dependencies
/node_modules
/bower_components
/bower_components/
/node_modules/

# misc
/.sass-cache
/connect.lock
/coverage/*
/coverage/
/libpeerconnection.log
npm-debug.log
testem.log
/npm-debug.log*
/testem.log
/yarn-error.log

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

module.exports = {
extends: 'recommended',
rules: {
// 'no-bare-strings': true,
'img-alt-attributes': false,
'no-invalid-interactive': false,
}
};
5 changes: 4 additions & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:12.22.6
FROM --platform=linux/amd64 node:14.21

# Force npm version 7
RUN npm i -g npm@7
Expand All @@ -9,6 +9,9 @@ COPY package*.json bower.json .bowerrc .npmrc ./

RUN npm install

# May no be needed in future version of node
ENV OPENSSL_CONF=/dev/null

COPY . .

CMD ["npm", "start"]
14 changes: 12 additions & 2 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ You will need the following things properly installed on your computer.
* [Bower](http://bower.io/)
* [Ember CLI](http://ember-cli.com/)
* [PhantomJS](http://phantomjs.org/)
* [Google Chrome](https://google.com/chrome/)

## Installation

Expand All @@ -23,7 +24,9 @@ You will need the following things properly installed on your computer.
## Running / Development

* `ember serve`

* Visit your app at [http://localhost:4300](http://localhost:4300).
* Visit your tests at [http://localhost:4300/tests](http://localhost:4300/tests).

## Running / Development via Fastboot server

Expand All @@ -38,6 +41,12 @@ Make use of the many generators for code, try `ember help generate` for more det
* `ember test`
* `ember test --server`

### Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`

### Building

* `ember build` (development)
Expand All @@ -49,8 +58,9 @@ Specify what it takes to deploy your app.

## Further Reading / Useful Links

* [ember.js](http://emberjs.com/)
* [ember-cli](http://ember-cli.com/)
* [ember.js](https://emberjs.com/)
* [ember-cli](https://ember-cli.com/)

* Development Browser Extensions
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
6 changes: 2 additions & 4 deletions frontend/app/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import Ember from 'ember';
import Application from '@ember/application';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

let App;

App = Ember.Application.extend({
const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/checkin/trackables-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default Component.extend(TrackablesFromType, {
return moment(this.get('checkin.date')).isSame(new Date(), 'day');
}),

sortedTrackeds: computed('trackeds.[]', 'trackeds.@each.position', function() {
sortedTrackeds: computed('trackeds.{[],@each.position}', function() {
return this.get('trackeds').toArray().sortBy('position');
}),

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/data-export-initiator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default Component.extend({
tagName: '',
apiHost: ENV.apiHost,

authHeader: computed('session.data.authenticated.token', 'session.currentUser.email', function() {
authHeader: computed('session.{data.authenticated.token,currentUser.email}', function() {
return `Token token="${get(this, 'session.data.authenticated.token')}", ` +
`email="${get(this, 'session.currentUser.email')}"`;
}),
Expand Down
12 changes: 6 additions & 6 deletions frontend/app/components/form-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ export default Ember.Component.extend({

model: Ember.computed.alias('parentView.for'),

shouldAlwaysBeWithinAFormForComponent: function() {
didInsertElement() {
Ember.run.scheduleOnce('afterRender', () => {
var parentView = this.get('parentView');
var elementId = this.get('elementId');
Ember.assert("FormFieldComponent (element ID: " + elementId + ") must have a parent view in order to yield.", parentView);
Ember.assert("FormFieldComponent (element ID: " + elementId + ") should be inside a FormForComponent.", FormForComponent.detectInstance(parentView));
});
}.on('didInsertElement'),
},


hasError: function() {
hasError: Ember.computed('model.errors.[]', function() {
var ref;
if ((ref = this.get('model.errors')) != null) {
return ref.has(this.get('for'));
} else {
return false;
}
}.property('model.errors.[]'),
}),

errorClass: Ember.computed('hasError', function() {
if (this.get('hasError')) {
Expand All @@ -34,9 +34,9 @@ export default Ember.Component.extend({
}
}),

errors: function() {
errors: Ember.computed('model.errors.[]', function() {
var errors = this.get('model.errors');
return errors.errorsFor(this.get('for')).mapBy('message').join(', ');
}.property('model.errors.[]')
})

});
2 changes: 1 addition & 1 deletion frontend/app/components/posts/activity-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default Component.extend({
return get(this, 'notification.kind') === 'comment' ? 'responded' : 'reacted';
}),

fullResponse: computed('people', 'notification.kind', 'notification.notifier_username', function() {
fullResponse: computed('people', 'notification.{kind,notifier_username}', function() {
if(get(this, 'notification.kind') === 'mention') {

return (`<b>${get(this, 'notification.notifier_username')}</b> mentioned you in a comment` ).htmlSafe();
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/controllers/posts/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const {
} = Ember;

export default Controller.extend(BackNavigateable, SearchableDropdown, {
disabled: computed('model.body', 'model.title', 'model.topics.[]', function() {
disabled: computed('model.{body,title,topics.[]}', function() {
const { body, title, topics } = getProperties(get(this, 'model'), 'body', 'title', 'topics');

return !(body && title && topics.length);
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

{{content-for "head"}}

<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/flaredown.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/flaredown.css">

{{content-for "head-footer"}}
</head>
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/router.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Ember from 'ember';
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
import RouterScroll from 'ember-router-scroll';

const Router = Ember.Router.extend(RouterScroll, {
const Router = EmberRouter.extend(RouterScroll, {
location: config.locationType,
rootURL: config.rootURL
});
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/services/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default Service.extend({
'completed',
],

steps: computed('exclusions.harvey_bradshaw', 'exclusions.promotion_rate', function() {
steps: computed('exclusions.{harvey_bradshaw,promotion_rate}', function() {
const { checkinSeed, onboardingSeed } = getProperties(this, 'checkinSeed', 'onboardingSeed');

return Object.assign(
Expand All @@ -38,7 +38,7 @@ export default Service.extend({
);
}),

exclusions: computed('checkin.shouldShowHbiStep', 'checkin.shouldShowPrStep', function() {
exclusions: computed('checkin.{shouldShowHbiStep,shouldShowPrStep}', function() {
let schedulePage = {};

get(this, 'checkin.shouldShowHbiStep') ? {} : schedulePage.harvey_bradshaw = true;
Expand Down
11 changes: 11 additions & 0 deletions frontend/app/styles/components/signup-form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,16 @@

.checkbox {
flex-direction: row;
margin: 0.5em 0 1em;

.error-message {
margin-top: 0;
font-weight: bold;
font-size: 0.9em;
}
}

.birthdayForm .error-message {
margin-top: 0;
}
}
Loading
Loading