Skip to content

Commit

Permalink
[TECH] Supprimer les warnings des dépréciations pour la v6.0 de Ember…
Browse files Browse the repository at this point in the history
…-Data (PIX-13216).

 #9408
  • Loading branch information
pix-service-auto-merge authored Jul 1, 2024
2 parents bacdbda + 2823597 commit d007ed4
Show file tree
Hide file tree
Showing 41 changed files with 155 additions and 150 deletions.
2 changes: 1 addition & 1 deletion certif/app/models/session-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class Session extends Model {
@attr('boolean') hasIncident;
@attr('boolean') hasJoiningIssue;
@attr('number') version;
@hasMany('certificationReport', { async: true, inverse: null }) certificationReports;
@hasMany('certification-report', { async: true, inverse: null }) certificationReports;

get isFinalized() {
return this.status === FINALIZED || this.status === IN_PROCESS || this.status === PROCESSED;
Expand Down
1 change: 1 addition & 0 deletions certif/app/services/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-data/store';
1 change: 1 addition & 0 deletions certif/app/transforms/boolean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { BooleanTransform as default } from '@ember-data/serializer/transform';
1 change: 1 addition & 0 deletions certif/app/transforms/date.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DateTransform as default } from '@ember-data/serializer/transform';
1 change: 1 addition & 0 deletions certif/app/transforms/number.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { NumberTransform as default } from '@ember-data/serializer/transform';
1 change: 1 addition & 0 deletions certif/app/transforms/string.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { StringTransform as default } from '@ember-data/serializer/transform';
2 changes: 1 addition & 1 deletion certif/tests/acceptance/login-session-supervisor_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module('Acceptance | Login session supervisor', function (hooks) {
});
await authenticateSession(certificationPointOfContact.id);

server.create('session-for-supervising', { id: 12345 });
server.create('session-for-supervising', { id: '12345' });
});

test('should display current user email and a change account button', async function (assert) {
Expand Down
4 changes: 2 additions & 2 deletions certif/tests/acceptance/session-supervising_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module('Acceptance | Session supervising', function (hooks) {
id: sessionId,
certificationCandidates: [
server.create('certification-candidate-for-supervising', {
id: 123,
id: '123',
firstName: 'John',
lastName: 'Doe',
birthdate: '1984-05-28',
Expand Down Expand Up @@ -131,7 +131,7 @@ module('Acceptance | Session supervising', function (hooks) {
id: sessionId,
certificationCandidates: [
server.create('certification-candidate-for-supervising', {
id: 123,
id: '123',
firstName: 'John',
lastName: 'Doe',
birthdate: '1984-05-28',
Expand Down
2 changes: 1 addition & 1 deletion certif/tests/acceptance/supervisor-portal-access_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module('Acceptance | Supervisor Portal', function (hooks) {
});
await authenticateSession(certificationPointOfContact.id);

server.create('session-for-supervising', { id: 12345 });
server.create('session-for-supervising', { id: '12345' });
});

module('When supervisor authentication is successful', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module('Integration | Component | certification-candidate-details-modal', functi
birthPostalCode: 76260,
sex: 'F',
complementaryCertification: {
id: 1,
id: '1',
label: 'Pix+Edu',
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ module('Integration | Component | enrolled-candidates', function (hooks) {
});

function _buildCertificationCandidate({
id = 12345,
id = '12345',
firstName = 'Bob',
lastName = 'Leponge',
birthdate = new Date(),
Expand All @@ -315,7 +315,7 @@ function _buildCertificationCandidate({
extraTimePercentage = 0.3,
isLinked = false,
complementaryCertification = {
id: 2,
id: '2',
label: 'Pix+Droit',
},
billingMode = null,
Expand Down
24 changes: 12 additions & 12 deletions certif/tests/integration/components/members-list-item_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ module('Integration | Component | MembersListItem', function (hooks) {
test('it shows member firstName, lastName, role and manage button', async function (assert) {
// given
const memberWithMemberRole = store.createRecord('member', {
id: 123,
id: '123',
firstName: 'John',
lastName: 'Williams',
role: 'MEMBER',
});

sinon.stub(currentUser, 'certificationPointOfContact').value({ id: 1 });
sinon.stub(currentUser, 'certificationPointOfContact').value({ id: '1' });
this.set('member', memberWithMemberRole);

// when
Expand All @@ -113,13 +113,13 @@ module('Integration | Component | MembersListItem', function (hooks) {
test('it shows `edit role` and `delete` actions', async function (assert) {
// given
const memberWithMemberRole = store.createRecord('member', {
id: 123,
id: '123',
firstName: 'John',
lastName: 'Williams',
role: 'MEMBER',
});

sinon.stub(currentUser, 'certificationPointOfContact').value({ id: 1 });
sinon.stub(currentUser, 'certificationPointOfContact').value({ id: '1' });
this.set('member', memberWithMemberRole);

const screen = await renderScreen(
Expand All @@ -141,7 +141,7 @@ module('Integration | Component | MembersListItem', function (hooks) {
test('it shows member firstName, lastName, role but does not show manage button', async function (assert) {
// given
const memberWithMemberRole = store.createRecord('member', {
id: 123,
id: '123',
firstName: 'John',
lastName: 'Williams',
role: 'MEMBER',
Expand Down Expand Up @@ -169,7 +169,7 @@ module('Integration | Component | MembersListItem', function (hooks) {
test('shows manage button', async function (assert) {
// given
const memberWithAdminRole = store.createRecord('member', {
id: 123,
id: '123',
firstName: 'John',
lastName: 'Williams',
role: 'ADMIN',
Expand All @@ -191,7 +191,7 @@ module('Integration | Component | MembersListItem', function (hooks) {
test('displays a dropdown with one option to leave the current certification center', async function (assert) {
// given
const memberWithAdminRole = store.createRecord('member', {
id: 123,
id: '123',
firstName: 'John',
lastName: 'Williams',
role: 'ADMIN',
Expand All @@ -218,7 +218,7 @@ module('Integration | Component | MembersListItem', function (hooks) {
test('calls the onLeaveCertificationCenterButtonClicked event handler', async function (assert) {
// given
const memberWithAdminRole = store.createRecord('member', {
id: 123,
id: '123',
firstName: 'John',
lastName: 'Williams',
role: 'ADMIN',
Expand Down Expand Up @@ -249,13 +249,13 @@ module('Integration | Component | MembersListItem', function (hooks) {
module('when mode edition is enabled', function (hooks) {
hooks.beforeEach(function () {
const memberWithMemberRole = store.createRecord('member', {
id: 123,
id: '123',
firstName: 'John',
lastName: 'Williams',
role: 'MEMBER',
});

sinon.stub(currentUser, 'certificationPointOfContact').value({ id: 1 });
sinon.stub(currentUser, 'certificationPointOfContact').value({ id: '1' });
this.set('member', memberWithMemberRole);
});

Expand Down Expand Up @@ -311,12 +311,12 @@ module('Integration | Component | MembersListItem', function (hooks) {
module('When remove member button is clicked', (hooks) => {
hooks.beforeEach(async function () {
const memberWithMemberRole = store.createRecord('member', {
id: 123,
id: '123',
firstName: 'John',
lastName: 'Williams',
role: 'MEMBER',
});
sinon.stub(currentUser, 'certificationPointOfContact').value({ id: 1 });
sinon.stub(currentUser, 'certificationPointOfContact').value({ id: '1' });
this.set('member', memberWithMemberRole);

await renderScreen(
Expand Down
6 changes: 3 additions & 3 deletions certif/tests/integration/components/members-list_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,19 @@ module('Integration | Component | MembersList', function (hooks) {
module('when clicking on "Quitter cet espace Pix Certif"', function (hooks) {
hooks.beforeEach(function () {
const connectedUserWithAdminRole = store.createRecord('member', {
id: 1,
id: '1',
firstName: 'Jacques',
lastName: 'Ouzi',
role: 'ADMIN',
});
const memberWithAdminRole = store.createRecord('member', {
id: 2,
id: '2',
firstName: 'Annie',
lastName: 'Versaire',
role: 'ADMIN',
});
const memberWithMemberRole = store.createRecord('member', {
id: 3,
id: '3',
firstName: 'Franck',
lastName: 'Ofone',
role: 'MEMBER',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module('Integration | Component | new-candidate-modal', function (hooks) {
class CurrentUserStub extends Service {
currentAllowedCertificationCenterAccess = store.createRecord('allowed-certification-center-access', {
habilitations: [
{ id: 0, label: 'Certif complémentaire 1', key: 'COMP_1', hasComplementaryReferential: false },
{ id: 1, label: 'Certif complémentaire 2', key: 'COMP_2', hasComplementaryReferential: true },
{ id: '0', label: 'Certif complémentaire 1', key: 'COMP_1', hasComplementaryReferential: false },
{ id: '1', label: 'Certif complémentaire 2', key: 'COMP_2', hasComplementaryReferential: true },
],
isComplementaryAlonePilot: false,
});
Expand Down Expand Up @@ -254,9 +254,9 @@ module('Integration | Component | new-candidate-modal', function (hooks) {
const updateCandidateStub = sinon.stub();
const updateCandidateWithEventStub = sinon.stub();
const countries = [
{ id: 1, code: '99123', name: 'Syldavie' },
{ id: 2, code: '99100', name: 'France' },
{ id: 3, code: '99345', name: 'Botswana' },
{ id: '1', code: '99123', name: 'Syldavie' },
{ id: '2', code: '99100', name: 'France' },
{ id: '3', code: '99345', name: 'Botswana' },
];
const candidateData = {
firstName: '',
Expand Down Expand Up @@ -550,8 +550,8 @@ module('Integration | Component | new-candidate-modal', function (hooks) {
class CurrentUserStub extends Service {
currentAllowedCertificationCenterAccess = store.createRecord('allowed-certification-center-access', {
habilitations: [
{ id: 0, label: 'Certif complémentaire 1', key: 'COMP_1', hasComplementaryReferential: false },
{ id: 1, label: 'Certif complémentaire 2', key: 'COMP_2', hasComplementaryReferential: true },
{ id: '0', label: 'Certif complémentaire 1', key: 'COMP_1', hasComplementaryReferential: false },
{ id: '1', label: 'Certif complémentaire 2', key: 'COMP_2', hasComplementaryReferential: true },
],
isComplementaryAlonePilot: true,
});
Expand Down Expand Up @@ -606,8 +606,8 @@ module('Integration | Component | new-candidate-modal', function (hooks) {
class CurrentUserStub extends Service {
currentAllowedCertificationCenterAccess = store.createRecord('allowed-certification-center-access', {
habilitations: [
{ id: 0, label: 'Certif complémentaire 1', key: 'COMP_1', hasComplementaryReferential: false },
{ id: 1, label: 'Certif complémentaire 2', key: 'COMP_2', hasComplementaryReferential: true },
{ id: '0', label: 'Certif complémentaire 1', key: 'COMP_1', hasComplementaryReferential: false },
{ id: '1', label: 'Certif complémentaire 2', key: 'COMP_2', hasComplementaryReferential: true },
],
isComplementaryAlonePilot: true,
});
Expand Down Expand Up @@ -663,8 +663,8 @@ module('Integration | Component | new-candidate-modal', function (hooks) {
class CurrentUserStub extends Service {
currentAllowedCertificationCenterAccess = store.createRecord('allowed-certification-center-access', {
habilitations: [
{ id: 0, label: 'Certif complémentaire 1', key: 'COMP_1', hasComplementaryReferential: false },
{ id: 1, label: 'Certif complémentaire 2', key: 'COMP_2', hasComplementaryReferential: true },
{ id: '0', label: 'Certif complémentaire 1', key: 'COMP_1', hasComplementaryReferential: false },
{ id: '1', label: 'Certif complémentaire 2', key: 'COMP_2', hasComplementaryReferential: true },
],
isComplementaryAlonePilot: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ module('Integration | Component | SessionFinalization::UncompletedReportsInforma
const store = this.owner.lookup('service:store');
this.set('issueReportDescriptionMaxLength', 500);
const certificationReport = store.createRecord('certification-report', {
id: 1234,
id: '1234',
isCompleted: false,
abort: sinon.stub(),
});
Expand Down
Loading

0 comments on commit d007ed4

Please sign in to comment.