-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Pouvoir faire une recherche exacte d'utilisateurs dans Pix …
- Loading branch information
Showing
18 changed files
with
470 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
.user-list-form { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 8px; | ||
gap: var(--pix-spacing-2x); | ||
justify-content: flex-end; | ||
|
||
.pix-select { | ||
min-width: 7.5rem; | ||
margin-right: var(--pix-spacing-2x); | ||
} | ||
|
||
.pix-select .pix-icon { | ||
width: 1.315rem; | ||
height: 1.315rem; | ||
|
||
} | ||
|
||
&__input--small { | ||
max-width: 190px; | ||
max-width: 9.35rem; | ||
} | ||
|
||
&__actions { | ||
display: flex; | ||
gap: 8px; | ||
gap: var(--pix-spacing-2x); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,12 @@ import { setupApplicationTest } from 'ember-qunit'; | |
import { authenticateAdminMemberWithRole } from 'pix-admin/tests/helpers/test-init'; | ||
import { module, test } from 'qunit'; | ||
|
||
import setupIntl from '../../../helpers/setup-intl'; | ||
|
||
module('Acceptance | authenticated/users | list', function (hooks) { | ||
setupApplicationTest(hooks); | ||
setupMirage(hooks); | ||
setupIntl(hooks); | ||
|
||
module('When user is not logged in', function () { | ||
test('it should not be accessible by an unauthenticated user', async function (assert) { | ||
|
@@ -171,7 +174,7 @@ module('Acceptance | authenticated/users | list', function (hooks) { | |
assert.strictEqual(currentURL(), '/users/list'); | ||
}); | ||
|
||
test('should empty all search fields', async function (assert) { | ||
test('empties all search fields and resets query type to "Contains"', async function (assert) { | ||
// given | ||
await authenticateAdminMemberWithRole({ isSuperAdmin: true })(server); | ||
|
||
|
@@ -182,6 +185,9 @@ module('Acceptance | authenticated/users | list', function (hooks) { | |
identifiant: 'emma123', | ||
}); | ||
const screen = await visit('/users/list'); | ||
await click(screen.getByRole('button', { name: 'Contient' })); | ||
await screen.findByRole('listbox'); | ||
await click(screen.getByRole('option', { name: 'Exacte' })); | ||
await fillIn(screen.getByRole('textbox', { name: 'Nom' }), 'sardine'); | ||
await fillIn(screen.getByRole('textbox', { name: 'Adresse e-mail' }), '[email protected]'); | ||
await fillIn(screen.getByRole('textbox', { name: 'Identifiant' }), 'emma123'); | ||
|
@@ -194,6 +200,8 @@ module('Acceptance | authenticated/users | list', function (hooks) { | |
assert.dom(screen.getByRole('textbox', { name: 'Nom' })).hasNoValue(); | ||
assert.dom(screen.getByRole('textbox', { name: 'Adresse e-mail' })).hasNoValue(); | ||
assert.dom(screen.getByRole('textbox', { name: 'Identifiant' })).hasNoValue(); | ||
assert.dom(screen.getByRole('button', { name: 'Contient' })).exists(); | ||
assert.dom(screen.queryByRole('button', { name: 'Exacte' })).doesNotExist(); | ||
}); | ||
|
||
test('should let empty fields on search', async function (assert) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
api/src/identity-access-management/domain/constants/user-query.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const QUERY_TYPES = { | ||
CONTAINS: 'CONTAINS', | ||
EXACT_QUERY: 'EXACT_QUERY', | ||
}; |
4 changes: 2 additions & 2 deletions
4
api/src/identity-access-management/domain/usecases/find-paginated-filtered-users.usecase.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
const findPaginatedFilteredUsers = function ({ filter, page, userRepository }) { | ||
return userRepository.findPaginatedFiltered({ filter, page }); | ||
const findPaginatedFilteredUsers = function ({ filter, page, queryType, userRepository }) { | ||
return userRepository.findPaginatedFiltered({ filter, page, queryType }); | ||
}; | ||
|
||
export { findPaginatedFilteredUsers }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.