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/ && \
bash build-frontend.sh -sp ${SRC_PATH} && \
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

View File

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

View File

@ -163,3 +163,27 @@ export const LoaderStyle = {
import config from "./AppServerConfig";
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";
cultures = [];
trustedDomains = [];
trustedDomainsType = 1;
trustedDomainsType = 0;
trustedDomains = [];
timezone = "UTC";
timezones = [];
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)
.filter(([, value]) => value !== undefined && value !== null)
.map(
@ -209,3 +209,18 @@ export default function objectToGetParams(object) {
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 i18n from "../../i18n";
import { I18nextProvider } from "react-i18next";
import { combineUrl, deleteCookie } from "@appserver/common/utils";
import { toCommunityHostname, deleteCookie } from "@appserver/common/utils";
const commonStyles = `
.link-box {
@ -121,12 +121,11 @@ const Body = ({ modules, match, isLoaded, setCurrentProductId, t, tReady }) => {
const { error } = match.params;
const { pathname, protocol, hostname } = window.location;
const currentModule = modules.find((m) => m.link === pathname);
const { id, title, imageUrl, link, originUrl, helpUrl } = currentModule;
const url = originUrl ? originUrl : link;
const webLink = combineUrl(
protocol + "//" + hostname,
`${url}?desktop_view=true`
);
const { id, title, imageUrl, /*link, originUrl,*/ helpUrl } = currentModule;
//const url = originUrl ? originUrl : link;
const communityHostname = toCommunityHostname(hostname);
const webLink = `${protocol}//${communityHostname}/Products/CRM/?desktop_view=true`;
const appLink = isIOS
? id === "2A923037-8B2D-487b-9A22-5AC0918ACF3F"
? "message:"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -471,7 +471,7 @@ namespace ASC.Web.Files.Utils
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;
void CalculateTotal()
@ -824,6 +824,12 @@ namespace ASC.Web.Files.Utils
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)
{
var tagDao = DaoFactory.GetTagDao<T>();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,14 +11,14 @@
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/
-->
<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 -->
<meta name="mobile-web-app-capable" content="yes" />
<!-- Tell iOS it's a PWA -->
<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
href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i"
rel="stylesheet"

View File

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

View File

@ -8,16 +8,7 @@ import ModalDialog from "@appserver/components/modal-dialog";
import FieldContainer from "@appserver/components/field-container";
import ModalDialogContainer from "./modal-dialog-container";
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>
));
import { TenantTrustedDomainsType } from "@appserver/common/constants";
const RegisterModalDialog = ({
visible,
@ -28,7 +19,30 @@ const RegisterModalDialog = ({
onChangeEmail,
onRegisterModalClose,
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 (
<ModalDialogContainer>
<ModalDialog
@ -43,7 +57,7 @@ const RegisterModalDialog = ({
</ModalDialog.Header>
<ModalDialog.Body>
<Text key="text-body" isBold={false} fontSize="13px">
{t("RegisterTextBodyBeforeDomainsList")} {domainList}{" "}
{getDomainsBlock()}
{t("RegisterTextBodyAfterDomainsList")}
</Text>
@ -100,6 +114,8 @@ RegisterModalDialog.propTypes = {
onChangeEmail: PropTypes.func.isRequired,
onSendRegisterRequest: PropTypes.func.isRequired,
onRegisterModalClose: PropTypes.func.isRequired,
trustedDomainsType: PropTypes.number,
trustedDomains: PropTypes.array,
};
export default RegisterModalDialog;

View File

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