Skip to content

Commit

Permalink
feat(admin): remove unused updatedAt value
Browse files Browse the repository at this point in the history
  • Loading branch information
P-Jeremy committed Jan 29, 2025
1 parent 6afe5db commit 5fdbb3c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
2 changes: 0 additions & 2 deletions admin/app/components/users/user-organization-memberships.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default class UserOrganizationMemberships extends Component {
<th>Nom</th>
<th>Type</th>
<th>Identifiant externe</th>
<th>Dernière modification</th>
<th>Rôle</th>
{{#if this.accessControl.hasAccessToOrganizationActionsScope}}
<th>Actions</th>
Expand All @@ -47,7 +46,6 @@ export default class UserOrganizationMemberships extends Component {
<td>{{organizationMembership.organizationName}}</td>
<td>{{organizationMembership.organizationType}}</td>
<td>{{organizationMembership.organizationExternalId}}</td>
<td>{{dayjsFormat organizationMembership.updatedAt "DD/MM/YYYY [-] HH:mm"}}</td>
<ActionsOnUsersRoleInOrganization @organizationMembership={{organizationMembership}} />
</tr>
{{/each}}
Expand Down
1 change: 0 additions & 1 deletion admin/app/models/organization-membership.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const ROLE_LABELS = {
};

export default class OrganizationMembership extends Model {
@attr() updatedAt;
@attr() disabledAt;
@attr() organizationRole;
@attr() organizationId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,12 @@ module('Integration | Component | users | organization-memberships', function (h
this.owner.register('service:accessControl', SessionStub);
const dayjsService = this.owner.lookup('service:dayjs');

const membershipUpdatedAt1 = new Date('2023-12-05T08:00:00Z');
const membershipUpdatedAt2 = new Date('2023-12-05T09:00:00Z');
const organizationMembership1 = EmberObject.create({
id: 111,
role: 'MEMBER',
organizationId: 100025,
organizationName: 'Dragon & Co',
organizationType: 'PRO',
updatedAt: membershipUpdatedAt1,
});

const organizationMembership2 = EmberObject.create({
Expand All @@ -55,7 +52,6 @@ module('Integration | Component | users | organization-memberships', function (h
organizationName: 'Collège The Night Watch',
organizationType: 'SCO',
organizationExternalId: '1237457A',
updatedAt: membershipUpdatedAt2,
});

const organizationMemberships = [organizationMembership1, organizationMembership2];
Expand All @@ -66,24 +62,19 @@ module('Integration | Component | users | organization-memberships', function (h
);

// then
const formattedUpdatedAt1 = dayjsService.self(membershipUpdatedAt1).format('DD/MM/YYYY [-] HH:mm');
const formattedUpdatedAt2 = dayjsService.self(membershipUpdatedAt2).format('DD/MM/YYYY [-] HH:mm');

const rows = await screen.findAllByRole('row');
assert.dom(within(rows[1]).getByRole('cell', { name: '222' })).exists();
assert.dom(within(rows[1]).getByRole('cell', { name: '100095' })).exists();
assert.dom(within(rows[1]).getByRole('cell', { name: 'Collège The Night Watch' })).exists();
assert.dom(within(rows[1]).getByRole('cell', { name: 'SCO' })).exists();
assert.dom(within(rows[1]).getByRole('cell', { name: '1237457A' })).exists();
assert.dom(within(rows[1]).getByRole('cell', { name: formattedUpdatedAt2 })).exists();

assert.dom(within(rows[2]).getByRole('cell', { name: '111' })).exists();

assert.dom(within(rows[2]).getByRole('cell', { name: '111' })).exists();
assert.dom(within(rows[2]).getByRole('cell', { name: '100025' })).exists();
assert.dom(within(rows[2]).getByRole('cell', { name: 'Dragon & Co' })).exists();
assert.dom(within(rows[2]).getByRole('cell', { name: 'PRO' })).exists();
assert.dom(within(rows[2]).getByRole('cell', { name: formattedUpdatedAt1 })).exists();
});
});
});

0 comments on commit 5fdbb3c

Please sign in to comment.