Fixed InsideGroup header context menu "Info" action
This commit is contained in:
parent
1d37dbb1cb
commit
d3a9201110
@ -701,7 +701,7 @@ const SectionHeaderContent = (props) => {
|
||||
}
|
||||
|
||||
if (isInsideGroup) {
|
||||
return getGroupContextOptions(t, currentGroup);
|
||||
return getGroupContextOptions(t, currentGroup, false, true);
|
||||
}
|
||||
|
||||
return [
|
||||
|
@ -320,7 +320,12 @@ class GroupsStore {
|
||||
this.setSelection(newSelections);
|
||||
};
|
||||
|
||||
getGroupContextOptions = (t, item, forInfoPanel = false) => {
|
||||
getGroupContextOptions = (
|
||||
t,
|
||||
item,
|
||||
forInfoPanel = false,
|
||||
forInsideGroup = false,
|
||||
) => {
|
||||
return [
|
||||
{
|
||||
id: "edit-group",
|
||||
@ -343,7 +348,12 @@ class GroupsStore {
|
||||
title: t("Common:Info"),
|
||||
icon: InfoReactSvgUrl,
|
||||
onClick: () => {
|
||||
this.selection = [item];
|
||||
if (!forInsideGroup) {
|
||||
this.selection = [item];
|
||||
} else {
|
||||
this.peopleStore.selectionStore.setSelection([]);
|
||||
this.peopleStore.selectionStore.setBufferSelection(null);
|
||||
}
|
||||
this.infoPanelStore.setIsVisible(true);
|
||||
},
|
||||
},
|
||||
|
@ -88,7 +88,7 @@ class HeaderMenuStore {
|
||||
|
||||
get isGroupsHeaderVisible() {
|
||||
const { selection } = this.peopleStore.groupsStore;
|
||||
return selection.length > 0;
|
||||
return selection?.length > 0;
|
||||
}
|
||||
|
||||
get isGroupsHeaderIndeterminate() {
|
||||
@ -96,14 +96,14 @@ class HeaderMenuStore {
|
||||
|
||||
return (
|
||||
this.isGroupsHeaderVisible &&
|
||||
!!selection.length &&
|
||||
selection.length < groups.length
|
||||
!!selection?.length &&
|
||||
selection?.length < groups?.length
|
||||
);
|
||||
}
|
||||
|
||||
get isGroupsHeaderChecked() {
|
||||
const { selection, groups } = this.peopleStore.groupsStore;
|
||||
return this.isGroupsHeaderVisible && selection.length === groups.length;
|
||||
return this.isGroupsHeaderVisible && selection?.length === groups?.length;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user