MAINT-2929 Group Role Permission "Eject Members from this Group" Is Poorly Described

master
maxim_productengine 2018-03-29 18:17:59 +03:00
parent 536a99c7ae
commit b1a84d9551
4 changed files with 120 additions and 9 deletions

View File

@ -821,8 +821,12 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
mMembersList = parent->getChild<LLNameListCtrl>("member_list", recurse);
mAssignedRolesList = parent->getChild<LLScrollListCtrl>("member_assigned_roles", recurse);
mAllowedActionsList = parent->getChild<LLScrollListCtrl>("member_allowed_actions", recurse);
mActionDescription = parent->getChild<LLTextEditor>("member_action_description", recurse);
if (!mMembersList || !mAssignedRolesList || !mAllowedActionsList) return FALSE;
if (!mMembersList || !mAssignedRolesList || !mAllowedActionsList || !mActionDescription) return FALSE;
mAllowedActionsList->setCommitOnSelectionChange(TRUE);
mAllowedActionsList->setCommitCallback(boost::bind(&LLPanelGroupMembersSubTab::updateActionDescription, this));
// We want to be notified whenever a member is selected.
mMembersList->setCommitOnSelectionChange(TRUE);
@ -889,6 +893,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
mAssignedRolesList->deleteAllItems();
mAllowedActionsList->deleteAllItems();
mActionDescription->clear();
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
@ -1386,6 +1391,7 @@ void LLPanelGroupMembersSubTab::activate()
update(GC_MEMBER_DATA);
}
}
mActionDescription->clear();
}
void LLPanelGroupMembersSubTab::deactivate()
@ -1894,6 +1900,23 @@ bool LLPanelGroupMembersSubTab::handleBanCallback(const LLSD& notification, cons
return false;
}
void LLPanelGroupMembersSubTab::updateActionDescription()
{
mActionDescription->setText(std::string());
LLScrollListItem* action_item = mAllowedActionsList->getFirstSelected();
if (!action_item || !mAllowedActionsList->getCanSelect())
{
return;
}
LLRoleAction* rap = (LLRoleAction*)action_item->getUserdata();
if (rap)
{
std::string desc = rap->mLongDescription.empty() ? rap->mDescription : rap->mLongDescription;
mActionDescription->setText(desc);
}
}
void LLPanelGroupMembersSubTab::handleBanMember()
{
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
@ -1964,6 +1987,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
mRolesList = parent->getChild<LLScrollListCtrl>("role_list", recurse);
mAssignedMembersList = parent->getChild<LLNameListCtrl>("role_assigned_members", recurse);
mAllowedActionsList = parent->getChild<LLScrollListCtrl>("role_allowed_actions", recurse);
mActionDescription = parent->getChild<LLTextEditor>("role_action_description", recurse);
mRoleName = parent->getChild<LLLineEditor>("role_name", recurse);
mRoleTitle = parent->getChild<LLLineEditor>("role_title", recurse);
@ -1971,7 +1995,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
mMemberVisibleCheck = parent->getChild<LLCheckBoxCtrl>("role_visible_in_list", recurse);
if (!mRolesList || !mAssignedMembersList || !mAllowedActionsList
if (!mRolesList || !mAssignedMembersList || !mAllowedActionsList || !mActionDescription
|| !mRoleName || !mRoleTitle || !mRoleDescription || !mMemberVisibleCheck)
{
LL_WARNS() << "ARG! element not found." << LL_ENDL;
@ -2004,6 +2028,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
mMemberVisibleCheck->setCommitCallback(onMemberVisibilityChange, this);
mAllowedActionsList->setCommitOnSelectionChange(TRUE);
mAllowedActionsList->setCommitCallback(boost::bind(&LLPanelGroupRolesSubTab::updateActionDescription, this));
mRoleName->setCommitOnFocusLost(TRUE);
mRoleName->setKeystrokeCallback(onPropertiesKey, this);
@ -2023,6 +2048,7 @@ void LLPanelGroupRolesSubTab::activate()
{
LLPanelGroupSubTab::activate();
mActionDescription->clear();
mRolesList->deselectAllItems();
mAssignedMembersList->deleteAllItems();
mAllowedActionsList->deleteAllItems();
@ -2707,6 +2733,23 @@ void LLPanelGroupRolesSubTab::saveRoleChanges(bool select_saved_role)
}
}
void LLPanelGroupRolesSubTab::updateActionDescription()
{
mActionDescription->setText(std::string());
LLScrollListItem* action_item = mAllowedActionsList->getFirstSelected();
if (!action_item || !mAllowedActionsList->getCanSelect())
{
return;
}
LLRoleAction* rap = (LLRoleAction*)action_item->getUserdata();
if (rap)
{
std::string desc = rap->mLongDescription.empty() ? rap->mDescription : rap->mLongDescription;
mActionDescription->setText(desc);
}
}
void LLPanelGroupRolesSubTab::setGroupID(const LLUUID& id)
{
if(mRolesList) mRolesList->deleteAllItems();

View File

@ -182,6 +182,7 @@ public:
bool handleBanCallback(const LLSD& notification, const LLSD& response);
void confirmBanMembers();
void updateActionDescription();
void applyMemberChanges();
bool addOwnerCB(const LLSD& notification, const LLSD& response);
@ -222,6 +223,8 @@ protected:
BOOL mPendingMemberUpdate;
BOOL mHasMatch;
LLTextEditor* mActionDescription;
member_role_changes_map_t mMemberRoleChangeData;
U32 mNumOwnerAdditions;
@ -269,6 +272,8 @@ public:
static void onDeleteRole(void*);
void handleDeleteRole();
void updateActionDescription();
void saveRoleChanges(bool select_saved_role);
virtual void setGroupID(const LLUUID& id);
@ -282,6 +287,7 @@ protected:
LLScrollListCtrl* mRolesList;
LLNameListCtrl* mAssignedMembersList;
LLScrollListCtrl* mAllowedActionsList;
LLTextEditor* mActionDescription;
LLLineEditor* mRoleName;
LLLineEditor* mRoleTitle;

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
height="680"
height="750"
label="Members &amp; Roles"
layout="topleft"
left="0"
@ -284,8 +284,7 @@ clicking on their names.
width="20" />
<scroll_list.columns
label=""
name="action"
width="270" />
name="action" />
</scroll_list>
</panel>
<panel
@ -451,7 +450,39 @@ clicking on their names.
</scroll_list>
</panel>
<panel
height="550"
height="90"
background_visible="false"
bg_alpha_color="FloaterUnfocusBorderColor"
layout="topleft"
follows="top|left|right"
left="0"
right="-1"
width="313"
mouse_opaque="false"
name="members_header"
top_pad="3"
visible="false">
<text_editor
bg_readonly_color="Transparent"
text_readonly_color="EmphasisColor"
font="SansSerifSmall"
type="string"
enabled="false"
halign="left"
layout="topleft"
top_pad="0"
follows="left|top|right"
left="0"
right="-1"
height="90"
max_length="512"
name="member_action_description"
word_wrap="true">
This Ability is &apos;Eject Members from this Group&apos;. Only an Owner can eject another Owner.
</text_editor>
</panel>
<panel
height="460"
background_visible="false"
bg_alpha_color="FloaterUnfocusBorderColor"
layout="topleft"
@ -599,10 +630,41 @@ clicking on their names.
width="20" />
<scroll_list.columns
label=""
name="action"
width="270" />
name="action" />
</scroll_list>
</panel>
<panel
height="90"
background_visible="false"
bg_alpha_color="FloaterUnfocusBorderColor"
layout="topleft"
follows="top|left|right"
left="0"
right="-1"
width="313"
mouse_opaque="false"
name="roles_header"
top_pad="3"
visible="false">
<text_editor
bg_readonly_color="Transparent"
text_readonly_color="EmphasisColor"
font="SansSerifSmall"
type="string"
enabled="false"
halign="left"
layout="topleft"
top_pad="0"
follows="left|top|right"
left="0"
right="-1"
height="90"
max_length="512"
name="role_action_description"
word_wrap="true">
This Ability is &apos;Eject Members from this Group&apos;. Only an Owner can eject another Owner.
</text_editor>
</panel>
<panel
height="424"
background_visible="false"

View File

@ -6,7 +6,7 @@
<action description="Invite People to this Group"
longdescription="Invite People to this Group using the &apos;Invite&apos; button in the Roles section &gt; Members tab."
name="member invite" value="1" />
<action description="Eject Members from this Group"
<action description="Eject Members belonging to the 'Everyone' role from this Group"
longdescription="Eject Members from this Group using the &apos;Eject&apos; button in the Roles section &gt; Members tab. An Owner can eject anyone except another Owner. If you&apos;re not an Owner, a Member can be ejected from a group if, and only if, they&apos;re only in the Everyone Role, and NO other Roles. To remove Members from Roles, you need to have the &apos;Remove Members from Roles&apos; Ability."
name="member eject" value="2" />
<action description="Manage ban list"