-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add ability to create guest links with password (SQSERVICES-1975) #15014
Merged
Merged
Changes from 9 commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
2753f4d
feat: Add ability to create guest links with password (SQSERVICES-1975)
thisisamir98 07e394c
feat: Add GuestLinkPasswordModal
thisisamir98 3479d34
join with login
thisisamir98 3aa2a77
sso password
thisisamir98 768b9d1
joing with deeplink
thisisamir98 02138ec
clean up copies
thisisamir98 8314b82
Merge branch 'dev' of github.com:wireapp/wire-webapp into feat/SQSERV…
thisisamir98 d16bc8f
fix error
thisisamir98 3a63325
Merge branch 'dev' of github.com:wireapp/wire-webapp into feat/SQSERV…
thisisamir98 73c5ec0
Update src/script/auth/component/GuestLinkPasswordModal.tsx
thisisamir98 c1a393a
backward compatibility
thisisamir98 8019074
Merge branch 'feat/SQSERVICES-1975' of github.com:wireapp/wire-webapp…
thisisamir98 fc0df1a
Update src/script/auth/component/GuestLinkPasswordModal.tsx
thisisamir98 4cab38d
use on if
thisisamir98 498955a
Merge branch 'feat/SQSERVICES-1975' of github.com:wireapp/wire-webapp…
thisisamir98 9f0be47
fix backenderror
thisisamir98 a28c71c
fix type error
thisisamir98 d865548
Merge branch 'dev' of github.com:wireapp/wire-webapp into feat/SQSERV…
thisisamir98 d61bd21
BackendErrorlabel
thisisamir98 e6999db
fix type error
thisisamir98 eee35b8
fix state bug
thisisamir98 911156b
add loading state
thisisamir98 6fdc56b
bump core
thisisamir98 1f33a06
use api-client supportsGuestLinksWithPassword
thisisamir98 92112cb
feat: conversation name
thisisamir98 96b2824
Merge branch 'dev' of github.com:wireapp/wire-webapp into feat/SQSERV…
thisisamir98 656afbc
add URL_LEARN_MORE_ABOUT_GUEST_LINKS
thisisamir98 ef65588
throw error
thisisamir98 155c129
Merge branch 'dev' of github.com:wireapp/wire-webapp into feat/SQSERV…
thisisamir98 5ec9259
runfix: password not secure option
thisisamir98 d0ab5ea
copy your password reminder message
thisisamir98 2625b8f
The text inputs wrong labels
thisisamir98 0927ef5
disabled state
thisisamir98 80adff0
design review for joining on desktop
thisisamir98 cabae78
remove log
thisisamir98 ac71cc1
Merge branch 'dev' of github.com:wireapp/wire-webapp into feat/SQSERV…
thisisamir98 d2f4adc
disabled copy to clipboard
thisisamir98 2d7f09f
border color on focus
thisisamir98 55a9aed
rename
thisisamir98 c399830
fix redirect bug
thisisamir98 7646ede
invalid password error handling
thisisamir98 a8c6d0d
login and single sign on password error handling
thisisamir98 1e853c9
fix broken tests
thisisamir98 39475fb
fix ts error
thisisamir98 f3b2127
add password conditions check
thisisamir98 ac430c1
add modal close button
thisisamir98 351d3ec
add close button to login
thisisamir98 f25adf8
close modal on sso with link pass
thisisamir98 a2835f5
fix primary button disabled
thisisamir98 2f6c9d7
password copy
thisisamir98 d500b7f
chore: merge with dev
tlebon 224a75b
feat: update guest link passwords for new convo join page
tlebon e8967d0
fix: issue with some edge cases not working
tlebon c02ea4b
chore: merge dev
tlebon 0c84609
chore: remove error throw
tlebon 5e70571
fix: remove form param submission bug
tlebon 72a0561
chore: remove password from error on L132
tlebon c643e5f
chore: missing error catch
tlebon ccfc429
feat: possible fix for open issues
tlebon c94981f
fix: password verification
tlebon 45c45db
chore: condense password regex
tlebon 772e337
feat: update primary modal
tlebon 6f16f41
chore: disable guest link passwords feature
tlebon 6164354
chore: merge dev
tlebon 59d4ab0
chore: merge dev
tlebon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2023 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
* | ||
*/ | ||
|
||
import {fireEvent, render} from '@testing-library/react'; | ||
|
||
import {GuestLinkPasswordModal, GuestLinkPasswordModalProps} from './GuestLinkPasswordModal'; | ||
|
||
import {withIntl, withTheme} from '../util/test/TestUtil'; | ||
|
||
describe('GuestLinkPasswordModal', () => { | ||
const onSubmitPasswordMock = jest.fn(); | ||
const props: GuestLinkPasswordModalProps = { | ||
onSubmitPassword: onSubmitPasswordMock, | ||
}; | ||
|
||
beforeEach(() => { | ||
onSubmitPasswordMock.mockClear(); | ||
}); | ||
|
||
it('should call onSubmitPassword with the password value when the form is submitted', () => { | ||
const {getByTestId} = render(withTheme(withIntl(<GuestLinkPasswordModal {...props} />))); | ||
const input = getByTestId('guest-link-join-password-input') as HTMLInputElement; | ||
const joinConversationButton = getByTestId('guest-link-join-submit-button') as HTMLButtonElement; | ||
fireEvent.change(input, {target: {value: 'password'}}); | ||
joinConversationButton.click(); | ||
expect(onSubmitPasswordMock).toHaveBeenCalledWith('password'); | ||
}); | ||
|
||
it('should disable the join conversation button when the password input is empty', () => { | ||
const {getByTestId} = render(withTheme(withIntl(<GuestLinkPasswordModal {...props} />))); | ||
const joinConversationButton = getByTestId('guest-link-join-submit-button') as HTMLButtonElement; | ||
expect(joinConversationButton.disabled).toBe(true); | ||
}); | ||
|
||
it('should enable the join conversation button when the password input is not empty', () => { | ||
const {getByTestId} = render(withTheme(withIntl(<GuestLinkPasswordModal {...props} />))); | ||
const input = getByTestId('guest-link-join-password-input'); | ||
const joinConversationButton = getByTestId('guest-link-join-submit-button') as HTMLButtonElement; | ||
fireEvent.change(input, {target: {value: 'password'}}); | ||
expect(joinConversationButton.disabled).toBe(false); | ||
}); | ||
|
||
it('should not call onSubmitPassword with an empty string when the form is submitted with an empty password input', () => { | ||
const {getByTestId} = render(withTheme(withIntl(<GuestLinkPasswordModal {...props} />))); | ||
const joinConversationButton = getByTestId('guest-link-join-submit-button') as HTMLButtonElement; | ||
joinConversationButton.click(); | ||
expect(onSubmitPasswordMock).toHaveBeenCalledTimes(0); | ||
}); | ||
}); |
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,89 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2023 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
* | ||
*/ | ||
|
||
import React, {useState} from 'react'; | ||
|
||
import {useIntl} from 'react-intl'; | ||
|
||
import {Button, COLOR, Container, Form, H2, Input, Link, Modal, Text} from '@wireapp/react-ui-kit'; | ||
|
||
import {Config} from '../../Config'; | ||
import {guestLinkPasswordModalStrings} from '../../strings'; | ||
|
||
export interface GuestLinkPasswordModalProps { | ||
onSubmitPassword: (password: string) => void; | ||
} | ||
|
||
const GuestLinkPasswordModal: React.FC<GuestLinkPasswordModalProps> = ({onSubmitPassword}) => { | ||
const {formatMessage: _} = useIntl(); | ||
const [passwordValue, setPasswordValue] = useState<string>(''); | ||
|
||
const onSubmit = () => { | ||
onSubmitPassword(passwordValue); | ||
}; | ||
|
||
return ( | ||
<Modal> | ||
<Container style={{maxWidth: '400px'}}> | ||
<H2 style={{whiteSpace: 'break-spaces', fontWeight: 500, marginTop: '10px', textAlign: 'center'}}> | ||
{_(guestLinkPasswordModalStrings.headline)} | ||
</H2> | ||
<Text block fontSize="16px" style={{marginBottom: 24}}> | ||
thisisamir98 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{_(guestLinkPasswordModalStrings.description)} | ||
</Text> | ||
<Form | ||
name="guest-password-join-form" | ||
data-uie-name="guest-password-join-form" | ||
onSubmit={onSubmit} | ||
autoComplete="off" | ||
> | ||
<Input | ||
data-uie-name="guest-link-join-password-input" | ||
name="guest-join-password" | ||
required | ||
placeholder={_(guestLinkPasswordModalStrings.passwordInputLabel)} | ||
label={_(guestLinkPasswordModalStrings.passwordInputLabel)} | ||
id="guest_link_join_password" | ||
className="modal__input" | ||
type="password" | ||
autoComplete="off" | ||
value={passwordValue} | ||
onChange={event => setPasswordValue(event.currentTarget.value)} | ||
/> | ||
</Form> | ||
<Link href={Config.getConfig().URL.SUPPORT.LEARN_MORE_ABOUT_GUEST_LINKS} target="_blank"> | ||
<Text block color={COLOR.BLUE} style={{textDecoration: 'underline', marginBottom: 24}}> | ||
{_(guestLinkPasswordModalStrings.learnMoreLink)} | ||
</Text> | ||
</Link> | ||
<Button | ||
block | ||
type="button" | ||
disabled={passwordValue === ''} | ||
thisisamir98 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
onClick={onSubmit} | ||
data-uie-name="guest-link-join-submit-button" | ||
> | ||
{_(guestLinkPasswordModalStrings.joinConversation)} | ||
</Button> | ||
</Container> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export {GuestLinkPasswordModal}; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this
\n
really working 🤔 ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah if you do white-space: pre or pre-line it works.