Merge branch 'release/rc-v1.2.0' of github.com:ONLYOFFICE/AppServer into release/rc-v1.2.0

This commit is contained in:
Tatiana Lopaeva 2022-12-22 13:23:15 +03:00
commit 048b15d81c
38 changed files with 186 additions and 125 deletions

View File

@ -88,7 +88,7 @@ echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] http://download.onlyoff
mkdir -p -m 700 $HOME/.gnupg
gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/onlyoffice.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
chmod 644 /usr/share/keyrings/onlyoffice.gpg
echo "deb http://static.teamlab.info.s3.amazonaws.com/repo/4testing/debian stable main" | sudo tee /etc/apt/sources.list.d/onlyoffice4testing.list
echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] http://static.teamlab.info.s3.amazonaws.com/repo/4testing/debian stable main" | sudo tee /etc/apt/sources.list.d/onlyoffice4testing.list
declare -x LANG="en_US.UTF-8"
declare -x LANGUAGE="en_US:en"

View File

@ -70,7 +70,7 @@ DATABASE_MIGRATION="true"
ELK_VERSION=""
ELK_HOST=""
DOCUMENT_SERVER_IMAGE_NAME=onlyoffice/4testing-documentserver-ee:latest
DOCUMENT_SERVER_IMAGE_NAME="onlyoffice/4testing-documentserver-ee:latest"
DOCUMENT_SERVER_JWT_SECRET=""
DOCUMENT_SERVER_JWT_HEADER=""
DOCUMENT_SERVER_HOST=""
@ -124,7 +124,7 @@ while [ "$1" != "" ]; do
fi
;;
-ids | --installdocumentserver )
-idocs | --installdocumentserver )
if [ "$2" != "" ]; then
INSTALL_DOCUMENT_SERVER=$2
shift
@ -138,14 +138,14 @@ while [ "$1" != "" ]; do
fi
;;
-ira | --installrabbitmq )
-irb | --installrabbitmq )
if [ "$2" != "" ]; then
INSTALL_RABBITMQ=$2
shift
fi
;;
-ire | --installredis )
-ird | --installredis )
if [ "$2" != "" ]; then
INSTALL_REDIS=$2
shift
@ -294,11 +294,11 @@ while [ "$1" != "" ]; do
echo " -p, --password dockerhub password"
echo " -ids, --installdocspace install or update $PRODUCT (true|false)"
echo " -tag, --dockertag select the version to install $PRODUCT (latest|develop|version number)"
echo " -ids, --installdocumentserver install or update document server (true|false)"
echo " -idocs, --installdocumentserver install or update document server (true|false)"
echo " -di, --documentserverimage document server image name"
echo " -imysql, --installmysql install or update mysql (true|false)"
echo " -ira, --installrabbitmq install or update rabbitmq (true|false)"
echo " -ire, --installredis install or update redis (true|false)"
echo " -irb, --installrabbitmq install or update rabbitmq (true|false)"
echo " -ird, --installredis install or update redis (true|false)"
echo " -mysqlrp, --mysqlrootpassword mysql server root password"
echo " -mysqld, --mysqldatabase $PRODUCT database name"
echo " -mysqlu, --mysqluser $PRODUCT database user"
@ -309,25 +309,26 @@ while [ "$1" != "" ]; do
echo " -env, --environment $PRODUCT environment"
echo " -skiphc, --skiphardwarecheck skip hardware check (true|false)"
echo " -ip, --internalport internal $PRODUCT port (default value 5050)"
echo " -ep, --externalport external $PRODUCT port (default value 8092)"
echo " -ep, --externalport external $PRODUCT port (default value 80)"
echo " -mk, --machinekey setting for core.machinekey"
echo " -ls, --local_scripts run the installation from local scripts"
echo " -dbm, --databasemigration database migration (true|false)"
echo " -?, -h, --help this help"
echo
echo " Install all the components without document server:"
echo " bash $HELP_TARGET -ids false"
echo " bash $HELP_TARGET -idocs false"
echo
echo " Install Document Server only. Skip the installation of MYSQL and $PRODUCT:"
echo " bash $HELP_TARGET -ias false -ids true -imysql false -ims false"
echo " bash $HELP_TARGET -ids false -idocs true -imysql false -irb false -ird false"
echo
echo " Update all installed components. Stop the containers that need to be updated, remove them and run the latest versions of the corresponding components. The portal data should be picked up automatically:"
echo " bash $HELP_TARGET -u true"
echo
echo " Update Document Server only to version 4.4.2.20 and skip the update for all other components:"
echo " bash $HELP_TARGET -u true -dv 4.4.2.20 -ias false"
echo " Update Document Server only to version 7.2.1.34 and skip the update for all other components:"
echo " bash $HELP_TARGET -u true -di onlyoffice/documentserver-ee:7.2.1.34 -ids false"
echo
echo " Update $PRODUCT only to version 0.1.10 and skip the update for all other components:"
echo " bash $HELP_TARGET -u true -av 9.1.0.393 -ids false"
echo " Update $PRODUCT only to version 1.2.0 and skip the update for all other components:"
echo " bash $HELP_TARGET -u true -tag rc-v1.2.0 -idocs false"
echo
exit 0
;;

View File

@ -64,6 +64,10 @@ public static class ISetupBuilderExtension
if (!string.IsNullOrEmpty(awsAccessKeyId))
{
awsTarget.Credentials = new Amazon.Runtime.BasicAWSCredentials(awsAccessKeyId, awsSecretAccessKey);
}
else
{
conf.RemoveTarget(targetName);
}
}

View File

@ -734,12 +734,12 @@ public class TariffService : ITariffService
efTariff.CustomerId = "";
}
efTariff = dbContext.AddOrUpdate(r => r.Tariffs, efTariff);
efTariff = dbContext.AddOrUpdate(dbContext.Tariffs, efTariff);
dbContext.SaveChanges();
foreach (var q in tariffInfo.Quotas)
{
dbContext.AddOrUpdate(r => r.TariffRows, new DbTariffRow
dbContext.AddOrUpdate(dbContext.TariffRows, new DbTariffRow
{
TariffId = efTariff.Id,
Quota = q.Id,

View File

@ -161,7 +161,7 @@ class DbAzService : IAzService
private void InsertRecord(AzRecord r)
{
using var userDbContext = _dbContextFactory.CreateDbContext();
userDbContext.AddOrUpdate(r => r.Acl, _mapper.Map<AzRecord, Acl>(r));
userDbContext.AddOrUpdate(userDbContext.Acl, _mapper.Map<AzRecord, Acl>(r));
userDbContext.SaveChanges();
}
}

View File

@ -59,7 +59,7 @@ class DbQuotaService : IQuotaService
ArgumentNullException.ThrowIfNull(quota);
using var coreDbContext = _dbContextFactory.CreateDbContext();
coreDbContext.AddOrUpdate(r => r.Quotas, _mapper.Map<TenantQuota, DbQuota>(quota));
coreDbContext.AddOrUpdate(coreDbContext.Quotas, _mapper.Map<TenantQuota, DbQuota>(quota));
coreDbContext.SaveChanges();
return quota;
@ -123,7 +123,7 @@ class DbQuotaService : IQuotaService
dbTenantQuotaRow.Counter = counter + row.Counter;
}
coreDbContext.AddOrUpdate(r => r.QuotaRows, dbTenantQuotaRow);
coreDbContext.AddOrUpdate(coreDbContext.QuotaRows, dbTenantQuotaRow);
coreDbContext.SaveChanges();
}
}

View File

@ -170,7 +170,7 @@ public class DbSettingsManager
Data = data
};
webstudioDbContext.AddOrUpdate(r => r.WebstudioSettings, s);
webstudioDbContext.AddOrUpdate(webstudioDbContext.WebstudioSettings, s);
webstudioDbContext.SaveChanges();
}

View File

@ -158,7 +158,7 @@ public class DbSubscriptionService : ISubscriptionService
};
using var userDbContext = _dbContextFactory.CreateDbContext();
userDbContext.AddOrUpdate(r => r.Subscriptions, subs);
userDbContext.AddOrUpdate(userDbContext.Subscriptions, subs);
userDbContext.SaveChanges();
}
@ -283,7 +283,7 @@ public class DbSubscriptionService : ISubscriptionService
Tenant = m.Tenant,
Sender = string.Join("|", m.Methods)
};
userDbContext.AddOrUpdate(r => r.SubscriptionMethods, sm);
userDbContext.AddOrUpdate(userDbContext.SubscriptionMethods, sm);
}
userDbContext.SaveChanges();

View File

@ -350,7 +350,7 @@ public class DbTenantService : ITenantService
LastModified = DateTime.UtcNow
};
tenantDbContext.AddOrUpdate(r => r.CoreSettings, settings);
tenantDbContext.AddOrUpdate(tenantDbContext.CoreSettings, settings);
}
tenantDbContext.SaveChanges();

View File

@ -223,8 +223,11 @@ public class EFUserService : IUserService
{
if (sortBy == "type")
{
var q1 = from user in q join userGroup in userDbContext.UserGroups.Where(g => !g.Removed && (g.UserGroupId == Users.Constants.GroupAdmin.ID || g.UserGroupId == Users.Constants.GroupUser.ID))
on user.Id equals userGroup.Userid into joinedGroup from @group in joinedGroup.DefaultIfEmpty() select new { user, @group };
var q1 = from user in q
join userGroup in userDbContext.UserGroups.Where(g => !g.Removed && (g.UserGroupId == Users.Constants.GroupAdmin.ID || g.UserGroupId == Users.Constants.GroupUser.ID))
on user.Id equals userGroup.Userid into joinedGroup
from @group in joinedGroup.DefaultIfEmpty()
select new { user, @group };
q = sortOrderAsc ? q1.OrderBy(r => r.group != null && r.group.UserGroupId == Users.Constants.GroupAdmin.ID ? 1 : r.group == null ? 2 : 3).Select(r => r.user)
: q1.OrderByDescending(u => u.group != null && u.group.UserGroupId == Users.Constants.GroupAdmin.ID ? 1 : u.group == null ? 2 : 3).Select(r => r.user);
@ -412,7 +415,7 @@ public class EFUserService : IUserService
var dbGroup = _mapper.Map<Group, DbGroup>(group);
using var userDbContext = _dbContextFactory.CreateDbContext();
userDbContext.AddOrUpdate(r => r.Groups, dbGroup);
userDbContext.AddOrUpdate(userDbContext.Groups, dbGroup);
userDbContext.SaveChanges();
return group;
@ -465,7 +468,7 @@ public class EFUserService : IUserService
throw new ArgumentOutOfRangeException("Duplicate email.");
}
userDbContext.AddOrUpdate(r => r.Users, _mapper.Map<UserInfo, User>(user));
userDbContext.AddOrUpdate(userDbContext.Users, _mapper.Map<UserInfo, User>(user));
userDbContext.SaveChanges();
tx.Commit();
});
@ -491,7 +494,7 @@ public class EFUserService : IUserService
if (user != null)
{
user.LastModified = userGroupRef.LastModified;
userDbContext.AddOrUpdate(r => r.UserGroups, _mapper.Map<UserGroupRef, UserGroup>(userGroupRef));
userDbContext.AddOrUpdate(userDbContext.UserGroups, _mapper.Map<UserGroupRef, UserGroup>(userGroupRef));
}
userDbContext.SaveChanges();
@ -516,7 +519,7 @@ public class EFUserService : IUserService
};
using var userDbContext = _dbContextFactory.CreateDbContext();
userDbContext.AddOrUpdate(r => r.UserSecurity, us);
userDbContext.AddOrUpdate(userDbContext.UserSecurity, us);
userDbContext.SaveChanges();
}
@ -547,7 +550,7 @@ public class EFUserService : IUserService
userPhoto.Photo = photo;
}
userDbContext.AddOrUpdate(r => r.Photos, userPhoto);
userDbContext.AddOrUpdate(userDbContext.Photos, userPhoto);
}
else if (userPhoto != null)
{

View File

@ -97,10 +97,10 @@ public static class BaseDbContextExtension
services.AddDbContext<T>(OptionsAction);
}
public static T AddOrUpdate<T, TContext>(this TContext b, Expression<Func<TContext, DbSet<T>>> expressionDbSet, T entity) where T : BaseEntity where TContext : DbContext
public static T AddOrUpdate<T, TContext>(this TContext b, DbSet<T> dbSet, T entity) where T : BaseEntity where TContext : DbContext
{
var dbSet = expressionDbSet.Compile().Invoke(b);
var existingBlog = dbSet.Find(entity.GetKeys());
var keys = entity.GetKeys();
var existingBlog = dbSet.Find(keys);
if (existingBlog == null)
{
return dbSet.Add(entity).Entity;

View File

@ -47,7 +47,7 @@ public class TelegramDao
};
using var dbContext = _dbContextFactory.CreateDbContext();
dbContext.AddOrUpdate(r => r.Users, user);
dbContext.AddOrUpdate(dbContext.Users, user);
dbContext.SaveChanges();
}

View File

@ -39,7 +39,7 @@ public class DbRadicale
public void SaveCardDavUser(int tenant, Guid id)
{
using var userDbContext = _dbContextFactory.CreateDbContext();
userDbContext.AddOrUpdate(r => r.UsersDav, new UserDav() { TenantId = tenant, UserId = id });
userDbContext.AddOrUpdate(userDbContext.UsersDav, new UserDav() { TenantId = tenant, UserId = id });
userDbContext.SaveChanges();
}

View File

@ -60,7 +60,7 @@ public static class Crypto
{
using var ms = new MemoryStream();
using var ss = new CryptoStream(ms, hasher.CreateEncryptor(), CryptoStreamMode.Write);
using var plainTextStream = new MemoryStream(Convert.FromBase64String(data));
using var plainTextStream = new MemoryStream(Encoding.Unicode.GetBytes(data));
plainTextStream.CopyTo(ss);
ss.FlushFinalBlock();
hasher.Clear();

View File

@ -39,7 +39,7 @@ public class BackupRepository : IBackupRepository
public void SaveBackupRecord(BackupRecord backup)
{
using var backupContext = _dbContextFactory.CreateDbContext();
backupContext.AddOrUpdate(r => r.Backups, backup);
backupContext.AddOrUpdate(backupContext.Backups, backup);
backupContext.SaveChanges();
}
@ -88,7 +88,7 @@ public class BackupRepository : IBackupRepository
public void SaveBackupSchedule(BackupSchedule schedule)
{
using var backupContext = _dbContextFactory.CreateDbContext();
backupContext.AddOrUpdate(r => r.Schedules, schedule);
backupContext.AddOrUpdate(backupContext.Schedules, schedule);
backupContext.SaveChanges();
}

View File

@ -120,7 +120,7 @@ public class AccountLinker
};
using var accountLinkContext = _accountLinkContextManager.CreateDbContext();
accountLinkContext.AddOrUpdate(r => r.AccountLinks, accountLink);
accountLinkContext.AddOrUpdate(accountLinkContext.AccountLinks, accountLink);
accountLinkContext.SaveChanges();
_accountLinkerStorage.RemoveFromCache(obj);

View File

@ -71,7 +71,7 @@ public class FeedAggregateDataProvider
};
using var feedDbContext = _dbContextFactory.CreateDbContext();
feedDbContext.AddOrUpdate(r => r.FeedLast, feedLast);
feedDbContext.AddOrUpdate(feedDbContext.FeedLast, feedLast);
feedDbContext.SaveChanges();
var aggregatedDate = DateTime.UtcNow;
@ -124,7 +124,7 @@ public class FeedAggregateDataProvider
}
}
feedDbContext.AddOrUpdate(r => r.FeedAggregates, feedAggregate);
feedDbContext.AddOrUpdate(feedDbContext.FeedAggregates, feedAggregate);
foreach (var u in f.Users)
{
@ -134,7 +134,7 @@ public class FeedAggregateDataProvider
UserId = u
};
feedDbContext.AddOrUpdate(r => r.FeedUsers, feedUser);
feedDbContext.AddOrUpdate(feedDbContext.FeedUsers, feedUser);
}
}

View File

@ -91,7 +91,7 @@ public class FeedReadedDataProvider
};
using var feedDbContext = _dbContextFactory.CreateDbContext();
feedDbContext.AddOrUpdate(r => r.FeedReaded, feedReaded);
feedDbContext.AddOrUpdate(feedDbContext.FeedReaded, feedReaded);
feedDbContext.SaveChanges();
}

View File

@ -24,6 +24,8 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
using ASC.Core.Tenants;
namespace ASC.AuditTrail.Models.Mappings;
[Scope]
@ -33,15 +35,18 @@ internal class EventTypeConverter : ITypeConverter<LoginEventQuery, LoginEventDt
private readonly UserFormatter _userFormatter;
private readonly AuditActionMapper _auditActionMapper;
private readonly MessageTarget _messageTarget;
private readonly TenantUtil _tenantUtil;
public EventTypeConverter(
UserFormatter userFormatter,
AuditActionMapper actionMapper,
MessageTarget messageTarget)
MessageTarget messageTarget,
TenantUtil tenantUtil)
{
_userFormatter = userFormatter;
_auditActionMapper = actionMapper;
_messageTarget = messageTarget;
_messageTarget = messageTarget;
_tenantUtil = tenantUtil;
}
public LoginEventDto Convert(LoginEventQuery source, LoginEventDto destination, ResolutionContext context)
@ -83,6 +88,9 @@ internal class EventTypeConverter : ITypeConverter<LoginEventQuery, LoginEventDt
}
result.ActionText = _auditActionMapper.GetActionText(_auditActionMapper.GetMessageMaps(result.Action), result);
result.Date = _tenantUtil.DateTimeFromUtc(result.Date);
result.IP = result.IP.Split(':').Length > 1 ? result.IP.Split(':')[0] : result.IP;
return result;
}
@ -138,6 +146,10 @@ internal class EventTypeConverter : ITypeConverter<LoginEventQuery, LoginEventDt
result.Product = _auditActionMapper.GetProductText(map);
result.Module = _auditActionMapper.GetModuleText(map);
}
result.Date = _tenantUtil.DateTimeFromUtc(result.Date);
result.IP = result.IP.Split(':').Length > 1 ? result.IP.Split(':')[0] : result.IP;
return result;
}

View File

@ -123,7 +123,7 @@ public class BaseIndexer<T> where T : class, ISearchItem
yield return getData(ids[i], ids[i + 1], lastIndexed);
}
webstudioDbContext.AddOrUpdate(r => r.WebstudioIndex, new DbWebstudioIndex()
webstudioDbContext.AddOrUpdate(webstudioDbContext.WebstudioIndex, new DbWebstudioIndex()
{
IndexName = Wrapper.IndexName,
LastModified = now

View File

@ -41,6 +41,7 @@
"Other": "Other",
"OwnerChange": "Change owner",
"Presentations": "Presentations",
"FormTemplates": "Form templates",
"Remove": "Remove",
"RoleCommentator": "Commentator",
"RoleCommentatorDescription": "Operations with existing files: viewing, commenting.",

View File

@ -40,6 +40,7 @@
"Other": "Другой",
"OwnerChange": "Сменить владельца",
"Presentations": "Презентации",
"FormTemplates": "Шаблоны форм",
"Spreadsheets": "Таблицы",
"SubNewForm": "Пустая",
"SubNewFormFile": " Из текстового файла",

View File

@ -1,6 +1,5 @@
import React, { useState } from "react";
import Text from "@docspace/components/text";
import { inject, observer } from "mobx-react";
import LinkWithDropdown from "@docspace/components/link-with-dropdown";
import Checkbox from "@docspace/components/checkbox";
import ArrowIcon from "@docspace/client/public/images/arrow.react.svg";
@ -86,6 +85,8 @@ const DownloadContent = (props) => {
return formats;
case "presentations":
return formats;
case "masterForms":
return formats;
default:
return [];
}
@ -170,11 +171,4 @@ const DownloadContent = (props) => {
);
};
export default inject(({ auth }) => {
const { settingsStore } = auth;
const { theme } = settingsStore;
return {
theme,
};
})(observer(DownloadContent));
export default DownloadContent;

View File

@ -5,6 +5,7 @@ const StyledDownloadDialog = styled(ModalDialog)`
.download-dialog-description {
margin-bottom: 16px;
line-height: 20px;
min-height: 40px;
}
.download-dialog-convert-message {

View File

@ -16,6 +16,7 @@ class DownloadDialogComponent extends React.Component {
documents,
spreadsheets,
presentations,
masterForms,
other,
} = this.props.sortedFiles;
@ -38,11 +39,18 @@ class DownloadDialogComponent extends React.Component {
format: null,
files: presentations,
},
masterForms: {
isChecked: true,
isIndeterminate: false,
format: null,
files: masterForms,
},
other: {
isChecked: true,
isIndeterminate: false,
files: other,
},
modalDialogToggle: "modalDialogToggle",
};
}
@ -53,6 +61,7 @@ class DownloadDialogComponent extends React.Component {
...this.state.documents.files,
...this.state.spreadsheets.files,
...this.state.presentations.files,
...this.state.masterForms.files,
...this.state.other.files,
];
@ -195,6 +204,9 @@ class DownloadDialogComponent extends React.Component {
case "presentations":
this.updateDocsState("presentations", itemId);
break;
case "masterForms":
this.updateDocsState("masterForms", itemId);
break;
case "other":
this.updateDocsState("other", itemId);
break;
@ -205,7 +217,7 @@ class DownloadDialogComponent extends React.Component {
};
render() {
const { t, tReady, visible, extsConvertible } = this.props;
const { t, tReady, visible, extsConvertible, theme } = this.props;
const {
files: documents,
@ -228,6 +240,13 @@ class DownloadDialogComponent extends React.Component {
format: presentationsTitleFormat,
} = this.state.presentations;
const {
files: masterForms,
isChecked: checkedMasterFormsTitle,
isIndeterminate: indeterminateMasterFormsTitle,
format: masterFormsTitleFormat,
} = this.state.masterForms;
const {
files: other,
isChecked: checkedOtherTitle,
@ -238,12 +257,14 @@ class DownloadDialogComponent extends React.Component {
documents.filter((f) => f.checked).length +
spreadsheets.filter((f) => f.checked).length +
presentations.filter((f) => f.checked).length +
masterForms.filter((f) => f.checked).length +
other.filter((f) => f.checked).length;
const isSingleFile = isCheckedLength <= 1;
const downloadContentProps = {
t,
theme,
extsConvertible,
onSelectFormat: this.onSelectFormat,
onRowSelect: this.onRowSelect,
@ -254,10 +275,12 @@ class DownloadDialogComponent extends React.Component {
this.state.documents.files.length +
this.state.spreadsheets.files.length +
this.state.presentations.files.length +
this.state.masterForms.files.length +
this.state.other.files.length +
(this.state.documents.files.length > 1 && 1) +
(this.state.spreadsheets.files.length > 1 && 1) +
(this.state.presentations.files.length > 1 && 1) +
(this.state.masterForms.files.length > 1 && 1) +
(this.state.other.files.length > 1 && 1);
return (
@ -273,7 +296,7 @@ class DownloadDialogComponent extends React.Component {
>
<ModalDialog.Header>{t("Translations:DownloadAs")}</ModalDialog.Header>
<ModalDialog.Body>
<ModalDialog.Body className={this.state.modalDialogToggle}>
<div className="download-dialog-description">
<Text noSelect>{t("ChooseFormatText")}.</Text>
{!isSingleFile && (
@ -318,6 +341,18 @@ class DownloadDialogComponent extends React.Component {
/>
)}
{masterForms.length > 0 && (
<DownloadContent
{...downloadContentProps}
isChecked={checkedMasterFormsTitle}
isIndeterminate={indeterminateMasterFormsTitle}
items={masterForms}
titleFormat={masterFormsTitleFormat || t("OriginalFormat")}
type="masterForms"
title={t("Translations:FormTemplates")}
/>
)}
{other.length > 0 && (
<DownloadContent
{...downloadContentProps}
@ -364,9 +399,10 @@ const DownloadDialog = withTranslation([
])(DownloadDialogComponent);
export default inject(
({ filesStore, dialogsStore, filesActionsStore, settingsStore }) => {
({ auth, filesStore, dialogsStore, filesActionsStore, settingsStore }) => {
const { sortedFiles } = filesStore;
const { extsConvertible } = settingsStore;
const { theme } = auth.settingsStore;
const {
downloadDialogVisible: visible,
@ -382,6 +418,8 @@ export default inject(
setDownloadDialogVisible,
downloadFiles,
theme,
};
}
)(withRouter(observer(DownloadDialog)));

View File

@ -220,19 +220,16 @@ class FilesContent extends React.Component {
}
render() {
const { showArticle, isFrame, withMainButton } = this.props;
const { showMenu, isFrame, withMainButton, history } = this.props;
return (
<>
<GlobalEvents />
<Panels />
{isFrame ? (
showArticle && <FilesArticle history={this.props.history} />
showMenu && <FilesArticle history={history} />
) : (
<FilesArticle
history={this.props.history}
withMainButton={withMainButton}
/>
<FilesArticle history={history} withMainButton={withMainButton} />
)}
<FilesSection />
</>
@ -257,7 +254,7 @@ const Files = inject(({ auth, filesStore }) => {
return {
isDesktop: isDesktopClient,
isFrame,
showArticle: frameConfig?.showArticle,
showMenu: frameConfig?.showMenu,
user: auth.userStore.user,
isAuthenticated: auth.isAuthenticated,
encryptionKeys: encryptionKeys,

View File

@ -114,20 +114,17 @@ const InfoPanelBodyContent = ({
const currentFolderRoomId =
selectedFolder?.pathParts &&
selectedFolder?.pathParts?.length === 2 &&
selectedFolder?.pathParts?.length > 1 &&
selectedFolder.pathParts[1];
const storeRoomId = selectionParentRoom?.id;
if (!currentFolderRoomId || currentFolderRoomId === storeRoomId) return;
const newSelectionParentRoom = await getRoomInfo(currentFolderRoomId);
if (storeRoomId === newSelectionParentRoom.id) return;
if (
newSelectionParentRoom.parentId === newSelectionParentRoom.rootFolderId
) {
setSelectionParentRoom(null);
} else setSelectionParentRoom(normalizeSelection(newSelectionParentRoom));
setSelectionParentRoom(normalizeSelection(newSelectionParentRoom));
}, [selectedFolder]);
//////////////////////////////////////////////////////////
@ -189,6 +186,8 @@ export default inject(({ auth, selectedFolderStore, oformsStore }) => {
calculateSelection,
normalizeSelection,
isItemChanged,
selectionParentRoom,
setSelectionParentRoom,
roomsView,
fileView,

View File

@ -86,14 +86,14 @@ class FilesTableHeader extends React.Component {
resizable: true,
sortBy: "Author",
isDisabled: isPersonalRoom,
// isDisabled: isPersonalRoom,
onClick: this.onFilter,
onChange: this.onColumnChange,
};
if (isPersonalRoom) {
authorOption.defaultSize = 0;
}
// if (isPersonalRoom) {
// authorOption.defaultSize = 0;
// }
const columns = [
{

View File

@ -561,7 +561,7 @@ const SectionFilterContent = ({
}
}
return filterValues;
// return filterValues;
const currentFilterValues = [];
setSelectedFilterValues((value) => {
@ -949,38 +949,36 @@ const SectionFilterContent = ({
filterOptions.push(...contentOptions);
}
if (!isPersonalRoom) {
const authorOption = [
{
key: FilterGroups.filterAuthor,
group: FilterGroups.filterAuthor,
label: t("ByAuthor"),
isHeader: true,
withMultiItems: true,
},
{
id: "filter_author-me",
key: FilterKeys.me,
group: FilterGroups.filterAuthor,
label: t("Common:MeLabel"),
},
{
id: "filter_author-other",
key: FilterKeys.other,
group: FilterGroups.filterAuthor,
label: t("Common:OtherLabel"),
},
{
id: "filter_author-user",
key: FilterKeys.user,
group: FilterGroups.filterAuthor,
label: t("Translations:AddAuthor"),
isSelector: true,
},
];
const authorOption = [
{
key: FilterGroups.filterAuthor,
group: FilterGroups.filterAuthor,
label: t("ByAuthor"),
isHeader: true,
withMultiItems: true,
},
{
id: "filter_author-me",
key: FilterKeys.me,
group: FilterGroups.filterAuthor,
label: t("Common:MeLabel"),
},
{
id: "filter_author-other",
key: FilterKeys.other,
group: FilterGroups.filterAuthor,
label: t("Common:OtherLabel"),
},
{
id: "filter_author-user",
key: FilterKeys.user,
group: FilterGroups.filterAuthor,
label: t("Translations:ChooseFromList"),
isSelector: true,
},
];
filterOptions.push(...authorOption);
}
filterOptions.push(...authorOption);
filterOptions.push(...typeOptions);
}

View File

@ -439,6 +439,7 @@ class ContextOptionsStore {
onShowInfoPanel = (item) => {
const { setSelection, setIsVisible } = this.authStore.infoPanelStore;
setSelection(item);
setIsVisible(true);
};
@ -816,7 +817,7 @@ class ContextOptionsStore {
{
id: "option_show-info",
key: "show-info",
label: t("Common:Info"),
label: t("InfoPanel:ViewDetails"),
icon: "/static/images/info.outline.react.svg",
onClick: () => this.onShowInfoPanel(item),
disabled: false,

View File

@ -2390,12 +2390,14 @@ class FilesStore {
isSpreadsheet,
isPresentation,
isDocument,
isMasterFormExtension,
} = this.filesSettingsStore;
let sortedFiles = {
documents: [],
spreadsheets: [],
presentations: [],
masterForms: [],
other: [],
};
@ -2420,6 +2422,8 @@ class FilesStore {
sortedFiles.presentations.push(item);
} else if (isDocument(item.fileExst)) {
sortedFiles.documents.push(item);
} else if (isMasterFormExtension(item.fileExst)) {
sortedFiles.masterForms.push(item);
} else {
sortedFiles.other.push(item);
}

View File

@ -208,6 +208,8 @@ class SettingsStore {
isDocument = (extension) => presentInArray(this.extsDocument, extension);
isMasterFormExtension = (extension) => this.masterFormExtension === extension;
isPresentation = (extension) =>
presentInArray(this.extsPresentation, extension);

View File

@ -383,11 +383,7 @@ const FilterBlock = ({
</StyledFilterBlockHeader>
<div className="filter-body">
{isLoading ? (
<Loaders.FilterBlock
isPersonalRoom={isPersonalRoom}
isRooms={isRooms}
isAccounts={isAccounts}
/>
<Loaders.FilterBlock isRooms={isRooms} isAccounts={isAccounts} />
) : (
<Scrollbar className="filter-body__scrollbar" stype="mediumBlack">
{filterData.map((item, index) => {

View File

@ -8,7 +8,6 @@ const FilterBlockLoader = ({
id,
className,
style,
isPersonalRoom,
isRooms,
isAccounts,
...rest
@ -46,7 +45,7 @@ const FilterBlockLoader = ({
</StyledBlock>
)}
{!isPersonalRoom && !isAccounts && (
{!isAccounts && (
<StyledBlock>
<RectangleLoader
width={"51"}

View File

@ -42,7 +42,10 @@ class InfoPanelStore {
// Setters
setIsVisible = (bool) => (this.isVisible = bool);
setIsVisible = (bool) => {
this.setView("info_details");
this.isVisible = bool;
};
setIsMobileHidden = (bool) => (this.isMobileHidden = bool);
setSelection = (selection) => {

View File

@ -412,21 +412,22 @@ export function checkIsSSR() {
return typeof window === "undefined";
}
export const frameCallbackData = (data) => {
export const frameCallbackData = (methodReturnData: any) => {
window.parent.postMessage(
JSON.stringify({
type: "onMethodReturn",
methodReturnData: data,
methodReturnData,
}),
"*"
);
};
export const frameCallCommand = (command) => {
export const frameCallCommand = (commandName: string, commandData: any) => {
window.parent.postMessage(
JSON.stringify({
type: "onCallCommand",
commandName: command,
commandName,
commandData,
}),
"*"
);

View File

@ -105,7 +105,7 @@ public class TokenHelper
};
using var filesDbContext = _dbContextFactory.CreateDbContext();
filesDbContext.AddOrUpdate(r => r.ThirdpartyApp, dbFilesThirdpartyApp);
filesDbContext.AddOrUpdate(filesDbContext.ThirdpartyApp, dbFilesThirdpartyApp);
filesDbContext.SaveChanges();
}

View File

@ -1,6 +1,6 @@
(function () {
const defaultConfig = {
src: `${window.location.protocol}//${window.location.hostname}:8092`,
src: new URL(document.currentScript.src).origin,
rootPath: "/rooms/personal/",
width: "100%",
height: "100%",
@ -11,9 +11,10 @@
fileId: null,
editorType: "embedded", //TODO: ["desktop", "embedded"]
showHeader: false,
showArticle: false,
showTitle: true,
showMenu: false,
showFilter: false,
showAction: false,
destroyText: "Frame container",
viewAs: "row", //TODO: ["row", "table", "tile"]
filter: {
@ -37,7 +38,12 @@
"fileId",
"type",
"editorType",
"mode",
],
events: {
onSelectCallback: (e) => console.log("onCloseCallback", e),
onCloseCallback: null,
},
};
const getConfigFromParams = () => {
@ -168,7 +174,7 @@
break;
}
case "onCallCommand": {
this[frameData.commandName].call(this);
this[frameData.commandName].call(this, frameData.commandData);
break;
}
default: