Skip to content

Commit

Permalink
Merge pull request #328 from ONLYOFFICE/feature/file-folder-selectors
Browse files Browse the repository at this point in the history
Feature/file folder selectors
  • Loading branch information
ilyaoleshko authored Aug 26, 2021
2 parents c37fd46 + 30afd1e commit e20f2db
Show file tree
Hide file tree
Showing 251 changed files with 3,395 additions and 100 deletions.
5 changes: 5 additions & 0 deletions config/nginx/onlyoffice.conf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ server {
try_files /$basename /index.html =404;
}

location ~* /static/images/icons/(?<content>[^/]+) {
root $public_root;
try_files /images/icons/$content/$basename /index.html =404;
}

location ~* /static/images/ {
root $public_root;
try_files /images/$basename /index.html =404;
Expand Down
12 changes: 11 additions & 1 deletion packages/asc-web-common/api/files/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,13 @@ export function getNewFiles(folderId) {
});
}

export function convertFile(fileId) {
export function convertFile(fileId, sync = false) {
const data = { sync };

return request({
method: "put",
url: `/files/file/${fileId}/checkconversion`,
data,
});
}

Expand Down Expand Up @@ -765,3 +768,10 @@ export function createThumbnails(fileIds) {

return request(options);
}

export function getPresignedUri(fileId) {
return request({
method: "get",
url: `files/file/${fileId}/presigned`,
});
}
8 changes: 8 additions & 0 deletions packages/asc-web-common/api/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,11 @@ export function validateTfaCode(code) {
data,
});
}

export function getCommonThirdPartyList() {
const options = {
method: "get",
url: "/files/thirdparty/common",
};
return request(options);
}
11 changes: 10 additions & 1 deletion packages/asc-web-components/aside/aside.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@ import StyledAside from "./styled-aside";

const Aside = React.memo((props) => {
//console.log("Aside render");
const { visible, children, scale, zIndex, className } = props;
const {
visible,
children,
scale,
zIndex,
className,
contentPaddingBottom,
} = props;

return (
<StyledAside
visible={visible}
scale={scale}
zIndex={zIndex}
contentPaddingBottom={contentPaddingBottom}
className={`${className} not-selectable aside`}
>
<Scrollbar>{children}</Scrollbar>
Expand All @@ -26,6 +34,7 @@ Aside.propTypes = {
visible: PropTypes.bool,
scale: PropTypes.bool,
className: PropTypes.string,
contentPaddingBottom: PropTypes.string,
zIndex: PropTypes.number,
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
Expand Down
15 changes: 11 additions & 4 deletions packages/asc-web-components/aside/styled-aside.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import Base from "../themes/base";

/* eslint-disable no-unused-vars */
/* eslint-disable react/prop-types */
const Container = ({ visible, scale, zIndex, ...props }) => (
<aside {...props} />
);
const Container = ({
visible,
scale,
zIndex,
contentPaddingBottom,
...props
}) => <aside {...props} />;
/* eslint-enable react/prop-types */
/* eslint-enable no-unused-vars */

Expand All @@ -27,7 +31,10 @@ const StyledAside = styled(Container)`
box-sizing: border-box;
&.modal-dialog-aside {
padding-bottom: ${(props) => props.theme.aside.paddingBottom};
padding-bottom: ${(props) =>
props.contentPaddingBottom
? props.contentPaddingBottom
: props.theme.aside.paddingBottom};
.modal-dialog-aside-footer {
position: fixed;
Expand Down
12 changes: 11 additions & 1 deletion packages/asc-web-components/modal-dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ class ModalDialog extends React.Component {
style,
children,
isLoading,
contentPaddingBottom,
removeScroll,
} = this.props;

let header = null;
Expand Down Expand Up @@ -176,9 +178,14 @@ class ModalDialog extends React.Component {
visible={visible}
scale={scale}
zIndex={zIndex}
contentPaddingBottom={contentPaddingBottom}
className="modal-dialog-aside not-selectable"
>
<Content contentHeight={contentHeight} contentWidth={contentWidth}>
<Content
contentHeight={contentHeight}
contentWidth={contentWidth}
removeScroll={removeScroll}
>
{isLoading ? (
<Loaders.DialogAsideLoader withoutAside />
) : (
Expand All @@ -192,6 +199,7 @@ class ModalDialog extends React.Component {
<BodyBox
className="modal-dialog-aside-body"
paddingProp={bodyPadding}
removeScroll={removeScroll}
>
{body ? body.props.children : null}
</BodyBox>
Expand Down Expand Up @@ -229,9 +237,11 @@ ModalDialog.propTypes = {
contentHeight: PropTypes.string,
contentWidth: PropTypes.string,
isLoading: PropTypes.bool,
removeScroll: PropTypes.bool,
className: PropTypes.string,
id: PropTypes.string,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
contentPaddingBottom: PropTypes.string,
};

ModalDialog.defaultProps = {
Expand Down
14 changes: 13 additions & 1 deletion packages/asc-web-components/modal-dialog/styled-modal-dialog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from "styled-components";
import styled, { css } from "styled-components";
import Base from "../themes/base";
import Box from "../box";
import CrossSidebarIcon from "../../../public/images/cross.sidebar.react.svg";
Expand Down Expand Up @@ -34,6 +34,12 @@ const Content = styled.div`
font-weight: ${(props) =>
props.theme.modalDialog.content.heading.fontWeight};
}
${(props) =>
props.removeScroll &&
css`
overflow: hidden;
`}
`;
Content.defaultProps = { theme: Base };

Expand Down Expand Up @@ -66,6 +72,12 @@ CloseButton.defaultProps = { theme: Base };

const BodyBox = styled(Box)`
position: relative;
${(props) =>
props.removeScroll &&
css`
height: 100%;
`}
`;

export { CloseButton, StyledHeader, Content, Dialog, BodyBox };
2 changes: 1 addition & 1 deletion products/ASC.Files/Client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"react-tooltip": "^4.2.11",
"react-virtualized-auto-sizer": "^1.0.2",
"react-window": "^1.8.6",
"react-window-infinite-loader": "^1.0.5",
"react-window-infinite-loader": "^1.0.7",
"resize-image": "^0.1.0",
"sjcl": "^1.0.8",
"styled-components": "^5.2.1",
Expand Down
2 changes: 1 addition & 1 deletion products/ASC.Files/Client/public/locales/de/Home.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
"UploadToFolder": "In den Ordner hochladen",
"ViewList": "Liste",
"ViewTiles": "Kacheln"
}
}
2 changes: 1 addition & 1 deletion products/ASC.Files/Client/public/locales/en/Home.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@
"UploadToFolder": "Upload to folder",
"ViewList": "List",
"ViewTiles": "Tiles"
}
}
3 changes: 3 additions & 0 deletions products/ASC.Files/Client/public/locales/en/SelectFile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"SelectFile": "Select file"
}
3 changes: 3 additions & 0 deletions products/ASC.Files/Client/public/locales/en/SelectFolder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"NotAvailableFolder": "No folders available"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"Restore": "Restore",
"Spreadsheets": "Spreadsheets",
"ThirdPartyInfo": "Change the third-party info",
"DownloadApps": "Download applications"
"DownloadApps": "Download applications",
"SelectFolder": "Select folder"
}
2 changes: 1 addition & 1 deletion products/ASC.Files/Client/public/locales/it/Home.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
"UploadToFolder": "Carica nella cartella",
"ViewList": "Lista",
"ViewTiles": "Selezioni"
}
}
2 changes: 1 addition & 1 deletion products/ASC.Files/Client/public/locales/lo/Home.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
"UploadToFolder": "ອັບໂຫລດໄປຍັງໂຟຣເດີ",
"ViewList": "ລາຍການ",
"ViewTiles": "ຫົວຂໍ້"
}
}
2 changes: 1 addition & 1 deletion products/ASC.Files/Client/public/locales/pt-BR/Home.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
"UploadToFolder": "Upload para pasta",
"ViewList": "Lista",
"ViewTiles": "Azulejos"
}
}
2 changes: 1 addition & 1 deletion products/ASC.Files/Client/public/locales/ro/Home.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
"UploadToFolder": "Încarcă în dosarul",
"ViewList": "Listă",
"ViewTiles": "Cadre"
}
}
2 changes: 1 addition & 1 deletion products/ASC.Files/Client/public/locales/ru/Home.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@
"UploadToFolder": "Загрузить в папку",
"ViewList": "Список",
"ViewTiles": "Плитки"
}
}
3 changes: 3 additions & 0 deletions products/ASC.Files/Client/public/locales/ru/SelectFile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"SelectFile": "Выбрать файл"
}
3 changes: 3 additions & 0 deletions products/ASC.Files/Client/public/locales/ru/SelectFolder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"NotAvailableFolder": "Нет доступных папок"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"Restore": "Восстановить",
"Spreadsheets": "Таблицы",
"ThirdPartyInfo": "Изменить настройки подключения",
"DownloadApps": "Скачать приложения"
"DownloadApps": "Скачать приложения",
"SelectFolder": "Выбрать папку"
}
4 changes: 2 additions & 2 deletions products/ASC.Files/Client/src/HOCs/withContextOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export default function withContextOptions(WrappedComponent) {
return {
key: option,
label: t("SharingSettings"),
icon: "images/catalog.shared.react.svg",
icon: "/static/images/catalog.shared.react.svg",
onClick: this.onClickShare,
disabled: !isShareable,
};
Expand All @@ -315,7 +315,7 @@ export default function withContextOptions(WrappedComponent) {
return {
key: option,
label: t("Translations:OwnerChange"),
icon: "images/catalog.user.react.svg",
icon: "/static/images/catalog.user.react.svg",
onClick: this.onOwnerChange,
disabled: false,
};
Expand Down
Loading

0 comments on commit e20f2db

Please sign in to comment.