Skip to content

Commit

Permalink
Merge branch 'dev' into renovate/e2e-npm-jsonwebtoken-vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
lego-technix authored Oct 1, 2024
2 parents d15bdc0 + 53a7611 commit 72c7e11
Show file tree
Hide file tree
Showing 2,409 changed files with 78,958 additions and 67,889 deletions.
36 changes: 27 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@

version: 2.1

parameters:
GHA_Actor:
type: string
default: ''
GHA_Action:
type: string
default: ''
GHA_Event:
type: string
default: ''
GHA_Meta:
type: string
default: ''

orbs:
browser-tools: circleci/[email protected]

Expand All @@ -29,7 +43,7 @@ executors:
parameters:
node-version:
# renovate datasource=node-version depName=node
default: 20.16.0
default: 20.17.0
type: string
docker:
- image: cimg/node:<<parameters.node-version>>
Expand All @@ -38,24 +52,24 @@ executors:
parameters:
node-version:
# renovate datasource=node-version depName=node
default: 20.16.0
default: 20.17.0
type: string
docker:
- image: cimg/node:<<parameters.node-version>>
- image: postgres:15.7-alpine
- image: postgres:15.8-alpine
environment:
POSTGRES_USER: circleci
POSTGRES_HOST_AUTH_METHOD: trust
- image: redis:7.2.5-alpine
- image: adobe/s3mock:3.9.1
- image: adobe/s3mock:3.10.1
environment:
- initialBuckets=pix-import-test
resource_class: small
node-browsers-docker:
parameters:
node-version:
# renovate datasource=node-version depName=node
default: 20.16.0
default: 20.17.0
type: string
docker:
- image: cimg/node:<<parameters.node-version>>-browsers
Expand All @@ -66,11 +80,11 @@ executors:
parameters:
node-version:
# renovate datasource=node-version depName=node
default: 20.16.0
default: 20.17.0
type: string
docker:
- image: cimg/node:<<parameters.node-version>>-browsers
- image: postgres:15.7-alpine
- image: postgres:15.8-alpine
environment:
POSTGRES_USER: circleci
POSTGRES_HOST_AUTH_METHOD: trust
Expand All @@ -80,11 +94,11 @@ executors:
parameters:
node-version:
# renovate datasource=node-version depName=node
default: 20.16.0
default: 20.17.0
type: string
docker:
- image: cimg/node:<<parameters.node-version>>
- image: postgres:15.7-alpine
- image: postgres:15.8-alpine
environment:
POSTGRES_USER: circleci
POSTGRES_HOST_AUTH_METHOD: trust
Expand All @@ -93,6 +107,10 @@ executors:
workflows:
version: 2
build-and-test:
# This workflow is set to be conditionally triggered, only when
# the GitHub Action is triggered.
# With no other workflows, normal push events will be ignored currently.
when: << pipeline.parameters.GHA_Action >>
jobs:
- checkout:
context: Pix
Expand Down
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
/api/src/devcomp/ @1024pix/team-devcomp
/api/tests/devcomp/ @1024pix/team-devcomp

/mon-pix/app/components/module/ @1024pix/team-devcomp
/mon-pix/app/components/training/ @1024pix/team-devcomp
/mon-pix/app/components/tutorial/ @1024pix/team-devcomp

/admin/app/components/trainings/ @1024pix/team-devcomp


# Directories maintained by team Certification
/api/src/certification/ @1024pix/team-certification
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/trigger-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Trigger CircleCI

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push:
branches: dev

jobs:
trigger-ci:
runs-on: ubuntu-latest

steps:
- name: Trigger CircleCI
# ensure PR is not draft
if: '! github.event.pull_request.draft'
uses: CircleCI-Public/[email protected]
env:
CCI_TOKEN: ${{ secrets.PIX_SERVICE_CIRCLE_CI_TOKEN }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.16.0
20.17.0
447 changes: 447 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.16.0
20.17.0
26 changes: 26 additions & 0 deletions admin/app/adapters/admin-member.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,30 @@ export default class AdminMemberAdapter extends ApplicationAdapter {

return super.urlForQueryRecord(...arguments);
}

urlForDeactivateMember(adminMemberId) {
return `${this.host}/${this.namespace}/admin-members/${adminMemberId}/deactivate`;
}

urlForUpdateRole(adminMemberId) {
return `${this.host}/${this.namespace}/admin-members/${adminMemberId}`;
}

updateRecord(store, type, snapshot) {
if (snapshot.adapterOptions.method === 'deactivate') {
return this.ajax(this.urlForDeactivateMember(snapshot.id), 'PUT');
} else if (snapshot.adapterOptions.method === 'updateRole') {
const serializedSnapshot = this.serialize(snapshot);

const payload = {
data: {
attributes: {
role: serializedSnapshot.data.attributes.role,
},
},
};

return this.ajax(this.urlForUpdateRole(snapshot.id), 'PATCH', { data: payload });
}
}
}
37 changes: 32 additions & 5 deletions admin/app/adapters/certification-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,38 @@ export default class CertificationDetails extends ApplicationAdapter {
return `${this.host}/${this.namespace}/admin/certifications/${id}/details`;
}

buildURL(modelName, id, snapshot, requestType, query) {
if (requestType === 'challenge-neutralization') {
return `${this.host}/${this.namespace}/admin/certification/`;
} else {
return super.buildURL(modelName, id, snapshot, requestType, query);
urlForNeutralizeChallenge() {
return `${this.host}/${this.namespace}/admin/certification/neutralize-challenge`;
}

urlForDeneutralizeChallenge() {
return `${this.host}/${this.namespace}/admin/certification/deneutralize-challenge`;
}

updateRecord(store, type, snapshot) {
if (snapshot.adapterOptions.isNeutralizeChallenge) {
const payload = {
data: {
attributes: {
certificationCourseId: snapshot.adapterOptions.certificationCourseId,
challengeRecId: snapshot.adapterOptions.challengeRecId,
},
},
};

return this.ajax(this.urlForNeutralizeChallenge(snapshot.id), 'POST', { data: payload });
}
if (snapshot.adapterOptions.isDeneutralizeChallenge) {
const payload = {
data: {
attributes: {
certificationCourseId: snapshot.adapterOptions.certificationCourseId,
challengeRecId: snapshot.adapterOptions.challengeRecId,
},
},
};

return this.ajax(this.urlForDeneutralizeChallenge(snapshot.id), 'POST', { data: payload });
}
}
}
21 changes: 21 additions & 0 deletions admin/app/adapters/certification-issue-report.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import ApplicationAdapter from './application';

export default class CertificationIssueReportAdapter extends ApplicationAdapter {
namespace = 'api/';

urlForUpdateRecord(certificationIssueReportId) {
return `${this.host}/api/certification-issue-reports/${certificationIssueReportId}`;
}

updateRecord(store, type, snapshot) {
if (snapshot.adapterOptions.resolutionLabel) {
const payload = {
data: {
resolution: snapshot.adapterOptions.resolutionLabel,
},
};

return this.ajax(this.urlForUpdateRecord(snapshot.id), 'PATCH', { data: payload });
}
}
}
50 changes: 39 additions & 11 deletions admin/app/adapters/certification.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@ export default class Certification extends ApplicationAdapter {
return `${this.host}/${this.namespace}/admin/certification-courses/${certificationCourseId}`;
}

urlForCancelCertification(certificationCourseId) {
return `${this.host}/${this.namespace}/admin/certification-courses/${certificationCourseId}/cancel`;
}

urlForUncancelCertification(certificationCourseId) {
return `${this.host}/${this.namespace}/admin/certification-courses/${certificationCourseId}/uncancel`;
}

urlForRejectCertification(certificationCourseId) {
return `${this.host}/${this.namespace}/admin/certification-courses/${certificationCourseId}/reject`;
}

urlForUnrejectCertification(certificationCourseId) {
return `${this.host}/${this.namespace}/admin/certification-courses/${certificationCourseId}/unreject`;
}

urlForEditJuryLevel() {
return `${this.host}/${this.namespace}/admin/complementary-certification-course-results`;
}

updateRecord(store, type, snapshot) {
if (snapshot.adapterOptions.updateJuryComment) {
const {
Expand All @@ -26,6 +46,25 @@ export default class Certification extends ApplicationAdapter {
},
};
return this.ajax(this.urlForUpdateJuryComment(snapshot.id), 'POST', { data: payload });
} else if (snapshot.adapterOptions.isCertificationCancel) {
return this.ajax(this.urlForCancelCertification(snapshot.id), 'PATCH');
} else if (snapshot.adapterOptions.isCertificationUncancel) {
return this.ajax(this.urlForUncancelCertification(snapshot.id), 'PATCH');
} else if (snapshot.adapterOptions.isCertificationReject) {
return this.ajax(this.urlForRejectCertification(snapshot.id), 'PATCH');
} else if (snapshot.adapterOptions.isCertificationUnreject) {
return this.ajax(this.urlForUnrejectCertification(snapshot.id), 'PATCH');
} else if (snapshot.adapterOptions.isJuryLevelEdit) {
const payload = {
data: {
attributes: {
juryLevel: snapshot.adapterOptions.juryLevel,
complementaryCertificationCourseId: snapshot.adapterOptions.complementaryCertificationCourseId,
},
},
};

return this.ajax(this.urlForEditJuryLevel(snapshot.id), 'POST', { data: payload });
} else {
const data = {};
const serializer = store.serializerFor(type.modelName);
Expand All @@ -41,15 +80,4 @@ export default class Certification extends ApplicationAdapter {
}
return hash;
}

buildURL(modelName, id, snapshot, requestType, query) {
if (['cancel', 'uncancel', 'reject', 'unreject'].includes(requestType)) {
return `${this.host}/${this.namespace}/admin/certification-courses/${id}/${requestType}`;
}

if (requestType === 'edit-jury-level') {
return `${this.host}/${this.namespace}/admin/complementary-certification-course-results`;
}
return super.buildURL(modelName, id, snapshot, requestType, query);
}
}
10 changes: 10 additions & 0 deletions admin/app/adapters/organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ export default class OrganizationAdapter extends ApplicationAdapter {
return super.updateRecord(...arguments);
}

async attachTargetProfile(options) {
const { organizationId } = options;
const payload = {
'target-profile-ids': options.targetProfileIds,
};

const url = `${this.host}/${this.namespace}/organizations/${organizationId}/attach-target-profiles`;
return this.ajax(url, 'POST', { data: payload });
}

attachChildOrganization({ childOrganizationId, parentOrganizationId }) {
const url = `${this.host}/${this.namespace}/organizations/${parentOrganizationId}/attach-child-organization`;
return this.ajax(url, 'POST', { data: { childOrganizationId } });
Expand Down
20 changes: 14 additions & 6 deletions admin/app/adapters/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,35 @@ export default class SessionAdapter extends ApplicationAdapter {
return `${this.host}/${this.namespace}/admin/sessions/${id}`;
}

getDownloadLink({ id, lang }) {
const link = `${this.host}/${this.namespace}/admin/sessions/${id}/generate-results-download-link?lang=${lang}`;
return this.ajax(link, 'GET');
}

updateRecord(store, type, snapshot) {
if (snapshot.adapterOptions.flagResultsAsSentToPrescriber) {
const url = this.urlForUpdateRecord(snapshot.id, type.modelName, snapshot) + '/results-sent-to-prescriber';
return this.ajax(url, 'PUT');
}
if (snapshot.adapterOptions.updatePublishedCertifications) {
} else if (snapshot.adapterOptions.updatePublishedCertifications) {
let url;
if (snapshot.adapterOptions.toPublish) {
url = this.urlForUpdateRecord(snapshot.id, type.modelName, snapshot) + '/publish';
} else {
url = this.urlForUpdateRecord(snapshot.id, type.modelName, snapshot) + '/unpublish';
}
return this.ajax(url, 'PATCH');
}
if (snapshot.adapterOptions.certificationOfficerAssignment) {
} else if (snapshot.adapterOptions.certificationOfficerAssignment) {
const url = this.urlForUpdateRecord(snapshot.id, type.modelName, snapshot) + '/certification-officer-assignment';
return this.ajax(url, 'PATCH');
}
if (snapshot.adapterOptions.unfinalize) {
} else if (snapshot.adapterOptions.unfinalize) {
const url = this.urlForUpdateRecord(snapshot.id, type.modelName, snapshot) + '/unfinalize';
return this.ajax(url, 'PATCH');
} else if (snapshot.adapterOptions.isComment) {
const url = this.urlForUpdateRecord(snapshot.id, type.modelName, snapshot) + '/comment';
return this.ajax(url, 'PUT', { data: { 'jury-comment': snapshot.adapterOptions.comment } });
} else if (snapshot.adapterOptions.isDeleteComment) {
const url = this.urlForUpdateRecord(snapshot.id, type.modelName, snapshot) + '/comment';
return this.ajax(url, 'DELETE');
}

return super.updateRecord(...arguments);
Expand Down
27 changes: 27 additions & 0 deletions admin/app/adapters/target-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,33 @@ export default class TargetProfileAdapter extends ApplicationAdapter {
return result.data.attributes['detached-organization-ids'];
}

async attachOrganizations({ targetProfileId, organizationIds }) {
const url = `${this.host}/${this.namespace}/target-profiles/${targetProfileId}/attach-organizations`;
const result = await this.ajax(url, 'POST', {
data: { 'organization-ids': organizationIds },
});
return result;
}

async attachOrganizationsFromExistingTargetProfile(options) {
const { targetProfileId } = options;
const payload = {
'target-profile-id': options.targetProfileIdToCopy,
};
const url = `${this.host}/${this.namespace}/target-profiles/${targetProfileId}/copy-organizations`;
return this.ajax(url, 'POST', { data: payload });
}

async outdate(targetProfileId) {
const url = `${this.host}/${this.namespace}/target-profiles/${targetProfileId}/outdate`;
return this.ajax(url, 'PUT');
}

async copy(targetProfileId) {
const url = `${this.host}/${this.namespace}/target-profiles/${targetProfileId}/copy`;
return this.ajax(url, 'POST');
}

urlForQueryRecord(query) {
if (query.targetProfileId) {
const { targetProfileId } = query;
Expand Down
Loading

0 comments on commit 72c7e11

Please sign in to comment.