Skip to content

Commit 7638fc8

Browse files
committed
fix(ember): migrate to pnpm
update dependencies run prettier, eslint fix test setup
1 parent 18dd78e commit 7638fc8

File tree

112 files changed

+14683
-16407
lines changed

Some content is hidden

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

112 files changed

+14683
-16407
lines changed

.github/dependabot.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
version: 2
22
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "friday"
8+
time: "12:00"
9+
timezone: "Europe/Zurich"
10+
311
- package-ecosystem: pip
412
directory: "/"
513
schedule:
@@ -14,6 +22,7 @@ updates:
1422
commit-message:
1523
prefix: chore
1624
include: scope
25+
1726
- package-ecosystem: docker
1827
directory: "/"
1928
schedule:
@@ -28,6 +37,7 @@ updates:
2837
commit-message:
2938
prefix: chore
3039
include: scope
40+
3141
- package-ecosystem: npm
3242
directory: "/ember"
3343
schedule:
@@ -44,7 +54,3 @@ updates:
4454
- dependency-name: graphql
4555
versions:
4656
- ">= 16"
47-
# https://github.com/ember-cli/ember-cli/issues/9307
48-
- dependency-name: eslint
49-
versions:
50-
- ">= 8"

.github/workflows/tests.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
api-tests:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
- name: Set UID
1818
run: echo "UID=$(id --user)" > .env
1919
- name: Build the containers
@@ -27,7 +27,7 @@ jobs:
2727
caluma-tests:
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v3
30+
- uses: actions/checkout@v4
3131
- name: Set UID
3232
run: echo "UID=$(id --user)" > .env
3333
- name: Build the containers
@@ -37,11 +37,11 @@ jobs:
3737
caluma-lint:
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4141
- name: Install poetry
4242
run: pipx install poetry
4343
- name: Setup Python
44-
uses: actions/setup-python@v4
44+
uses: actions/setup-python@v5
4545
with:
4646
python-version: '3.9'
4747
cache: 'poetry'
@@ -52,35 +52,35 @@ jobs:
5252
ember-test:
5353
runs-on: ubuntu-latest
5454
steps:
55-
- uses: actions/checkout@v3
56-
- uses: actions/setup-node@v3
55+
- uses: actions/checkout@v4
56+
- uses: wyvox/action-setup-pnpm@v3
5757
with:
58-
node-version: 16
58+
node-version: 18
5959
- name: Install dependencies
60-
run: yarn install
60+
run: pnpm install
6161
working-directory: ${{env.ember-dir}}
6262
- name: Lint the code
63-
run: yarn lint
63+
run: pnpm run lint
6464
working-directory: ${{env.ember-dir}}
6565
- name: Run tests
66-
run: yarn test:ember
66+
run: pnpm run test:ember
6767
working-directory: ${{env.ember-dir}}
6868
ember-build:
6969
runs-on: ubuntu-latest
7070
steps:
71-
- uses: actions/checkout@v3
71+
- uses: actions/checkout@v4
7272
- name: Set UID
7373
run: echo "UID=$(id --user)" > .env
7474
- name: Build and start the container
7575
run: docker compose up -d --build ember
7676
commit-lint:
7777
runs-on: ubuntu-latest
7878
steps:
79-
- uses: actions/checkout@v3
79+
- uses: actions/checkout@v4
8080
with:
8181
fetch-depth: 0
8282
- name: Setup Python
83-
uses: actions/setup-python@v4
83+
uses: actions/setup-python@v5
8484
with:
8585
python-version: '3.9'
8686
- name: Install gitlint

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ caluma-foreground: ## run caluma in foreground with dev server for debugging
9393

9494
.PHONY: ember-lint
9595
ember-lint: ## lint the frontend
96-
@docker compose run --rm ember yarn lint
96+
@docker compose run --rm ember pnpm run lint
9797

9898
.PHONY: ember-lint-fix
9999
ember-lint-fix: ## lint and fix the frontend
100-
@docker compose run --rm ember yarn lint:js --fix
100+
@docker compose run --rm ember pnpm run lint:js --fix
101101

102102
.PHONY: ember-test
103103
ember-test: ## test the frontend
104-
@docker compose run --rm ember yarn test:ember
104+
@docker compose run --rm ember pnpm run test:ember

ember/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22

33
module.exports = {
4-
extends: ["@adfinis-sygroup/eslint-config/ember-app"],
4+
extends: ["@adfinis/eslint-config/ember-app"],
55

66
settings: { "import/internal-regex": "^mysagw/" },
77

ember/Dockerfile

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
FROM danlynn/ember-cli:3.28.5 as build
1+
FROM danlynn/ember-cli:4.12.1 as build
22

33
ARG OIDC_HOST
44

5-
COPY package.json yarn.lock /myapp/
5+
COPY package.json pnpm-lock.yaml /myapp/
66

7-
RUN yarn install
7+
RUN npm install -g pnpm
8+
9+
RUN pnpm install
810

911
COPY . /myapp/
1012

11-
RUN yarn deploy production
13+
RUN pnpm run deploy production
1214

1315
FROM nginx:alpine
1416

ember/app/abilities/-base.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default class BaseAbility extends Ability {
4444
(member) =>
4545
member.authorized &&
4646
!member.isInactive &&
47-
this.isOwnIdentity(member.identity.get("idpId"))
47+
this.isOwnIdentity(member.identity.get("idpId")),
4848
);
4949
}
5050

@@ -55,8 +55,8 @@ export default class BaseAbility extends Ability {
5555
return Boolean(
5656
calumaCase.accesses.findBy(
5757
"identity.idpId",
58-
this.session.data.authenticated.userinfo.sub
59-
)
58+
this.session.data.authenticated.userinfo.sub,
59+
),
6060
);
6161
}
6262
}

ember/app/abilities/case.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class CaseAbility extends BaseAbility {
3737
*/
3838
return (
3939
ENV.APP.caluma.redoableTaskSlugs.includes(
40-
this.model.redoWorkItem?.task.slug
40+
this.model.redoWorkItem?.task.slug,
4141
) &&
4242
this.isStaffOrAdmin &&
4343
(this.model.canRedoWorkItem ||

ember/app/adapters/application.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ export default class ApplicationAdapter extends OIDCJSONAPIAdapter {
2929
urlForCreateRecord(modelName, snapshot) {
3030
return this._appendInclude(
3131
super.urlForCreateRecord(modelName, snapshot),
32-
snapshot.adapterOptions
32+
snapshot.adapterOptions,
3333
);
3434
}
3535

3636
urlForUpdateRecord(id, modelName, snapshot) {
3737
return this._appendInclude(
3838
super.urlForUpdateRecord(id, modelName, snapshot),
39-
snapshot.adapterOptions
39+
snapshot.adapterOptions,
4040
);
4141
}
4242

ember/app/caluma-query/models/case.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default class CustomCaseModel extends CaseModel {
3232
get hasEditableWorkItem() {
3333
return this.workItems
3434
.filter((workItem) =>
35-
ENV.APP.caluma.documentEditableTaskSlugs.includes(workItem.task.slug)
35+
ENV.APP.caluma.documentEditableTaskSlugs.includes(workItem.task.slug),
3636
)
3737
.isAny("status", "READY");
3838
}
@@ -42,7 +42,7 @@ export default class CustomCaseModel extends CaseModel {
4242
(workItem) =>
4343
(workItem.task.slug === ENV.APP.caluma.submitTaskSlug ||
4444
workItem.task.slug === ENV.APP.caluma.reviseTaskSlug) &&
45-
workItem.status === "READY"
45+
workItem.status === "READY",
4646
);
4747
}
4848

@@ -51,22 +51,22 @@ export default class CustomCaseModel extends CaseModel {
5151
return this.workItems.find(
5252
(workItem) =>
5353
workItem.status === "COMPLETED" &&
54-
workItem.task.slug === "decision-and-credit"
54+
workItem.task.slug === "decision-and-credit",
5555
);
5656
}
5757

5858
return this.workItems.find(
5959
(workItem) =>
6060
(workItem.status === "COMPLETED" || workItem.status === "SKIPPED") &&
61-
ENV.APP.caluma.redoableTaskSlugs.includes(workItem.task.slug)
61+
ENV.APP.caluma.redoableTaskSlugs.includes(workItem.task.slug),
6262
);
6363
}
6464

6565
get canRedoWorkItem() {
6666
return this.workItems.find(
6767
(workItem) =>
6868
workItem.status === "READY" &&
69-
ENV.APP.caluma.canRedoTaskSlug.includes(workItem.task.slug)
69+
ENV.APP.caluma.canRedoTaskSlug.includes(workItem.task.slug),
7070
);
7171
}
7272

@@ -77,14 +77,14 @@ export default class CustomCaseModel extends CaseModel {
7777
get documentNumber() {
7878
return this.document.answers.edges.findBy(
7979
"node.question.slug",
80-
"dossier-nr"
80+
"dossier-nr",
8181
)?.node.StringAnswerValue;
8282
}
8383

8484
get distributionPlan() {
8585
const answer = this.document.answers.edges.findBy(
8686
"node.question.slug",
87-
"verteilplan-nr"
87+
"verteilplan-nr",
8888
)?.node;
8989

9090
if (!answer) {
@@ -93,7 +93,7 @@ export default class CustomCaseModel extends CaseModel {
9393

9494
return answer.question.options.edges.findBy(
9595
"node.slug",
96-
answer.StringAnswerValue
96+
answer.StringAnswerValue,
9797
).node.label;
9898
}
9999

ember/app/caluma-query/models/work-item.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default class CustomWorkItemModel extends WorkItemModel {
4141

4242
get isAssignedToCurrentUser() {
4343
return this.assignedUsers.includes(
44-
this.session.data.authenticated.userinfo.sub
44+
this.session.data.authenticated.userinfo.sub,
4545
);
4646
}
4747

@@ -90,7 +90,7 @@ export default class CustomWorkItemModel extends WorkItemModel {
9090

9191
async assignToMe() {
9292
return await this.assignToUser(
93-
this.session.data.authenticated.userinfo.sub
93+
this.session.data.authenticated.userinfo.sub,
9494
);
9595
}
9696

ember/app/services/case-data.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class CaseDataService extends Service {
2222
variables: { filter: [{ id: caseId }] },
2323
fetchPolicy: "network-only",
2424
},
25-
"allCases.edges"
25+
"allCases.edges",
2626
);
2727

2828
const caseModel = new CustomCaseModel(caseEdges[0].node);
@@ -46,7 +46,7 @@ export default class CaseDataService extends Service {
4646
},
4747
fetchPolicy: "network-only",
4848
},
49-
"allWorkItems.edges"
49+
"allWorkItems.edges",
5050
);
5151

5252
this.circulation = circulation.firstObject;

ember/app/services/fetch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const CONTENT_TYPE = "application/vnd.api+json";
88
const cleanObject = (obj) =>
99
Object.fromEntries(
1010
// eslint-disable-next-line no-unused-vars
11-
Object.entries(obj).filter(([key, value]) => !isEmpty(value))
11+
Object.entries(obj).filter(([key, value]) => !isEmpty(value)),
1212
);
1313

1414
export default class FetchService extends Service {
@@ -42,7 +42,7 @@ export default class FetchService extends Service {
4242

4343
// throw an error containing a human readable message
4444
throw new Error(
45-
`Fetch request to URL ${response.url} returned ${response.status} ${response.statusText}:\n\n${body}`
45+
`Fetch request to URL ${response.url} returned ${response.status} ${response.statusText}:\n\n${body}`,
4646
);
4747
}
4848

ember/app/services/filtered-forms.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ export default class FilteredFormsService extends Service {
4545

4646
this.value = this.value.filter((form) => {
4747
const visibilities = ENV.APP.caluma.formVisibilities.map(
48-
(visibility) => form.meta[visibility] && userVisibilities[visibility]
48+
(visibility) => form.meta[visibility] && userVisibilities[visibility],
4949
);
5050
const publicVisibility = visibilities.every(
51-
(visibility) => visibility === undefined
51+
(visibility) => visibility === undefined,
5252
);
5353

5454
return publicVisibility || visibilities.any((visibility) => visibility);
@@ -64,7 +64,7 @@ export default class FilteredFormsService extends Service {
6464
query: getFormsQuery,
6565
variables,
6666
},
67-
"allForms.edges"
67+
"allForms.edges",
6868
)
6969
).map((form) => form.node);
7070
}

ember/app/services/session.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class CustomSession extends Session {
2424
{
2525
include: "organisation",
2626
},
27-
{ adapterOptions: { customEndpoint: "my-memberships" } }
27+
{ adapterOptions: { customEndpoint: "my-memberships" } },
2828
),
2929
this.store.queryRecord("identity", {}),
3030
]);
@@ -48,9 +48,9 @@ export default class CustomSession extends Session {
4848
this.identity?.memberships.find(
4949
(membership) =>
5050
ENV.APP.circulationOrganisations.includes(
51-
membership.organisation.get("organisationName")
52-
) && !membership.isInactive
53-
)
51+
membership.organisation.get("organisationName"),
52+
) && !membership.isInactive,
53+
),
5454
);
5555
}
5656
}

ember/app/ui/cases/detail/circulation/controller.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default class CasesDetailCirculationController extends Controller {
8282
get finishCirculationWorkItem() {
8383
return this.circulationWorkItemsQuery.value.findBy(
8484
"task.slug",
85-
"finish-circulation"
85+
"finish-circulation",
8686
);
8787
}
8888

@@ -98,7 +98,7 @@ export default class CasesDetailCirculationController extends Controller {
9898
}
9999

100100
return this.workItemsQuery.value.every(
101-
(workItem) => workItem.raw.status === "COMPLETED"
101+
(workItem) => workItem.raw.status === "COMPLETED",
102102
);
103103
}
104104

0 commit comments

Comments
 (0)