Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Refactor the various email/phone management UI into a single component #12884

Merged
merged 15 commits into from
Aug 14, 2024

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Aug 12, 2024

These were basically the same component copied & pasted 3 times and tweaked to match the behaviour of each case. This de-dupes them into one component.

This all could really benefit from playwright tests, but would require setting up a dummy ID server in the playwright tests. This is all legacy pre-MAS stuff so its questionable whether its worth the effort.

Also, apologies for the large PR: sorry - not sure how else it could be done.

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

These were basically the same component copied & pasted 3 times and
tweaked to match the behaviour of each case. This de-dupes them into
one component.

This all could really benefit from playwright tests, but would require
setting up a dummy ID server in the playwright tests. This is all legacy
pre-MAS stuff so its questionable whether its worth the effort.
@dbkr dbkr added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Aug 12, 2024
dbkr added 4 commits August 13, 2024 11:20
although the two texts are both 'Remove' in practice
This was never triggered anyway with sydent & synapse because they
don't seem to agree on what error to return. In any case, I think it
makes more sense for it to be consistent with the email path, ie. using
a dialog.
@dbkr dbkr marked this pull request as ready for review August 13, 2024 19:06
@dbkr dbkr requested a review from a team as a code owner August 13, 2024 19:06
@dbkr dbkr requested review from t3chguy and MidhunSureshR August 13, 2024 19:06
}

const ExistingThreepid: React.FC<ExistingThreepidProps> = ({ mode, threepid, onChange, disabled }) => {
const [isConfirming, setIsConfirming] = React.useState(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for not importing useState directly? it is the far more common approach in our codebase

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane otherwise

@dbkr dbkr added this pull request to the merge queue Aug 14, 2024
Merged via the queue into develop with commit 4751c52 Aug 14, 2024
29 checks passed
@dbkr dbkr deleted the dbkr/refactor_threepid_management branch August 14, 2024 13:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants