🐛(frontend) email case sensitive search modal
When a user was searching for an email in the share modal, the search was case sensitive, so we were proposing to send an invitation to a new user when in fact the user was already registered. The search is now case insensitive, so the only choice is to add the existing user in the share list.
This commit is contained in:
committed by
Manuel Raynaud
parent
3b08ba4de1
commit
72f098c667
@@ -169,8 +169,15 @@ test.describe('Document create member', () => {
|
||||
|
||||
const inputSearch = page.getByTestId('quick-search-input');
|
||||
|
||||
const email = randomName('test@test.fr', browserName, 1)[0];
|
||||
let email = 'user.test21@example.COM';
|
||||
await inputSearch.fill(email);
|
||||
|
||||
// Check email is found in search (case insensitive)
|
||||
await expect(page.getByRole('option').getByText(email)).toHaveCount(1);
|
||||
|
||||
email = email + 'M';
|
||||
await inputSearch.fill(email);
|
||||
|
||||
await page.getByTestId(`search-user-row-${email}`).click();
|
||||
|
||||
// Choose a role
|
||||
@@ -191,7 +198,7 @@ test.describe('Document create member', () => {
|
||||
|
||||
const listInvitation = page.getByTestId('doc-share-quick-search');
|
||||
const userInvitation = listInvitation.getByTestId(
|
||||
`doc-share-invitation-row-${email}`,
|
||||
`doc-share-invitation-row-${email.toLowerCase()}`,
|
||||
);
|
||||
await expect(userInvitation).toBeVisible();
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ export const DocShareAddMemberList = ({
|
||||
return isInvitationMode
|
||||
? createInvitation({
|
||||
...payload,
|
||||
email: user.email,
|
||||
email: user.email.toLowerCase(),
|
||||
})
|
||||
: createDocAccess({
|
||||
...payload,
|
||||
|
||||
@@ -296,7 +296,9 @@ const QuickSearchInviteInputSection = ({
|
||||
language: '',
|
||||
};
|
||||
|
||||
const hasEmailInUsers = users.some((user) => user.email === userQuery);
|
||||
const hasEmailInUsers = users.some(
|
||||
(user) => user.email.toLowerCase() === userQuery.toLowerCase(),
|
||||
);
|
||||
|
||||
return {
|
||||
groupName: t('Search user result'),
|
||||
|
||||
@@ -21,7 +21,7 @@ export const SearchUserRow = ({
|
||||
alwaysShowRight = false,
|
||||
isInvitation = false,
|
||||
}: Props) => {
|
||||
const hasFullName = user.full_name != null && user.full_name !== '';
|
||||
const hasFullName = !!user.full_name;
|
||||
const { spacingsTokens, colorsTokens } = useCunninghamTheme();
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user