Merge branch 'release/v2.6.0' of https://github.com/ONLYOFFICE/DocSpace-client into release/v2.6.0

This commit is contained in:
Nikita Gopienko 2024-06-28 17:20:54 +03:00
commit e5ebb3f414
8 changed files with 76 additions and 6 deletions

View File

@ -41,6 +41,7 @@ const GroupsRow = ({
selection,
bufferSelection,
getGroupContextOptions,
getModel,
sectionWidth,
theme,
openGroupAction,
@ -77,6 +78,8 @@ const GroupsRow = ({
const groupName = (item.name[0] + secondCharacter).toUpperCase();
const getContextModel = () => getModel(t, item);
return (
<Styled.GroupsRowWrapper
isChecked={isChecked}
@ -106,6 +109,7 @@ const GroupsRow = ({
checked={isChecked}
isActive={isActive}
contextOptions={getGroupContextOptions(t, item)}
getContextModel={getContextModel}
sectionWidth={sectionWidth}
mode={"modern"}
className={"group-row"}
@ -163,6 +167,7 @@ export default inject(({ peopleStore, settingsStore }) => ({
selection: peopleStore.groupsStore.selection,
bufferSelection: peopleStore.groupsStore.bufferSelection,
getGroupContextOptions: peopleStore.groupsStore.getGroupContextOptions,
getModel: peopleStore.groupsStore.getModel,
openGroupAction: peopleStore.groupsStore.openGroupAction,
changeGroupSelection: peopleStore.groupsStore.changeGroupSelection,
changeGroupContextSelection:

View File

@ -43,6 +43,7 @@ const GroupsTableItem = ({
hideColumns,
bufferSelection,
getGroupContextOptions,
getModel,
openGroupAction,
managerAccountsGroupsColumnIsEnabled,
@ -78,6 +79,8 @@ const GroupsTableItem = ({
selectRow(item);
};
const getContextModel = () => getModel(t, item);
let value = `folder_${item.id}_false_index_${itemIndex}`;
return (
@ -98,6 +101,7 @@ const GroupsTableItem = ({
onDoubleClick={onOpenGroup}
hideColumns={hideColumns}
contextOptions={getGroupContextOptions(t, item)}
getContextModel={getContextModel}
>
<TableCell className={"table-container_group-title-cell"}>
<TableCell
@ -160,6 +164,7 @@ const GroupsTableItem = ({
export default inject(({ peopleStore }) => ({
bufferSelection: peopleStore.groupsStore.bufferSelection,
getGroupContextOptions: peopleStore.groupsStore.getGroupContextOptions,
getModel: peopleStore.groupsStore.getModel,
openGroupAction: peopleStore.groupsStore.openGroupAction,
changeGroupSelection: peopleStore.groupsStore.changeGroupSelection,
changeGroupContextSelection:

View File

@ -187,6 +187,11 @@ const WhiteLabelWrapper = styled.div`
props.theme.client.settings.common.whiteLabel.orangeBackgroundColor};
}
.background-red {
background-color: ${(props) =>
props.theme.client.settings.common.whiteLabel.redBackgroundColor};
}
.background-light {
background-color: ${(props) =>
props.theme.client.settings.common.whiteLabel.backgroundColorLight};

View File

@ -65,18 +65,22 @@ const Logo = (props) => {
)}
{isEditor ? (
<div className="logos-editor-wrapper" onClick={onLogoClick}>
<img
className="logo-docs-editor background-green"
src={currentLogo}
/>
<img
className="logo-docs-editor background-blue"
src={currentLogo}
/>
<img
className="logo-docs-editor background-red"
src={currentLogo}
/>
<img
className="logo-docs-editor background-orange"
src={currentLogo}
/>
<img
className="logo-docs-editor background-green"
src={currentLogo}
/>
</div>
) : (
<img className={imageClass} src={currentLogo} onClick={onLogoClick} />

View File

@ -25,6 +25,7 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import { makeAutoObservable, runInAction } from "mobx";
import { TFunction } from "i18next";
import * as groupsApi from "@docspace/shared/api/groups";
import { Events } from "@docspace/shared/enums";
import { toastr } from "@docspace/shared/components/toast";
@ -474,6 +475,47 @@ class GroupsStore {
}
};
get hasGroupsToRemove() {
if (this.peopleStore.userStore.user.isRoomAdmin) {
return false;
}
const noLdapItems = this.selection.filter((item) => !item?.isLDAP);
return noLdapItems.length > 0;
}
getMultipleGroupsContextOptions = (t: TFunction) => {
const { setDeleteGroupDialogVisible } = this.peopleStore.dialogStore;
return [
{
id: "info",
key: "group-info",
className: "group-menu_drop-down",
label: t("Common:Info"),
title: t("Common:Info"),
icon: InfoReactSvgUrl,
onClick: () => this.infoPanelStore.setIsVisible(true),
},
{
key: "separator",
isSeparator: true,
disabled: !this.hasGroupsToRemove,
},
{
id: "delete-group",
key: "delete-group",
className: "group-menu_drop-down",
label: t("Common:Delete"),
title: t("Common:Delete"),
icon: TrashReactSvgUrl,
onClick: () => setDeleteGroupDialogVisible(true),
disabled: !this.hasGroupsToRemove,
},
];
};
getGroupContextOptions = (
t,
item,
@ -534,6 +576,12 @@ class GroupsStore {
];
};
getModel = (t: TFunction, item: TGroup) => {
return this.selection.length > 1
? this.getMultipleGroupsContextOptions(t)
: this.getGroupContextOptions(t, item);
};
clearInsideGroup = () => {
this.currentGroup = null;
this.insideGroupBackUrl = null;

View File

@ -35,4 +35,5 @@ export type TGroup = {
isGroup?: boolean;
membersCount: number;
shared?: boolean;
isLDAP: boolean;
};

View File

@ -3046,7 +3046,8 @@ export const getBaseTheme = () => {
backgroundColorDark: "#282828",
greenBackgroundColor: "#40865C",
blueBackgroundColor: "#446995",
orangeBackgroundColor: "#AA5252",
orangeBackgroundColor: "#BE6650",
redBackgroundColor: "#AA5251",
dataFontColor: white,
dataFontColorBlack: black,

View File

@ -3024,7 +3024,8 @@ const Dark: TTheme = {
backgroundColorDark: "#282828",
greenBackgroundColor: "#40865C",
blueBackgroundColor: "#446995",
orangeBackgroundColor: "#AA5252",
orangeBackgroundColor: "#BE6650",
redBackgroundColor: "#AA5251",
dataFontColor: white,
dataFontColorBlack: white,