Merge branch 'release/1.0.0' of github.com:ONLYOFFICE/AppServer into release/1.0.0

This commit is contained in:
Nikita Gopienko 2021-10-18 10:36:06 +03:00
commit f3796d1d56
15 changed files with 19657 additions and 19838 deletions

8
build/Jenkinsfile vendored
View File

@ -8,7 +8,7 @@ pipeline {
stages {
stage('Frontend') {
steps {
sh 'yarn install && yarn build'
sh 'yarn install --frozen-lockfile && yarn build'
}
}
stage('Backend') {
@ -23,7 +23,7 @@ pipeline {
stages {
stage('Frontend') {
steps {
bat 'yarn install && yarn build'
bat "yarn install --frozen-lockfile && yarn build"
}
}
stage('Backend') {
@ -43,7 +43,7 @@ pipeline {
stages {
stage('Components') {
steps {
sh "yarn install && yarn build && cd ${env.WORKSPACE}/packages/asc-web-components && yarn test:coverage --ci --reporters=default --reporters=jest-junit || true"
sh "yarn install --frozen-lockfile && yarn build && cd ${env.WORKSPACE}/packages/asc-web-components && yarn test:coverage --ci --reporters=default --reporters=jest-junit || true"
}
post {
success {
@ -72,7 +72,7 @@ pipeline {
stages {
stage('Components') {
steps {
bat "yarn install && yarn build && cd ${env.WORKSPACE}\\packages\\asc-web-components && yarn test:coverage --ci --reporters=default --reporters=jest-junit || true"
bat "yarn install --frozen-lockfile && yarn build && cd ${env.WORKSPACE}\\packages\\asc-web-components && yarn test:coverage --ci --reporters=default --reporters=jest-junit || true"
}
post {
success {

View File

@ -53,35 +53,22 @@ namespace ASC.Data.Storage
protected EmailValidationKeyProvider EmailValidationKeyProvider { get; }
protected IHttpContextAccessor HttpContextAccessor { get; }
protected IOptionsMonitor<ILog> Options { get; }
public BaseStorage(
TempStream tempStream,
TenantManager tenantManager,
PathUtils pathUtils,
EmailValidationKeyProvider emailValidationKeyProvider,
IOptionsMonitor<ILog> options)
{
TempStream = tempStream;
TenantManager = tenantManager;
PathUtils = pathUtils;
EmailValidationKeyProvider = emailValidationKeyProvider;
Options = options;
Log = options.CurrentValue;
}
public BaseStorage(
TempStream tempStream,
TenantManager tenantManager,
PathUtils pathUtils,
EmailValidationKeyProvider emailValidationKeyProvider,
IHttpContextAccessor httpContextAccessor,
IOptionsMonitor<ILog> options) : this(
tempStream,
tenantManager,
pathUtils,
emailValidationKeyProvider,
options)
IOptionsMonitor<ILog> options)
{
TempStream = tempStream;
TenantManager = tenantManager;
PathUtils = pathUtils;
EmailValidationKeyProvider = emailValidationKeyProvider;
Options = options;
Log = options.CurrentValue;
HttpContextAccessor = httpContextAccessor;
}

View File

@ -76,21 +76,7 @@ namespace ASC.Data.Storage.DiscStorage
return this;
}
public DiscDataStore(
TempStream tempStream,
TenantManager tenantManager,
PathUtils pathUtils,
EmailValidationKeyProvider emailValidationKeyProvider,
IOptionsMonitor<ILog> options,
EncryptionSettingsHelper encryptionSettingsHelper,
EncryptionFactory encryptionFactory)
: base(tempStream, tenantManager, pathUtils, emailValidationKeyProvider, options)
{
EncryptionSettingsHelper = encryptionSettingsHelper;
EncryptionFactory = encryptionFactory;
}
public DiscDataStore(
TempStream tempStream,
TenantManager tenantManager,

View File

@ -71,16 +71,7 @@ namespace ASC.Data.Storage.GoogleCloud
private Uri _bucketSSlRoot;
private bool _lowerCasing = true;
public GoogleCloudStorage(
TempStream tempStream,
TenantManager tenantManager,
PathUtils pathUtils,
EmailValidationKeyProvider emailValidationKeyProvider,
IOptionsMonitor<ILog> options) : base(tempStream, tenantManager, pathUtils, emailValidationKeyProvider, options)
{
}
public GoogleCloudStorage(
TempStream tempStream,
TenantManager tenantManager,

View File

@ -64,20 +64,7 @@ namespace ASC.Data.Storage.RackspaceCloud
private Uri _cnameSSL;
private readonly ILog _logger;
public RackspaceCloudStorage(
TempPath tempPath,
TempStream tempStream,
TenantManager tenantManager,
PathUtils pathUtils,
EmailValidationKeyProvider emailValidationKeyProvider,
IOptionsMonitor<ILog> options)
: base(tempStream, tenantManager, pathUtils, emailValidationKeyProvider, options)
{
_logger = options.Get("ASC.Data.Storage.Rackspace.RackspaceCloudStorage");
TempPath = tempPath;
}
public RackspaceCloudStorage(
TempPath tempPath,
TempStream tempStream,

View File

@ -77,17 +77,7 @@ namespace ASC.Data.Storage.S3
private bool _revalidateCloudFront;
private string _distributionId = string.Empty;
private string _subDir = string.Empty;
public S3Storage(
TempStream tempStream,
TenantManager tenantManager,
PathUtils pathUtils,
EmailValidationKeyProvider emailValidationKeyProvider,
IOptionsMonitor<ILog> options)
: base(tempStream, tenantManager, pathUtils, emailValidationKeyProvider, options)
{
}
public S3Storage(
TempStream tempStream,
TenantManager tenantManager,

View File

@ -24,7 +24,7 @@ map $request_uri $header_x_frame_options {
map $request_uri $cache_control {
default "no-cache, no-store, must-revalidate";
# ~*^/(api\/2\.0.*|storage|login\.ashx|products\/.+\/httphandlers\/filehandler\.ashx|ChunkedUploader.ashx|apisystem|sh) "no-cache, no-store, must-revalidate";
~*\/(api\/2\.0.*|storage|login\.ashx|products\/.+\/httphandlers\/filehandler\.ashx|ChunkedUploader.ashx|apisystem|sh|remoteEntry\.js|debuginfo\.md) "no-cache, no-store, must-revalidate";
~*\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|md|css|js)$ "public, no-transform";
}

View File

@ -125,6 +125,8 @@ class MediaViewer extends React.Component {
const { playlistPos, fileUrl } = this.state;
const src = playlist[playlistPos]?.src;
const title = playlist[playlistPos]?.title;
const ext = this.getFileExtension(title);
if (visible !== prevProps.visible) {
const newPlaylistPos =
@ -138,7 +140,13 @@ class MediaViewer extends React.Component {
});
}
if (src && src !== fileUrl && playlistPos === prevState.playlistPos) {
if (
src &&
src !== fileUrl &&
playlistPos === prevState.playlistPos &&
ext !== ".tif" &&
ext !== ".tiff"
) {
this.setState({ fileUrl: src });
}
@ -147,10 +155,6 @@ class MediaViewer extends React.Component {
visible === prevProps.visible &&
playlistPos !== prevState.playlistPos
) {
const currentFile = playlist[playlistPos];
const { src, title } = currentFile;
const ext = this.getFileExtension(title);
if (ext === ".tiff" || ext === ".tif") {
this.getTiffDataURL(src);
} else {

View File

@ -5,6 +5,7 @@ import { tablet } from "@appserver/components/utils/device";
const StyledArticleMainButton = styled.div`
margin: 12px 0 0;
max-width: 216px;
.main-button_drop-down {
line-height: 36px;
}

View File

@ -383,6 +383,7 @@ class AvatarEditorBody extends React.Component {
onImageChange={this.throttledSetCroppedImage}
onPositionChange={this.onPositionChange}
onImageReady={this.onImageReady}
crossOrigin="anonymous"
/>
<Box className="editor-buttons">
<Box></Box>

View File

@ -42,16 +42,16 @@ class DeleteDialogComponent extends React.Component {
}
componentDidMount() {
document.addEventListener("keydown", this.onKeydown, false);
document.addEventListener("keyup", this.onKeyUp, false);
}
componentWillUnmount() {
document.removeEventListener("keydown", this.onKeydown, false);
document.removeEventListener("keyup", this.onKeyUp, false);
}
onKeydown = (e) => {
onKeyUp = (e) => {
if (e.keyCode === 27) this.onClose();
if (e.keyCode === 13) this.onDelete();
if (e.keyCode === 13 || e.which === 13) this.onDelete();
};
onDelete = () => {

View File

@ -45,6 +45,7 @@ class DownloadDialogComponent extends React.Component {
const { documents, spreadsheets, presentations, other } = this.state;
const files = [];
const folders = [];
let singleFileUrl = null;
const collectItems = (itemList) => {
for (let item of itemList) {
@ -54,8 +55,10 @@ class DownloadDialogComponent extends React.Component {
item.format === this.props.t("OriginalFormat")
? item.fileExst
: item.format;
const viewUrl = item.viewUrl;
files.push({ key: item.id, value: format, viewUrl });
if (!singleFileUrl) {
singleFileUrl = item.viewUrl;
}
files.push({ key: item.id, value: format });
} else {
folders.push(item.id);
}
@ -68,22 +71,21 @@ class DownloadDialogComponent extends React.Component {
collectItems(presentations);
collectItems(other);
return [files, folders];
return [files, folders, singleFileUrl];
};
onDownload = () => {
const { t, downloadFiles } = this.props;
const [fileConvertIds, folderIds] = this.getDownloadItems();
const [fileConvertIds, folderIds, singleFileUrl] = this.getDownloadItems();
if (fileConvertIds.length === 1 && folderIds.length === 0) {
// Single file download as
const file = fileConvertIds[0];
let viewUrl = file.viewUrl;
if (file.value) {
viewUrl = `${viewUrl}&outputtype=${file.value}`;
if (file.value && singleFileUrl) {
const viewUrl = `${singleFileUrl}&outputtype=${file.value}`;
window.open(viewUrl, "_self");
}
window.open(viewUrl, "_self");
this.onClose();
} else if (fileConvertIds.length || folderIds.length) {
this.onClose();

View File

@ -184,14 +184,21 @@ class FilesActionStore {
icon: "file",
label,
};
const item = await this.uploadDataStore.loopFilesOperations(
data,
pbData
);
const item =
data?.finished && data?.url
? data
: await this.uploadDataStore.loopFilesOperations(data, pbData);
if (item.url) {
window.location.href = item.url;
} else {
setSecondaryProgressBarData({
visible: true,
alert: true,
});
}
setTimeout(() => clearSecondaryProgressData(), TIMEOUT);
});
} catch (err) {

View File

@ -137,8 +137,6 @@ const MyProfileRoute = (props) => (
</React.Suspense>
);
let index = 0;
const Shell = ({ items = [], page = "home", ...rest }) => {
const {
isLoaded,
@ -351,7 +349,7 @@ const Shell = ({ items = [], page = "home", ...rest }) => {
const remoteEntryURL = combineUrl(
window.location.origin,
appURL,
`remoteEntry.js?__index=${++index}`
`remoteEntry.js`
);
const system = {

39339
yarn.lock

File diff suppressed because it is too large Load Diff