Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 374efe4

Browse files
authored
Merge pull request #710 from adfinis/ember-octane
chore: ember octane upgrade
2 parents ac8dbd8 + 4d0cb1f commit 374efe4

File tree

491 files changed

+26322
-27329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

491 files changed

+26322
-27329
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
root = true
66

7-
87
[*]
98
end_of_line = lf
109
charset = utf-8

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@
1313
# misc
1414
/coverage/
1515
!.*
16+
.*/
17+
.eslintcache
1618

1719
# ember-try
1820
/.node_modules.ember-try/
1921
/bower.json.ember-try
2022
/package.json.ember-try
23+
24+
# template lint ci config
25+
.template-lintrc-ci.js

.eslintrc.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
"use-strict";
2+
13
module.exports = {
24
extends: ["@adfinis-sygroup/eslint-config/ember-app"],
3-
rules: {}
5+
rules: {
6+
"ember/no-actions-hash": "warn",
7+
"ember/no-component-lifecycle-hooks": "warn",
8+
"ember/no-mixins": "warn",
9+
"ember/no-new-mixins": "warn",
10+
"ember/no-classic-classes": "warn",
11+
"ember/no-classic-components": "warn",
12+
"ember/no-get": "warn",
13+
"ember/no-observers": "warn",
14+
"qunit/no-assert-equal": "warn",
15+
"ember/require-tagless-components": "warn",
16+
},
417
};

.github/workflows/release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,22 @@ jobs:
1111
with:
1212
fetch-depth: 0
1313
persist-credentials: false
14+
15+
- name: Install pnpm
16+
uses: pnpm/action-setup@v2.0.1
17+
with:
18+
version: 7.17.1
19+
1420
- uses: actions/setup-node@v2
21+
with:
22+
node-version: "16"
23+
cache: "pnpm"
1524

1625
- name: Install dependencies
17-
run: yarn install
26+
run: pnpm install
1827

1928
- name: Release on NPM
20-
run: yarn semantic-release
29+
run: pnpm semantic-release
2130
env:
2231
GH_TOKEN: ${{ secrets.GH_TOKEN }}
2332
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- ember-octane
1212

1313
env:
14-
NODE_VERSION: 14
14+
NODE_VERSION: 16
1515

1616
jobs:
1717
lint:
@@ -26,23 +26,22 @@ jobs:
2626

2727
steps:
2828
- uses: actions/checkout@v2
29-
- uses: actions/setup-node@v2
29+
30+
- name: Install pnpm
31+
uses: pnpm/action-setup@v2.0.1
3032
with:
31-
node-version: ${{ env.NODE_VERSION }}
33+
version: 7.17.1
3234

33-
- uses: actions/cache@v2
35+
- uses: actions/setup-node@v2
3436
with:
35-
path: node_modules
36-
key: node-modules-v2-${{ hashFiles('yarn.lock') }}
37-
restore-keys: |
38-
node-modules-v2-${{ hashFiles('yarn.lock') }}
39-
node-modules-v2-
37+
node-version: ${{ env.NODE_VERSION }}
38+
cache: "pnpm"
4039

4140
- name: Install dependencies
42-
run: yarn install
41+
run: pnpm install
4342

4443
- name: Lint ${{ matrix.target }}
45-
run: yarn lint:${{ matrix.target }}
44+
run: pnpm lint:${{ matrix.target }}
4645

4746
test:
4847
name: Tests
@@ -52,26 +51,25 @@ jobs:
5251

5352
steps:
5453
- uses: actions/checkout@v2
54+
55+
- name: Install pnpm
56+
uses: pnpm/action-setup@v2.0.1
57+
with:
58+
version: 7.17.1
59+
5560
- uses: actions/setup-node@v2
5661
with:
5762
node-version: ${{ env.NODE_VERSION }}
63+
cache: "pnpm"
5864

59-
- uses: actions/cache@v2
60-
with:
61-
path: node_modules
62-
key: node-modules-v2-${{ hashFiles('yarn.lock') }}
63-
restore-keys: |
64-
node-modules-v2-${{ hashFiles('yarn.lock') }}
65-
node-modules-v2-
6665
- name: Install dependencies
67-
run: yarn install
66+
run: pnpm install
6867

6968
- name: Run tests
70-
run: yarn test
69+
run: pnpm test
7170
env:
7271
COVERAGE: true
7372

74-
7573
# TODO enable this again after flaky tests are added back
7674
# - name: Upload coverage report to Codecov
7775
# uses: codecov/codecov-action@v1

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
# misc
1212
/.sass-cache
13+
/.eslintcache
1314
/connect.lock
1415
/coverage/*
1516
/libpeerconnection.log
1617
npm-debug.log*
17-
yarn-error.log
1818
testem.log
1919
*.swp
2020
*.orig

.husky/commit-msg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
# lint commit message
5+
pnpm commitlint --edit $1

.husky/pre-commit

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# skip in CI
55
[ -n "$CI" ] && exit 0
66

7-
# lint commit message
8-
yarn commitlint --edit $1
7+
# lint staged files
8+
pnpm lint-staged

.template-lintrc-ci.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"use strict";
2+
3+
module.exports = {
4+
extends: "recommended",
5+
rules: {
6+
// following rules are for temporary use only, delete when ember 4.0 ready
7+
"no-action": "warn",
8+
"no-curly-component-invocation": "warn",
9+
"no-duplicate-id": "warn",
10+
"no-link-to-positional-params": "warn",
11+
"no-link-to-tagname": "warn",
12+
"no-invalid-interactive": "warn",
13+
"no-implicit-this": "warn",
14+
"no-passed-in-event-handlers": "warn",
15+
"no-positional-data-test-selectors": "warn",
16+
"no-unknown-arguments-for-builtin-components": "warn",
17+
"no-with": "warn",
18+
"no-yield-only": "warn",
19+
"require-input-label": "warn",
20+
"require-has-block-helper": "warn",
21+
},
22+
};

.template-lintrc.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,4 @@
22

33
module.exports = {
44
extends: "recommended",
5-
6-
rules: {
7-
// https://github.com/ember-template-lint/ember-template-lint/issues/509
8-
"attribute-indentation": false
9-
}
105
};

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You will need the following things properly installed on your computer.
1010

1111
- [Git](https://git-scm.com/)
1212
- [Node.js](https://nodejs.org/)
13-
- [Yarn](https://yarnpkg.com/)
13+
- [pnpm](https://pnpm.io/)
1414
- [Ember CLI](https://ember-cli.com/)
1515
- [Chrome](https://www.google.com/chrome/)
1616
- [Firefox](https://www.mozilla.org/firefox/)
@@ -24,7 +24,7 @@ Optional:
2424

2525
- `git clone git@github.com/adfinis-sygroup/timed-frontend`
2626
- `cd timed-frontend`
27-
- `yarn`
27+
- `pnpm i`
2828

2929
## Running / Development
3030

@@ -35,7 +35,7 @@ If you have a running [backend](https://github.com/adfinis-sygroup/timed-backend
3535

3636
- `ember server --proxy=http://localhost:8000`
3737
or
38-
- `yarn start`
38+
- `pnpm start`
3939

4040
If you are using docker-compose you can start a static frontend and the backend by following the instructions in the [backend](https://github.com/adfinis-sygroup/timed-backend)
4141

app/abilities/absence-credit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Ability } from "ember-can";
33

44
const AbsenceCreditAbility = Ability.extend({
55
canEdit: reads("user.isSuperuser"),
6-
canCreate: reads("user.isSuperuser")
6+
canCreate: reads("user.isSuperuser"),
77
});
88

99
export default AbsenceCreditAbility;

app/abilities/overtime-credit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Ability } from "ember-can";
33

44
const OvertimeCreditAbility = Ability.extend({
55
canEdit: reads("user.isSuperuser"),
6-
canCreate: reads("user.isSuperuser")
6+
canCreate: reads("user.isSuperuser"),
77
});
88

99
export default OvertimeCreditAbility;

app/abilities/page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { Ability } from "ember-can";
44
export default Ability.extend({
55
canAccess: computed(
66
"user.{activeEmployment.isExternal,isReviewer}",
7-
function() {
7+
function () {
88
return (
99
!this.get("user.activeEmployment.isExternal") ||
1010
(this.get("user.activeEmployment.isExternal") &&
1111
this.get("user.isReviewer"))
1212
);
1313
}
14-
)
14+
),
1515
});

app/abilities/report.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ import { Ability } from "ember-can";
33

44
export default Ability.extend({
55
canEdit: computed(
6+
// eslint-disable-next-line ember/use-brace-expansion
7+
"model.user.{id,supervisors}",
8+
"model.verifiedBy.id",
9+
"model.{billed,customerAssignees,projectAssignees,taskAssignees}",
610
"user.{id,isSuperuser}",
7-
"model.{user.id,user.supervisors,verifiedBy,billed,taskAssignees,projectAssignees,customerAssignees}",
8-
function() {
11+
function () {
912
const isEditable =
1013
this.get("user.isSuperuser") ||
1114
(!this.get("model.verifiedBy.id") &&
@@ -23,5 +26,5 @@ export default Ability.extend({
2326
.includes(this.get("user.id")) && !this.get("model.verifiedBy.id");
2427
return isEditable || isReviewer;
2528
}
26-
)
29+
),
2730
});

app/abilities/user.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ export default Ability.extend({
55
canRead: computed(
66
"user.{id,isSuperuser}",
77
"model.{id,supervisors}",
8-
function() {
8+
function () {
99
return (
1010
this.get("user.isSuperuser") ||
1111
this.get("user.id") === this.get("model.id") ||
12-
this.get("model.supervisors")
13-
.mapBy("id")
14-
.includes(this.get("user.id"))
12+
this.get("model.supervisors").mapBy("id").includes(this.get("user.id"))
1513
);
1614
}
17-
)
15+
),
1816
});

app/adapters/activity-block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ export default ApplicationAdapter.extend({
3939
*/
4040
urlForCreateRecord(...args) {
4141
return `${this._super(...args)}?include=activity`;
42-
}
42+
},
4343
});

app/adapters/application.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* @submodule timed-adapters
44
* @public
55
*/
6-
import DS from "ember-data";
7-
import OIDCAdapterMixin from "ember-simple-auth-oidc/mixins/oidc-adapter-mixin";
6+
import { inject as service } from "@ember/service";
7+
import OIDCJSONAPIAdapter from "ember-simple-auth-oidc/adapters/oidc-json-api-adapter";
88

99
/**
1010
* The application adapter
@@ -14,6 +14,12 @@ import OIDCAdapterMixin from "ember-simple-auth-oidc/mixins/oidc-adapter-mixin";
1414
* @uses EmberSimpleAuthOIDC.OIDCAdapterMixin
1515
* @public
1616
*/
17-
export default DS.JSONAPIAdapter.extend(OIDCAdapterMixin, {
18-
namespace: "api/v1"
19-
});
17+
export default class ApplicationAdapter extends OIDCJSONAPIAdapter {
18+
@service session;
19+
20+
namespace = "api/v1";
21+
22+
get headers() {
23+
return { ...this.session.headers };
24+
}
25+
}

0 commit comments

Comments
 (0)