Merge branch 'hotfix/v0.1.9' of github.com:ONLYOFFICE/AppServer into hotfix/v0.1.9

This commit is contained in:
Ilya Oleshko 2021-05-04 20:36:07 +03:00
commit 91980d7dae
23 changed files with 228 additions and 158 deletions

View File

@ -44,7 +44,18 @@ RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
cd ${SRC_PATH}/build/install/common/ && \ cd ${SRC_PATH}/build/install/common/ && \
bash build-frontend.sh -sp ${SRC_PATH} && \ bash build-frontend.sh -sp ${SRC_PATH} && \
bash build-backend.sh -sp ${SRC_PATH} -ar "--disable-parallel" && \ bash build-backend.sh -sp ${SRC_PATH} -ar "--disable-parallel" && \
bash publish-backend.sh -sp ${SRC_PATH} -bp ${BUILD_PATH} -ar "--disable-parallel" bash publish-backend.sh -sp ${SRC_PATH} -bp ${BUILD_PATH} -ar "--disable-parallel" && \
rm -rf ${SRC_PATH}/common/* && \
rm -rf ${SRC_PATH}/web/ASC.Web.Core/* && \
rm -rf ${SRC_PATH}/web/ASC.Web.Studio/* && \
rm -rf ${SRC_PATH}/products/ASC.Calendar/Server/* && \
rm -rf ${SRC_PATH}/products/ASC.CRM/Server/* && \
rm -rf ${SRC_PATH}/products/ASC.Files/Server/* && \
rm -rf ${SRC_PATH}/products/ASC.Files/Service/* && \
rm -rf ${SRC_PATH}/products/ASC.Mail/Server/* && \
rm -rf ${SRC_PATH}/products/ASC.People/Server/* && \
rm -rf ${SRC_PATH}/products/ASC.Projects/Server/*
COPY config/mysql/conf.d/mysql.cnf /etc/mysql/conf.d/mysql.cnf COPY config/mysql/conf.d/mysql.cnf /etc/mysql/conf.d/mysql.cnf

View File

@ -638,8 +638,7 @@ export function getSettingsFiles() {
} }
export function markAsFavorite(ids) { export function markAsFavorite(ids) {
let items = ids.map((id) => +id); const data = { fileIds: ids };
const data = { fileIds: items };
const options = { const options = {
method: "post", method: "post",
url: "/files/favorites", url: "/files/favorites",
@ -650,8 +649,7 @@ export function markAsFavorite(ids) {
} }
export function removeFromFavorite(ids) { export function removeFromFavorite(ids) {
let items = ids.map((id) => +id); const data = { fileIds: ids };
const data = { fileIds: items };
const options = { const options = {
method: "delete", method: "delete",
url: "/files/favorites", url: "/files/favorites",

View File

@ -163,3 +163,27 @@ export const LoaderStyle = {
import config from "./AppServerConfig"; import config from "./AppServerConfig";
export const AppServerConfig = config; export const AppServerConfig = config;
/**
* Enum for Tenant trusted domains on registration.
* @readonly
*/
export const TenantTrustedDomainsType = Object.freeze({
None: 0,
Custom: 1,
All: 2,
});
export const FilesFormats = Object.freeze({
OriginalFormat: 0,
TxtFormat: 1,
DocxFormat: 2,
OdtFormat: 3,
OdsFormat: 4,
OdpFormat: 5,
PdfFormat: 6,
RtfFormat: 7,
XlsxFormat: 8,
PptxFormat: 9,
CustomFormat: 10,
});

View File

@ -13,7 +13,8 @@ class SettingsStore {
culture = "en-US"; culture = "en-US";
cultures = []; cultures = [];
trustedDomains = []; trustedDomains = [];
trustedDomainsType = 1; trustedDomainsType = 0;
trustedDomains = [];
timezone = "UTC"; timezone = "UTC";
timezones = []; timezones = [];
utcOffset = "00:00:00"; utcOffset = "00:00:00";

View File

@ -199,7 +199,7 @@ export function clickBackdrop() {
} }
} }
export default function objectToGetParams(object) { export function objectToGetParams(object) {
const params = Object.entries(object) const params = Object.entries(object)
.filter(([, value]) => value !== undefined && value !== null) .filter(([, value]) => value !== undefined && value !== null)
.map( .map(
@ -209,3 +209,18 @@ export default function objectToGetParams(object) {
return params.length > 0 ? `?${params.join("&")}` : ""; return params.length > 0 ? `?${params.join("&")}` : "";
} }
export function toCommunityHostname(hostname) {
let communityHostname;
try {
communityHostname =
hostname.indexOf("m.") > -1
? hostname.substring(2, hostname.length)
: hostname;
} catch (e) {
console.error(e);
communityHostname = hostname;
}
return communityHostname;
}

View File

@ -19,7 +19,7 @@ import { setDocumentTitle } from "../../helpers/utils";
import { inject } from "mobx-react"; import { inject } from "mobx-react";
import i18n from "../../i18n"; import i18n from "../../i18n";
import { I18nextProvider } from "react-i18next"; import { I18nextProvider } from "react-i18next";
import { combineUrl, deleteCookie } from "@appserver/common/utils"; import { toCommunityHostname, deleteCookie } from "@appserver/common/utils";
const commonStyles = ` const commonStyles = `
.link-box { .link-box {
@ -121,12 +121,11 @@ const Body = ({ modules, match, isLoaded, setCurrentProductId, t, tReady }) => {
const { error } = match.params; const { error } = match.params;
const { pathname, protocol, hostname } = window.location; const { pathname, protocol, hostname } = window.location;
const currentModule = modules.find((m) => m.link === pathname); const currentModule = modules.find((m) => m.link === pathname);
const { id, title, imageUrl, link, originUrl, helpUrl } = currentModule; const { id, title, imageUrl, /*link, originUrl,*/ helpUrl } = currentModule;
const url = originUrl ? originUrl : link; //const url = originUrl ? originUrl : link;
const webLink = combineUrl( const communityHostname = toCommunityHostname(hostname);
protocol + "//" + hostname, const webLink = `${protocol}//${communityHostname}/Products/CRM/?desktop_view=true`;
`${url}?desktop_view=true`
);
const appLink = isIOS const appLink = isIOS
? id === "2A923037-8B2D-487b-9A22-5AC0918ACF3F" ? id === "2A923037-8B2D-487b-9A22-5AC0918ACF3F"
? "message:" ? "message:"

View File

@ -19,7 +19,7 @@ import { setDocumentTitle } from "../../helpers/utils";
import { inject } from "mobx-react"; import { inject } from "mobx-react";
import i18n from "../../i18n"; import i18n from "../../i18n";
import { I18nextProvider } from "react-i18next"; import { I18nextProvider } from "react-i18next";
import { combineUrl, deleteCookie } from "@appserver/common/utils"; import { toCommunityHostname, deleteCookie } from "@appserver/common/utils";
const commonStyles = ` const commonStyles = `
.link-box { .link-box {
@ -121,12 +121,10 @@ const Body = ({ modules, match, isLoaded, setCurrentProductId, t, tReady }) => {
const { error } = match.params; const { error } = match.params;
const { pathname, protocol, hostname } = window.location; const { pathname, protocol, hostname } = window.location;
const currentModule = modules.find((m) => m.link === pathname); const currentModule = modules.find((m) => m.link === pathname);
const { id, title, imageUrl, link, originUrl, helpUrl } = currentModule; const { id, title, imageUrl, /*link, originUrl,*/ helpUrl } = currentModule;
const url = originUrl ? originUrl : link; //const url = originUrl ? originUrl : link;
const webLink = combineUrl( const communityHostname = toCommunityHostname(hostname);
protocol + "//" + hostname, const webLink = `${protocol}//${communityHostname}/addons/calendar/?desktop_view=true`;
`${url}?desktop_view=true`
);
const appLink = isIOS const appLink = isIOS
? id === "2A923037-8B2D-487b-9A22-5AC0918ACF3F" ? id === "2A923037-8B2D-487b-9A22-5AC0918ACF3F"
? "message:" ? "message:"

View File

@ -5,6 +5,7 @@ import RowContainer from "@appserver/components/row-container";
import Text from "@appserver/components/text"; import Text from "@appserver/components/text";
import LinkWithDropdown from "@appserver/components/link-with-dropdown"; import LinkWithDropdown from "@appserver/components/link-with-dropdown";
import styled from "styled-components"; import styled from "styled-components";
import { FilesFormats } from "@appserver/common/constants";
const StyledDownloadContent = styled.div` const StyledDownloadContent = styled.div`
.row_content, .row_content,
@ -19,7 +20,6 @@ const DownloadContent = (props) => {
checkedTitle, checkedTitle,
indeterminateTitle, indeterminateTitle,
items, items,
formatKeys,
onSelectFormat, onSelectFormat,
onRowSelect, onRowSelect,
getItemIcon, getItemIcon,
@ -35,7 +35,7 @@ const DownloadContent = (props) => {
label: t("OriginalFormat"), label: t("OriginalFormat"),
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.OriginalFormat, FilesFormats.OriginalFormat,
item, item,
"document" "document"
), ),
@ -45,7 +45,7 @@ const DownloadContent = (props) => {
label: ".txt", label: ".txt",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.TxtFormat, FilesFormats.TxtFormat,
item, item,
"document" "document"
), ),
@ -55,7 +55,7 @@ const DownloadContent = (props) => {
label: ".docx", label: ".docx",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.DocxFormat, FilesFormats.DocxFormat,
item, item,
"document" "document"
), ),
@ -65,7 +65,7 @@ const DownloadContent = (props) => {
label: ".odt", label: ".odt",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.OdtFormat, FilesFormats.OdtFormat,
item, item,
"document" "document"
), ),
@ -75,7 +75,7 @@ const DownloadContent = (props) => {
label: ".pdf", label: ".pdf",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.PdfFormat, FilesFormats.PdfFormat,
item, item,
"document" "document"
), ),
@ -85,7 +85,7 @@ const DownloadContent = (props) => {
label: ".rtf", label: ".rtf",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.RtfFormat, FilesFormats.RtfFormat,
item, item,
"document" "document"
), ),
@ -95,7 +95,7 @@ const DownloadContent = (props) => {
label: t("CustomFormat"), label: t("CustomFormat"),
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.CustomFormat, FilesFormats.CustomFormat,
item, item,
"document" "document"
), ),
@ -108,7 +108,7 @@ const DownloadContent = (props) => {
label: t("OriginalFormat"), label: t("OriginalFormat"),
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.OriginalFormat, FilesFormats.OriginalFormat,
item, item,
"presentation" "presentation"
), ),
@ -118,7 +118,7 @@ const DownloadContent = (props) => {
label: ".odp", label: ".odp",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.OdpFormat, FilesFormats.OdpFormat,
item, item,
"presentation" "presentation"
), ),
@ -128,7 +128,7 @@ const DownloadContent = (props) => {
label: ".pdf", label: ".pdf",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.PdfFormat, FilesFormats.PdfFormat,
item, item,
"presentation" "presentation"
), ),
@ -138,7 +138,7 @@ const DownloadContent = (props) => {
label: ".pptx", label: ".pptx",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.PptxFormat, FilesFormats.PptxFormat,
item, item,
"presentation" "presentation"
), ),
@ -148,7 +148,7 @@ const DownloadContent = (props) => {
label: t("CustomFormat"), label: t("CustomFormat"),
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.CustomFormat, FilesFormats.CustomFormat,
item, item,
"presentation" "presentation"
), ),
@ -161,7 +161,7 @@ const DownloadContent = (props) => {
label: t("OriginalFormat"), label: t("OriginalFormat"),
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.OriginalFormat, FilesFormats.OriginalFormat,
item, item,
"spreadsheet" "spreadsheet"
), ),
@ -171,7 +171,7 @@ const DownloadContent = (props) => {
label: ".odp", label: ".odp",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.OdsFormat, FilesFormats.OdsFormat,
item, item,
"spreadsheet" "spreadsheet"
), ),
@ -181,7 +181,7 @@ const DownloadContent = (props) => {
label: ".pdf", label: ".pdf",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.PdfFormat, FilesFormats.PdfFormat,
item, item,
"spreadsheet" "spreadsheet"
), ),
@ -191,7 +191,7 @@ const DownloadContent = (props) => {
label: ".xlsx", label: ".xlsx",
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.XlsxFormat, FilesFormats.XlsxFormat,
item, item,
"spreadsheet" "spreadsheet"
), ),
@ -201,7 +201,7 @@ const DownloadContent = (props) => {
label: t("CustomFormat"), label: t("CustomFormat"),
onClick: onSelectFormat.bind( onClick: onSelectFormat.bind(
this, this,
formatKeys.CustomFormat, FilesFormats.CustomFormat,
item, item,
"spreadsheet" "spreadsheet"
), ),
@ -256,18 +256,22 @@ const DownloadContent = (props) => {
</Text> </Text>
<></> <></>
<Text fontSize="12px" containerWidth="auto"> <Text fontSize="12px" containerWidth="auto">
{t("ConvertInto")} {(checkedTitle || indeterminateTitle) && t("ConvertInto")}
</Text> </Text>
<LinkWithDropdown {checkedTitle || indeterminateTitle ? (
containerWidth="auto" <LinkWithDropdown
data={formats} containerWidth="auto"
directionX="left" data={formats}
directionY="bottom" directionX="left"
dropdownType="appearDashedAfterHover" directionY="bottom"
fontSize="12px" dropdownType="appearDashedAfterHover"
> fontSize="12px"
{documentsTitle} >
</LinkWithDropdown> {documentsTitle}
</LinkWithDropdown>
) : (
<></>
)}
</RowContent> </RowContent>
</Row> </Row>
)} )}
@ -297,19 +301,26 @@ const DownloadContent = (props) => {
{file.title} {file.title}
</Text> </Text>
<></> <></>
<Text fontSize="12px" containerWidth="auto"> {file.checked && (
{file.checked && t("ConvertInto")} <Text fontSize="12px" containerWidth="auto">
</Text> {t("ConvertInto")}
<LinkWithDropdown </Text>
dropdownType="appearDashedAfterHover" )}
containerWidth="auto"
data={dropdownItems} {file.checked ? (
directionX="left" <LinkWithDropdown
directionY="bottom" dropdownType="appearDashedAfterHover"
fontSize="12px" containerWidth="auto"
> data={dropdownItems}
{format} directionX="left"
</LinkWithDropdown> directionY="bottom"
fontSize="12px"
>
{format}
</LinkWithDropdown>
) : (
<></>
)}
</RowContent> </RowContent>
</Row> </Row>
); );

View File

@ -13,20 +13,7 @@ import { downloadFormatFiles } from "@appserver/common/api/files";
import { TIMEOUT } from "../../../helpers/constants"; import { TIMEOUT } from "../../../helpers/constants";
import DownloadContent from "./DownloadContent"; import DownloadContent from "./DownloadContent";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { FilesFormats } from "@appserver/common/constants";
const formatKeys = Object.freeze({
OriginalFormat: 0,
TxtFormat: 1,
DocxFormat: 2,
OdtFormat: 3,
OdsFormat: 4,
OdpFormat: 5,
PdfFormat: 6,
RtfFormat: 7,
XlsxFormat: 8,
PptxFormat: 9,
CustomFormat: 10,
});
class DownloadDialogComponent extends React.Component { class DownloadDialogComponent extends React.Component {
constructor(props) { constructor(props) {
@ -39,9 +26,9 @@ class DownloadDialogComponent extends React.Component {
presentations: sortedFiles.presentations, presentations: sortedFiles.presentations,
other: sortedFiles.other, other: sortedFiles.other,
documentsTitleFormat: formatKeys.OriginalFormat, documentsTitleFormat: FilesFormats.OriginalFormat,
spreadsheetsTitleFormat: formatKeys.OriginalFormat, spreadsheetsTitleFormat: FilesFormats.OriginalFormat,
presentationsTitleFormat: formatKeys.OriginalFormat, presentationsTitleFormat: FilesFormats.OriginalFormat,
checkedDocTitle: true, checkedDocTitle: true,
checkedSpreadsheetTitle: true, checkedSpreadsheetTitle: true,
@ -192,8 +179,8 @@ class DownloadDialogComponent extends React.Component {
if (!file) { if (!file) {
for (let file of newDocuments) { for (let file of newDocuments) {
file.format = file.format =
format === formatKeys.CustomFormat || file.fileExst === format format === FilesFormats.CustomFormat || file.fileExst === format
? formatKeys.OriginalFormat ? FilesFormats.OriginalFormat
: format; : format;
} }
this.setState({ this.setState({
@ -207,7 +194,7 @@ class DownloadDialogComponent extends React.Component {
newDoc.format = format; newDoc.format = format;
this.setState({ this.setState({
documents: newDocuments, documents: newDocuments,
documentsTitleFormat: formatKeys.CustomFormat, documentsTitleFormat: FilesFormats.CustomFormat,
}); });
} }
} }
@ -216,8 +203,8 @@ class DownloadDialogComponent extends React.Component {
if (!file) { if (!file) {
for (let file of newSpreadsheets) { for (let file of newSpreadsheets) {
file.format = file.format =
format === formatKeys.CustomFormat || file.fileExst === format format === FilesFormats.CustomFormat || file.fileExst === format
? formatKeys.OriginalFormat ? FilesFormats.OriginalFormat
: format; : format;
} }
this.setState({ this.setState({
@ -231,7 +218,7 @@ class DownloadDialogComponent extends React.Component {
newSpreadsheet.format = format; newSpreadsheet.format = format;
this.setState({ this.setState({
spreadsheets: newSpreadsheets, spreadsheets: newSpreadsheets,
spreadsheetsTitleFormat: formatKeys.CustomFormat, spreadsheetsTitleFormat: FilesFormats.CustomFormat,
}); });
} }
} }
@ -240,8 +227,8 @@ class DownloadDialogComponent extends React.Component {
if (!file) { if (!file) {
for (let file of newPresentations) { for (let file of newPresentations) {
file.format = file.format =
format === formatKeys.CustomFormat || file.fileExst === format format === FilesFormats.CustomFormat || file.fileExst === format
? formatKeys.OriginalFormat ? FilesFormats.OriginalFormat
: format; : format;
} }
this.setState({ this.setState({
@ -255,7 +242,7 @@ class DownloadDialogComponent extends React.Component {
newPresentation.format = format; newPresentation.format = format;
this.setState({ this.setState({
presentations: newPresentations, presentations: newPresentations,
presentationsTitleFormat: formatKeys.CustomFormat, presentationsTitleFormat: FilesFormats.CustomFormat,
}); });
} }
} }
@ -427,6 +414,9 @@ class DownloadDialogComponent extends React.Component {
indeterminateOtherTitle, indeterminateOtherTitle,
} = this.state; } = this.state;
console.log("this.props", this.props);
console.log("this.state", this.state);
const otherLength = other.length; const otherLength = other.length;
const showOther = otherLength > 1; const showOther = otherLength > 1;
@ -451,7 +441,6 @@ class DownloadDialogComponent extends React.Component {
checkedTitle={checkedDocTitle} checkedTitle={checkedDocTitle}
indeterminateTitle={indeterminateDocTitle} indeterminateTitle={indeterminateDocTitle}
items={documents} items={documents}
formatKeys={formatKeys}
onSelectFormat={this.onSelectFormat} onSelectFormat={this.onSelectFormat}
onRowSelect={this.onRowSelect} onRowSelect={this.onRowSelect}
getItemIcon={this.getItemIcon} getItemIcon={this.getItemIcon}
@ -467,7 +456,6 @@ class DownloadDialogComponent extends React.Component {
checkedTitle={checkedSpreadsheetTitle} checkedTitle={checkedSpreadsheetTitle}
indeterminateTitle={indeterminateSpreadsheetTitle} indeterminateTitle={indeterminateSpreadsheetTitle}
items={spreadsheets} items={spreadsheets}
formatKeys={formatKeys}
onSelectFormat={this.onSelectFormat} onSelectFormat={this.onSelectFormat}
onRowSelect={this.onRowSelect} onRowSelect={this.onRowSelect}
getItemIcon={this.getItemIcon} getItemIcon={this.getItemIcon}
@ -483,7 +471,6 @@ class DownloadDialogComponent extends React.Component {
checkedTitle={checkedPresentationTitle} checkedTitle={checkedPresentationTitle}
indeterminateTitle={indeterminatePresentationTitle} indeterminateTitle={indeterminatePresentationTitle}
items={presentations} items={presentations}
formatKeys={formatKeys}
onSelectFormat={this.onSelectFormat} onSelectFormat={this.onSelectFormat}
onRowSelect={this.onRowSelect} onRowSelect={this.onRowSelect}
getItemIcon={this.getItemIcon} getItemIcon={this.getItemIcon}

View File

@ -10,7 +10,7 @@ import AccessComboBox from "./AccessComboBox";
//import equal from "fast-deep-equal/react"; //import equal from "fast-deep-equal/react";
import { getAccessIcon } from "../../../helpers/files-helpers"; import { getAccessIcon } from "../../../helpers/files-helpers";
import { ReactSVG } from "react-svg"; import { ReactSVG } from "react-svg";
import objectToGetParams from "@appserver/common/utils"; import { objectToGetParams } from "@appserver/common/utils";
class SharingRow extends React.Component { class SharingRow extends React.Component {
constructor(props) { constructor(props) {

View File

@ -261,18 +261,11 @@ class SectionFilterContent extends React.Component {
render() { render() {
//console.log("Filter render"); //console.log("Filter render");
const selectedFilterData = this.getSelectedFilterData(); const selectedFilterData = this.getSelectedFilterData();
const { const { t, sectionWidth, tReady, isFiltered } = this.props;
t,
firstLoad,
sectionWidth,
tReady,
isAnyItems,
filterSearch,
} = this.props;
const filterColumnCount = const filterColumnCount =
window.innerWidth < 500 ? {} : { filterColumnCount: 3 }; window.innerWidth < 500 ? {} : { filterColumnCount: 3 };
return !isAnyItems && !filterSearch ? null : !tReady ? ( return !isFiltered ? null : !tReady ? (
<Loaders.Filter /> <Loaders.Filter />
) : ( ) : (
<FilterInput <FilterInput
@ -297,7 +290,6 @@ class SectionFilterContent extends React.Component {
export default inject(({ auth, filesStore, selectedFolderStore }) => { export default inject(({ auth, filesStore, selectedFolderStore }) => {
const { const {
firstLoad,
fetchFiles, fetchFiles,
filter, filter,
setIsLoading, setIsLoading,
@ -309,24 +301,22 @@ export default inject(({ auth, filesStore, selectedFolderStore }) => {
const { user } = auth.userStore; const { user } = auth.userStore;
const { customNames, culture } = auth.settingsStore; const { customNames, culture } = auth.settingsStore;
const isAnyItems = !!files.length || !!folders.length;
const filterSearch = filter.search; const { search, filterType } = filter;
const isFiltered = !!files.length || !!folders.length || search || filterType;
return { return {
customNames, customNames,
user, user,
firstLoad,
selectedFolderId: selectedFolderStore.id, selectedFolderId: selectedFolderStore.id,
selectedItem: filter.selectedItem, selectedItem: filter.selectedItem,
filter, filter,
viewAs, viewAs,
isFiltered,
setIsLoading, setIsLoading,
fetchFiles, fetchFiles,
setViewAs, setViewAs,
isAnyItems,
filterSearch,
}; };
})( })(
withRouter( withRouter(

View File

@ -6,6 +6,7 @@ import {
FileType, FileType,
FileAction, FileAction,
AppServerConfig, AppServerConfig,
FilesFormats,
} from "@appserver/common/constants"; } from "@appserver/common/constants";
import history from "@appserver/common/history"; import history from "@appserver/common/history";
import { createTreeFolders } from "../helpers/files-helpers"; import { createTreeFolders } from "../helpers/files-helpers";
@ -1028,10 +1029,6 @@ class FilesStore {
} = this.formatsStore.iconFormatsStore; } = this.formatsStore.iconFormatsStore;
const { canWebEdit } = this.formatsStore.docserviceStore; const { canWebEdit } = this.formatsStore.docserviceStore;
const formatKeys = Object.freeze({
OriginalFormat: 0,
});
let sortedFiles = { let sortedFiles = {
documents: [], documents: [],
spreadsheets: [], spreadsheets: [],
@ -1041,7 +1038,7 @@ class FilesStore {
for (let item of this.selection) { for (let item of this.selection) {
item.checked = true; item.checked = true;
item.format = formatKeys.OriginalFormat; item.format = FilesFormats.OriginalFormat;
if (item.fileExst) { if (item.fileExst) {
if (isSpreadsheet(item.fileExst)) { if (isSpreadsheet(item.fileExst)) {

View File

@ -382,7 +382,7 @@ namespace ASC.Web.Files.Services.WCFService
} }
} }
EntryManager.SetFileStatus(entries.OfType<File<TId>>().Where(r => r.ID != null).ToList()); EntryManager.SetFileStatus(entries);
return new ItemList<FileEntry>(entries); return new ItemList<FileEntry>(entries);
} }

View File

@ -471,7 +471,7 @@ namespace ASC.Web.Files.Utils
if (0 < count) entries = entries.Take(count); if (0 < count) entries = entries.Take(count);
} }
SetFileStatus(entries.OfType<File<T>>().Where(r => r != null && r.ID != null && r.FileEntryType == FileEntryType.File).ToList()); SetFileStatus(entries.Where(r => r != null && r.FileEntryType == FileEntryType.File).ToList());
return entries; return entries;
void CalculateTotal() void CalculateTotal()
@ -824,6 +824,12 @@ namespace ASC.Web.Files.Utils
SetFileStatus(new List<File<T>>(1) { file }); SetFileStatus(new List<File<T>>(1) { file });
} }
public void SetFileStatus(IEnumerable<FileEntry> files)
{
SetFileStatus(files.OfType<File<int>>().Where(r=> r.ID != 0));
SetFileStatus(files.OfType<File<string>>().Where(r=> !string.IsNullOrEmpty(r.ID)));
}
public void SetFileStatus<T>(IEnumerable<File<T>> files) public void SetFileStatus<T>(IEnumerable<File<T>> files)
{ {
var tagDao = DaoFactory.GetTagDao<T>(); var tagDao = DaoFactory.GetTagDao<T>();

View File

@ -19,7 +19,7 @@ import { setDocumentTitle } from "../../helpers/utils";
import { inject } from "mobx-react"; import { inject } from "mobx-react";
import i18n from "../../i18n"; import i18n from "../../i18n";
import { I18nextProvider } from "react-i18next"; import { I18nextProvider } from "react-i18next";
import { combineUrl, deleteCookie } from "@appserver/common/utils"; import { deleteCookie, toCommunityHostname } from "@appserver/common/utils";
const commonStyles = ` const commonStyles = `
.link-box { .link-box {
@ -121,12 +121,10 @@ const Body = ({ modules, match, isLoaded, setCurrentProductId, t, tReady }) => {
const { error } = match.params; const { error } = match.params;
const { pathname, protocol, hostname } = window.location; const { pathname, protocol, hostname } = window.location;
const currentModule = modules.find((m) => m.link === pathname); const currentModule = modules.find((m) => m.link === pathname);
const { id, title, imageUrl, link, originUrl, helpUrl } = currentModule; const { id, title, imageUrl, /*link, originUrl,*/ helpUrl } = currentModule;
const url = originUrl ? originUrl : link; //const url = originUrl ? originUrl : link;
const webLink = combineUrl( const communityHostname = toCommunityHostname(hostname);
protocol + "//" + hostname, const webLink = `${protocol}//${communityHostname}/addons/mail/?desktop_view=true`;
`${url}?desktop_view=true`
);
const appLink = isIOS const appLink = isIOS
? id === "2A923037-8B2D-487b-9A22-5AC0918ACF3F" ? id === "2A923037-8B2D-487b-9A22-5AC0918ACF3F"
? "message:" ? "message:"

View File

@ -19,7 +19,7 @@ import { setDocumentTitle } from "../../helpers/utils";
import { inject } from "mobx-react"; import { inject } from "mobx-react";
import i18n from "../../i18n"; import i18n from "../../i18n";
import { I18nextProvider } from "react-i18next"; import { I18nextProvider } from "react-i18next";
import { combineUrl, deleteCookie } from "@appserver/common/utils"; import { toCommunityHostname, deleteCookie } from "@appserver/common/utils";
const commonStyles = ` const commonStyles = `
.link-box { .link-box {
@ -121,12 +121,12 @@ const Body = ({ modules, match, isLoaded, setCurrentProductId, t, tReady }) => {
const { error } = match.params; const { error } = match.params;
const { pathname, protocol, hostname } = window.location; const { pathname, protocol, hostname } = window.location;
const currentModule = modules.find((m) => m.link === pathname); const currentModule = modules.find((m) => m.link === pathname);
const { id, title, imageUrl, link, originUrl, helpUrl } = currentModule; const { id, title, imageUrl, /*link, originUrl,*/ helpUrl } = currentModule;
const url = originUrl ? originUrl : link;
const webLink = combineUrl( //const url = originUrl ? originUrl : link;
protocol + "//" + hostname, const communityHostname = toCommunityHostname(hostname);
`${url}?desktop_view=true` const webLink = `${protocol}//${communityHostname}/Products/Projects/?desktop_view=true`;
);
const appLink = isIOS const appLink = isIOS
? id === "2A923037-8B2D-487b-9A22-5AC0918ACF3F" ? id === "2A923037-8B2D-487b-9A22-5AC0918ACF3F"
? "message:" ? "message:"

View File

@ -323,6 +323,12 @@ namespace ASC.Api.Settings
Tenant.TrustedDomains.Count > 0) || Tenant.TrustedDomains.Count > 0) ||
Tenant.TrustedDomainsType == TenantTrustedDomainsType.All; Tenant.TrustedDomainsType == TenantTrustedDomainsType.All;
if (settings.EnabledJoin.GetValueOrDefault(false))
{
settings.TrustedDomainsType = Tenant.TrustedDomainsType;
settings.TrustedDomains = Tenant.TrustedDomains;
}
var studioAdminMessageSettings = SettingsManager.Load<StudioAdminMessageSettings>(); var studioAdminMessageSettings = SettingsManager.Load<StudioAdminMessageSettings>();
settings.EnableAdmMess = studioAdminMessageSettings.Enable || TenantExtra.IsNotPaid(); settings.EnableAdmMess = studioAdminMessageSettings.Enable || TenantExtra.IsNotPaid();

View File

@ -12,7 +12,6 @@ import {
getObjectByLocation, getObjectByLocation,
//showLoader, //showLoader,
//hideLoader, //hideLoader,
tryRedirectTo,
} from "@appserver/common/utils"; } from "@appserver/common/utils";
import { import {
getDocServiceUrl, getDocServiceUrl,
@ -96,7 +95,13 @@ const Editor = () => {
const success = await checkIsAuthenticated(); const success = await checkIsAuthenticated();
if (!doc && !success) { if (!doc && !success) {
return tryRedirectTo(combineUrl(AppServerConfig.proxyURL, "/login")); window.open(
combineUrl(AppServerConfig.proxyURL, "/login"),
"_self",
"",
true
);
return;
} }
if (success) { if (success) {

View File

@ -7,6 +7,7 @@ const TerserPlugin = require("terser-webpack-plugin");
const { InjectManifest } = require("workbox-webpack-plugin"); const { InjectManifest } = require("workbox-webpack-plugin");
const combineUrl = require("@appserver/common/utils/combineUrl"); const combineUrl = require("@appserver/common/utils/combineUrl");
const AppServerConfig = require("@appserver/common/constants/AppServerConfig"); const AppServerConfig = require("@appserver/common/constants/AppServerConfig");
const { proxyURL } = AppServerConfig;
const path = require("path"); const path = require("path");
const pkg = require("./package.json"); const pkg = require("./package.json");
@ -134,12 +135,9 @@ const config = {
name: "editor", name: "editor",
filename: "remoteEntry.js", filename: "remoteEntry.js",
remotes: { remotes: {
studio: `studio@${combineUrl( studio: `studio@${combineUrl(proxyURL, "/remoteEntry.js")}`,
AppServerConfig.proxyURL,
"/remoteEntry.js"
)}`,
files: `files@${combineUrl( files: `files@${combineUrl(
AppServerConfig.proxyURL, proxyURL,
"/products/files/remoteEntry.js" "/products/files/remoteEntry.js"
)}`, )}`,
}, },

View File

@ -11,14 +11,14 @@
manifest.json provides metadata used when your web app is added to the manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/ homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
--> -->
<link id="favicon" rel="shortcut icon" href="<%= proxyURL %>/favicon.ico" /> <link id="favicon" rel="shortcut icon" href="favicon.ico" />
<link rel="manifest" href="<%= proxyURL %>/manifest.json" /> <link rel="manifest" href="manifest.json" />
<!-- Tell the browser it's a PWA --> <!-- Tell the browser it's a PWA -->
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
<!-- Tell iOS it's a PWA --> <!-- Tell iOS it's a PWA -->
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="<%= proxyURL %>/appIcon.png" /> <link rel="apple-touch-icon" href="appIcon.png" />
<link <link
href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i"
rel="stylesheet" rel="stylesheet"

View File

@ -27,7 +27,12 @@ const StyledRegister = styled(Box)`
`; `;
const Register = (props) => { const Register = (props) => {
const { enabledJoin, isAuthenticated } = props; const {
enabledJoin,
isAuthenticated,
trustedDomainsType,
trustedDomains,
} = props;
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
@ -78,6 +83,8 @@ const Register = (props) => {
loading={loading} loading={loading}
email={email} email={email}
emailErr={emailErr} emailErr={emailErr}
trustedDomainsType={trustedDomainsType}
trustedDomains={trustedDomains}
t={t} t={t}
onChangeEmail={onChangeEmail} onChangeEmail={onChangeEmail}
onRegisterModalClose={onRegisterModalClose} onRegisterModalClose={onRegisterModalClose}
@ -98,9 +105,11 @@ Register.propTypes = {
export default inject(({ auth }) => { export default inject(({ auth }) => {
const { settingsStore, isAuthenticated, language } = auth; const { settingsStore, isAuthenticated, language } = auth;
const { enabledJoin } = settingsStore; const { enabledJoin, trustedDomainsType, trustedDomains } = settingsStore;
return { return {
enabledJoin, enabledJoin,
trustedDomainsType,
trustedDomains,
isAuthenticated, isAuthenticated,
language, language,
}; };

View File

@ -8,16 +8,7 @@ import ModalDialog from "@appserver/components/modal-dialog";
import FieldContainer from "@appserver/components/field-container"; import FieldContainer from "@appserver/components/field-container";
import ModalDialogContainer from "./modal-dialog-container"; import ModalDialogContainer from "./modal-dialog-container";
import { TenantTrustedDomainsType } from "@appserver/common/constants";
const domains = ["mail.ru", "gmail.com", "yandex.ru"];
const domainList = domains.map((domain, i) => (
<span key={i}>
<b>
{domain}
{i === domains.length - 1 ? "." : ", "}
</b>
</span>
));
const RegisterModalDialog = ({ const RegisterModalDialog = ({
visible, visible,
@ -28,7 +19,30 @@ const RegisterModalDialog = ({
onChangeEmail, onChangeEmail,
onRegisterModalClose, onRegisterModalClose,
onSendRegisterRequest, onSendRegisterRequest,
trustedDomainsType,
trustedDomains,
}) => { }) => {
const getDomains = () => {
return trustedDomains.map((domain, i) => (
<span key={i}>
<b>
{domain}
{i === trustedDomains.length - 1 ? "." : ", "}
</b>
</span>
));
};
const getDomainsBlock = () => {
return trustedDomainsType === TenantTrustedDomainsType.Custom ? (
<>
{t("RegisterTextBodyBeforeDomainsList")} {getDomains()}{" "}
</>
) : (
<></>
);
};
return ( return (
<ModalDialogContainer> <ModalDialogContainer>
<ModalDialog <ModalDialog
@ -43,7 +57,7 @@ const RegisterModalDialog = ({
</ModalDialog.Header> </ModalDialog.Header>
<ModalDialog.Body> <ModalDialog.Body>
<Text key="text-body" isBold={false} fontSize="13px"> <Text key="text-body" isBold={false} fontSize="13px">
{t("RegisterTextBodyBeforeDomainsList")} {domainList}{" "} {getDomainsBlock()}
{t("RegisterTextBodyAfterDomainsList")} {t("RegisterTextBodyAfterDomainsList")}
</Text> </Text>
@ -100,6 +114,8 @@ RegisterModalDialog.propTypes = {
onChangeEmail: PropTypes.func.isRequired, onChangeEmail: PropTypes.func.isRequired,
onSendRegisterRequest: PropTypes.func.isRequired, onSendRegisterRequest: PropTypes.func.isRequired,
onRegisterModalClose: PropTypes.func.isRequired, onRegisterModalClose: PropTypes.func.isRequired,
trustedDomainsType: PropTypes.number,
trustedDomains: PropTypes.array,
}; };
export default RegisterModalDialog; export default RegisterModalDialog;

View File

@ -16,8 +16,9 @@ const homepage = pkg.homepage; // combineUrl(proxyURL, pkg.homepage);
const title = pkg.title; const title = pkg.title;
var config = { var config = {
mode: "development",
entry: "./src/index", entry: "./src/index",
target: "web",
mode: "development",
devServer: { devServer: {
publicPath: homepage, publicPath: homepage,
@ -151,9 +152,9 @@ var config = {
template: "./public/index.html", template: "./public/index.html",
publicPath: homepage, publicPath: homepage,
title: title, title: title,
templateParameters: { // templateParameters: {
proxyURL: proxyURL, // proxyURL: proxyURL,
}, // },
base: `${homepage}/`, base: `${homepage}/`,
}), }),
new CopyPlugin({ new CopyPlugin({
@ -163,7 +164,7 @@ var config = {
globOptions: { globOptions: {
dot: true, dot: true,
gitignore: true, gitignore: true,
ignore: ["**/index.ejs"], ignore: ["**/index.html"],
}, },
}, },
], ],