Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/07/2013 01:02:33 AM (12 years ago)
Author:
boonebgorges
Message:

Rework "Cancel Friendship Request" button UX in member directories

Member directories have friendship action buttons for each user: notably,
Add Friend for non-friends and Remove Friend for existing friends. When
A has sent a friendship request to B, the button becomes "Cancel Friendship
Request". However, it makes no sense for B to see the same button text for
the pending request, since it's not hers to cancel.

This changeset makes it so that B will see "Friendship Requested", and
the button will lead to B's Friend Requests page, so that she can accept
or reject the request using the latter existing UI.

Fixes #5157

Props terraling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/friends/class-bp-friends-friendship.php

    r7039 r7374  
    7878    }
    7979
     80    /**
     81     * @group check_is_friend
     82     */
     83    public function test_check_is_friend_not_friends() {
     84        $u1 = $this->create_user();
     85        $u2 = $this->create_user();
     86        $this->assertEquals( 'not_friends', BP_Friends_Friendship::check_is_friend( $u1, $u2 ) );
     87    }
    8088
     89    /**
     90     * @group check_is_friend
     91     */
     92    public function test_check_is_friend_pending() {
     93        $u1 = $this->create_user();
     94        $u2 = $this->create_user();
     95        friends_add_friend( $u1, $u2, false );
     96        $this->assertEquals( 'pending', BP_Friends_Friendship::check_is_friend( $u1, $u2 ) );
     97    }
    8198
     99    /**
     100     * @group check_is_friend
     101     */
     102    public function test_check_is_friend_awaiting_response() {
     103        $u1 = $this->create_user();
     104        $u2 = $this->create_user();
     105        friends_add_friend( $u1, $u2, false );
     106        $this->assertEquals( 'awaiting_response', BP_Friends_Friendship::check_is_friend( $u2, $u1 ) );
     107    }
     108
     109    /**
     110     * @group check_is_friend
     111     */
     112    public function test_check_is_friend_is_friend() {
     113        $u1 = $this->create_user();
     114        $u2 = $this->create_user();
     115        friends_add_friend( $u1, $u2, true );
     116        $this->assertEquals( 'is_friend', BP_Friends_Friendship::check_is_friend( $u1, $u2 ) );
     117    }
    82118}
Note: See TracChangeset for help on using the changeset viewer.