Web: VDR-lifetime: added changeRoomLifetime, fixed header tooltip

This commit is contained in:
Nikita Gopienko 2024-06-18 17:54:37 +03:00
parent bda0c950a1
commit eceba70e98
5 changed files with 17 additions and 8 deletions

View File

@ -249,7 +249,11 @@ const EditRoomEvent = ({
if (withPaging) await updateCurrentFolder(null, currentFolderId);
if (item.id === currentFolderId) {
updateEditedSelectedRoom(editRoomParams.title, tags);
updateEditedSelectedRoom(
editRoomParams.title,
tags,
roomParams.lifetime,
);
if (item.logo.original && !roomParams.icon.uploadedFile) {
removeLogoPaths();
// updateInfoPanelSelection();

View File

@ -953,7 +953,7 @@ const SectionHeaderContent = (props) => {
const titleIcon =
(isPublicRoomType && !isPublicRoom && PublicRoomIconUrl) ||
(isVirtualDataRoomType && LifetimeRoomIconUrl);
(isVirtualDataRoomType && selectedFolder.lifetime && LifetimeRoomIconUrl);
const titleIconTooltip = selectedFolder.lifetime
? t("Files:RoomFilesLifetime", {

View File

@ -237,6 +237,7 @@ class SelectedFolderStore {
this.type = null;
this.inRoom = false;
this.parentRoomType = null;
this.lifetime = null;
};
setParentId = (parentId: number) => {
@ -259,9 +260,14 @@ class SelectedFolderStore {
this.shared = shared;
};
updateEditedSelectedRoom = (title = this.title, tags = this.tags) => {
updateEditedSelectedRoom = (
title = this.title,
tags = this.tags,
lifetime = this.lifetime,
) => {
this.title = title;
this.tags = tags;
this.lifetime = lifetime;
};
setInRoom = (inRoom: boolean) => {

View File

@ -480,14 +480,13 @@ export function resetRoomQuota(roomIds) {
export function changeRoomLifetime(
roomId: string | number,
lifetime: TRoomLifetime,
lifetime: TRoomLifetime | null,
) {
const data = lifetime ? { ...lifetime } : null;
const options = {
method: "put",
url: `files/rooms/${roomId}/lifetime`,
data: {
...lifetime,
},
data,
};
return request(options);

View File

@ -541,7 +541,7 @@ export type TSelectorItem = TSelectorItemType & {
isSelected?: boolean;
isDisabled?: boolean;
disabledText?: string;
lifetimeTooltip?: string;
lifetimeTooltip?: string | null;
};
export type Data = {