Web: Files: Apply route proxy

This commit is contained in:
Ilya Oleshko 2021-03-22 20:51:52 +03:00
parent a1eb540d9d
commit de8dc35fca
4 changed files with 19 additions and 7 deletions

View File

@ -6,10 +6,12 @@ import DropDownItem from "@appserver/components/drop-down-item";
import { withTranslation } from "react-i18next";
import { isMobile } from "react-device-detect";
import Loaders from "@appserver/common/components/Loaders";
import { FileAction } from "@appserver/common/constants";
import { FileAction, AppServerConfig } from "@appserver/common/constants";
import { encryptionUploadDialog } from "../../../helpers/desktop";
import { inject, observer } from "mobx-react";
import config from "../../../../package.json";
import { combineUrl } from "@appserver/common/utils";
class PureArticleMainButtonContent extends React.Component {
onCreate = (e) => {
// this.goToHomePage();
@ -39,7 +41,9 @@ class PureArticleMainButtonContent extends React.Component {
goToHomePage = () => {
const { homepage, history, filter } = this.props;
const urlFilter = filter.toUrlParams();
history.push(`${homepage}/filter?${urlFilter}`);
history.push(
combineUrl(AppServerConfig.proxyURL, homepage, `/filter?${urlFilter}`)
);
};
onFileChange = (e) => {

View File

@ -393,7 +393,9 @@ class FilesRowContent extends React.PureComponent {
fetchFileVersions(item.id + "");
setIsVerHistoryPanel(true);
} else {
history.push(`${homepage}/${item.id}/history`);
history.push(
combineUrl(AppServerConfig.proxyURL, homepage, `/${item.id}/history`)
);
}
};

View File

@ -10,9 +10,10 @@ import Row from "@appserver/components/row";
import FilesRowContent from "./FilesRowContent";
import { withRouter } from "react-router-dom";
import toastr from "studio/toastr";
import { FileAction } from "@appserver/common/constants";
import { FileAction, AppServerConfig } from "@appserver/common/constants";
import copy from "copy-to-clipboard";
import config from "../../../../../../../package.json";
import { combineUrl } from "@appserver/common/utils";
const StyledSimpleFilesRow = styled(Row)`
margin-top: -2px;
@ -190,7 +191,9 @@ const SimpleFilesRow = (props) => {
fetchFileVersions(id + "");
setIsVerHistoryPanel(true);
} else {
history.push(`${homepage}/${id}/history`);
history.push(
combineUrl(AppServerConfig.proxyURL, homepage, `/${id}/history`)
);
}
};

View File

@ -6,7 +6,7 @@ import Badge from "@appserver/components/badge";
import Link from "@appserver/components/link";
import Text from "@appserver/components/text";
import { markAsRead } from "@appserver/common/api/files";
import { FileAction } from "@appserver/common/constants";
import { FileAction, AppServerConfig } from "@appserver/common/constants";
import toastr from "studio/toastr";
import { getTitleWithoutExst } from "../../../../../helpers/files-helpers";
import { NewFilesPanel } from "../../../../panels";
@ -17,6 +17,7 @@ import { inject, observer } from "mobx-react";
import CheckIcon from "../../../../../../public/images/check.react.svg";
import CrossIcon from "../../../../../../../../../public/images/cross.react.svg";
import config from "../../../../../../package.json";
import { combineUrl } from "@appserver/common/utils";
const SimpleFilesTileContent = styled(TileContent)`
.rowMainContainer {
@ -282,7 +283,9 @@ class FilesTileContent extends React.PureComponent {
const { homepage, history } = this.props;
const fileId = e.currentTarget.dataset.id;
history.push(`${homepage}/${fileId}/history`);
history.push(
combineUrl(AppServerConfig.proxyURL, homepage, `/${fileId}/history`)
);
};
onBadgeClick = () => {