-
Notifications
You must be signed in to change notification settings - Fork 291
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 stopping to federate (WPB-203) #15583
Merged
Merged
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b3d52c8
feat: Add stopping to federate (WPB-203)
thisisamir98 b215a8a
disable 1:1 conversations
thisisamir98 0d37101
display domains
thisisamir98 54a36f0
remove yalc
thisisamir98 82467e1
handle federation.connectionRemoved
thisisamir98 cb87abd
avoid too many system messages
thisisamir98 0425f35
check if conversation has members from both backends
thisisamir98 19e80c2
remove fake event
thisisamir98 eda23d1
Merge branch dev of github.com:wireapp/wire-webapp into feat/WPB-203
thisisamir98 14e5ee9
bump core
thisisamir98 2814782
fix type error
thisisamir98 c0754bc
fix more type errors
thisisamir98 6427193
remove extra comment
thisisamir98 1d1458a
remove event save type error
thisisamir98 1e1df3e
persist system message
thisisamir98 51e7e52
offline delete
thisisamir98 53d9ff3
fix type error
thisisamir98 371458e
fix lint error
thisisamir98 9038815
add jsdoc
thisisamir98 76d1df0
refactor: use switch statement
thisisamir98 a692a88
fix bugs
thisisamir98 d5a3f6e
add learn more link and bold
thisisamir98 e140026
remove debug util
thisisamir98 fc35485
refactor
thisisamir98 ae67d93
Merge branch 'dev' of github.com:wireapp/wire-webapp into feat/WPB-203
thisisamir98 1be8626
feat: debounce function
thisisamir98 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
65 changes: 65 additions & 0 deletions
65
src/script/components/MessagesList/Message/FederationStopMessage.tsx
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 React from 'react'; | ||
|
||
import {Icon} from 'Components/Icon'; | ||
import {useKoSubscribableChildren} from 'Util/ComponentUtil'; | ||
import {t} from 'Util/LocalizerUtil'; | ||
|
||
import {MessageTime} from './MessageTime'; | ||
|
||
import {FederationStopMessage as FederationStopMessageEntity} from '../../../entity/message/FederationStopMessage'; | ||
|
||
export interface FederationStopMessageProps { | ||
message: FederationStopMessageEntity; | ||
} | ||
|
||
const FederationStopMessage: React.FC<FederationStopMessageProps> = ({message}) => { | ||
const {timestamp} = useKoSubscribableChildren(message, ['timestamp']); | ||
const {id, domains} = message; | ||
|
||
return ( | ||
<div className="message-header"> | ||
<div className="message-header-icon message-header-icon--svg"> | ||
<div> | ||
<Icon.Info /> | ||
</div> | ||
</div> | ||
<div | ||
className="message-header-label" | ||
data-uie-name="element-message-failed-to-add-users" | ||
data-uie-value={`domains-${domains.join('_')}`} | ||
> | ||
{domains.length === 1 | ||
? t('federationDelete', {backendUrl: domains[0]}) | ||
: t('federationConnectionRemove', {backendUrlOne: domains[0], backendUrlTwo: domains[1]})} | ||
</div> | ||
<p className="message-body-actions"> | ||
<MessageTime | ||
timestamp={timestamp} | ||
data-uie-uid={id} | ||
data-uie-name="item-message-failed-to-add-users-timestamp" | ||
/> | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export {FederationStopMessage}; |
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
Oops, something went wrong.
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.
these two blocks are almost identical except domain type. We can create a function and call it twice with each domain.
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.
that's is a good suggestion, indeed. But without unit tests to back it, it's also risky.
I'd recommend writing tests first (I can help with that), make sure that we are compliant with the specs and then refactoring to a cleaner/more performant code.