Skip to content

Commit

Permalink
SSO: Add invite user button option (#88369)
Browse files Browse the repository at this point in the history
* Add invite button option

* Fix type

* Remove unnecessary comment

* Add notice and style

* Use LocalizeUrl

* Fix small viewport message style

* Fix pending invites not being shown sometimes

* Add error handling

* Use correct icon

* Rename variable

* Remove unnecessary test expectation
  • Loading branch information
renancarvalho authored and billrobbins committed Mar 20, 2024
1 parent 99a5b34 commit 0c05128
Show file tree
Hide file tree
Showing 8 changed files with 348 additions and 180 deletions.
5 changes: 0 additions & 5 deletions client/my-sites/people/invite-status/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ const InviteStatus = ( {
handleDelete,
resendSuccess,
requestingResend,
inviteWasDeleted,
deletingInvite,
} ) => {
const translate = useTranslate();
const { isPending } = invite;

if ( invite && inviteWasDeleted ) {
return null;
}

return (
<div
className={ classNames( 'people-list-item__invite-status', {
Expand Down
3 changes: 1 addition & 2 deletions client/my-sites/people/people-invite-details/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,13 @@ export class PeopleInviteDetails extends PureComponent {
requesting,
invite,
translate,
deleteSuccess,
requestingResend,
resendSuccess,
inviteWasDeleted,
deletingInvite,
} = this.props;

if ( ! site || ! site.ID || deleteSuccess ) {
if ( ! site || ! site.ID ) {
return this.renderPlaceholder();
}

Expand Down
5 changes: 0 additions & 5 deletions client/my-sites/people/people-invite-details/test/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ describe( 'PeopleInviteDetails', () => {
expect( mockGoBack ).toHaveBeenCalledTimes( 1 );
expect( mockGoBack ).toHaveBeenCalledWith( '/people/invites/' + siteObject.slug );

// Verify that a placeholder is rendered while waiting for `page.back`
// to take effect.
const loadingUsersEl2 = screen.queryByText( 'Loading Users' );
expect( loadingUsersEl2 ).toBeInTheDocument();

// Change another prop and verify that `page.back` isn't called again.
rerender( <PeopleInviteDetails { ...props } invite={ { ...acceptedInviteObject } } /> );
expect( mockGoBack ).toHaveBeenCalledTimes( 1 );
Expand Down
165 changes: 0 additions & 165 deletions client/my-sites/people/people-list-item/index.jsx

This file was deleted.

Loading

0 comments on commit 0c05128

Please sign in to comment.