Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selectors redesign #620

Merged
merged 96 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from 90 commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
3ef7ae8
Web: SelectFolder: Optimization, refactoring.
TatianaLopaeva Apr 6, 2022
9932e76
Web: Refactoring, added styles.
TatianaLopaeva Apr 8, 2022
87e1222
Web: Files: SelectFile: Changed logic.
TatianaLopaeva Apr 8, 2022
34d4b5d
Merge branch 'feature/virtual-rooms-1.2' into selectors-redesign
TatianaLopaeva Apr 10, 2022
b20f4cf
Web: Backup: Added new translation.
TatianaLopaeva Apr 10, 2022
09e800c
WEb: Files: Refactoring.
TatianaLopaeva Apr 10, 2022
c020aa7
Web: Components: fixed tree styles.
TatianaLopaeva Apr 10, 2022
0810423
Web:Files/Common: Added new loaders.
TatianaLopaeva Apr 10, 2022
e6d0d1a
Web: Files: SelectFile: Fixed aside view.
TatianaLopaeva Apr 10, 2022
6b083cb
Web:Files: Fixed dialog title.
TatianaLopaeva Apr 11, 2022
751e2b2
Web: Files: SelectFolder: Fixed styles of aside view, refactoring.
TatianaLopaeva Apr 11, 2022
70ee53b
Web: Files: SelectFolder: Added "canCreate" prop.
TatianaLopaeva Apr 11, 2022
55cd1d1
Web: Files: Refactoring, fixed styles.
TatianaLopaeva Apr 11, 2022
38aa42f
Web: Files: Refactoring, deleted useless code.
TatianaLopaeva Apr 11, 2022
4e66bc9
Web: Files: SelectFile: Return onMouseEvent.
TatianaLopaeva Apr 11, 2022
3476587
Web: Files: refactoring, deleted useless code.
TatianaLopaeva Apr 11, 2022
2b93c52
Web: Files: Added wrappers for ModuleFederationPlagin
TatianaLopaeva Apr 11, 2022
d07c5e0
Web: Files: Renamed function, refactoring.
TatianaLopaeva Apr 11, 2022
8f623ae
Web: Files: Fixed styles.
TatianaLopaeva Apr 11, 2022
d727e60
Web: Files: SelectFileDialog: Added the possibility to disable button…
TatianaLopaeva Apr 11, 2022
eedfa4a
Web: Files: Optimization aside view, refactoring.
TatianaLopaeva Apr 11, 2022
2de60d3
Web: Files: SelectFile: Added style for row selection.
TatianaLopaeva Apr 11, 2022
2c473de
Web: Components/Files: Changed styles for tree.
TatianaLopaeva Apr 11, 2022
7319a8f
Web: Files: Removed loader.
TatianaLopaeva Apr 11, 2022
0c693fe
Web: Files: Deleted useless code.
TatianaLopaeva Apr 11, 2022
f73812d
Web: Components: Added new color.
TatianaLopaeva Apr 11, 2022
e9daf3a
Web: Files: Deleted useless code, added styles for tree.
TatianaLopaeva Apr 12, 2022
1344d77
Web: Files: SelectFolder: Added disable color for files.
TatianaLopaeva Apr 12, 2022
193c1b2
Merge branch 'feature/virtual-rooms-1.2' into selectors-redesign
TatianaLopaeva Apr 12, 2022
e18777d
Web: Components: fixed tree-menu styles.
TatianaLopaeva Apr 12, 2022
ce0b453
Web: Files: Path of folder moved to the local state.
TatianaLopaeva Apr 12, 2022
054ef60
Web: Files: OperationPanel: Added SelectFolderDialog.
TatianaLopaeva Apr 12, 2022
4e50b0e
Web: Files: Fixed styles of aside view.
TatianaLopaeva Apr 12, 2022
ed83701
Web: Files: SelectionPanel: Fixed styles for title.
TatianaLopaeva Apr 12, 2022
5bd992b
Web: Files: Fixed styles for buttons.
TatianaLopaeva Apr 12, 2022
40db845
Web: Files: Deleted useless code.
TatianaLopaeva Apr 12, 2022
ede24f4
Web: Files: Added a margin style for the button if the footer is pass…
TatianaLopaeva Apr 12, 2022
852791a
Web: files: deleted useless code.
TatianaLopaeva Apr 12, 2022
8a9fbe7
Web: Files: Added reset of tree.
TatianaLopaeva Apr 12, 2022
6b9da57
Web: Files: Components: Fixed styles of loading.
TatianaLopaeva Apr 12, 2022
b9de2ad
Web: Files: fixed styles for aside view.
TatianaLopaeva Apr 12, 2022
0bfffed
Web: Files: Refactoring, deleted useless code.
TatianaLopaeva Apr 12, 2022
6afbf64
Web: Files: SelectFolderDialog: Deletes useless code.
TatianaLopaeva Apr 12, 2022
7086c7e
Web: Files: Changed empty files page.
TatianaLopaeva Apr 13, 2022
8b978f5
Web: Files: Added common styles.
TatianaLopaeva Apr 13, 2022
2b49cbf
Web: Files: Added <strong> to translations.
TatianaLopaeva Apr 13, 2022
3595012
Web: Files: Added new translations.
TatianaLopaeva Apr 13, 2022
270b569
Web: Files: Changed dialog styles according new layouts.
TatianaLopaeva Apr 13, 2022
165a597
Web: Files: Added new translations.
TatianaLopaeva Apr 13, 2022
49145aa
Web: Files: Changed titles of dialogs, added isLoading prop for tree …
TatianaLopaeva Apr 13, 2022
dbe01ad
Web: Files: Fixed translation and styles for buttons.
TatianaLopaeva Apr 13, 2022
b631b6c
Web: Files: Fixed key.
TatianaLopaeva Apr 13, 2022
125afe2
Web: Files: Fixed translations.
TatianaLopaeva Apr 13, 2022
6df2c6e
Web: Components: Deleted useless code.
TatianaLopaeva Apr 13, 2022
089fcea
Web: Files: Fixed translations for de, el, en languages.
TatianaLopaeva Apr 13, 2022
d1d0c54
Web: Files: Renamed key for api.
TatianaLopaeva Apr 13, 2022
60f6c47
WEb: SelectFolderDialog: Deleted files from sub folders.
TatianaLopaeva Apr 13, 2022
4a82954
Web:Components: Fixed propTypes.
TatianaLopaeva Apr 13, 2022
cb6e45d
Web: Files: Added translation for title of folder selection dialog.
TatianaLopaeva Apr 13, 2022
6ebfe68
Web: Files: Fixed styles.
TatianaLopaeva Apr 14, 2022
6ddeff2
Web: Files: SelectFolderDialog/SelectFileDialog: Fixed styles accordi…
TatianaLopaeva Apr 14, 2022
7c93072
Web: Files: SelectFolderDialog/SelectFileDialog: Fixed aside styles.
TatianaLopaeva Apr 14, 2022
13b9a8d
Web: Files: Added icon size so that the inscription does not move whe…
TatianaLopaeva Apr 14, 2022
fbe6b16
Web: Files: Added showing loader after some time, fixed styles.
TatianaLopaeva Apr 14, 2022
8243bd1
Web: Files: Added error handler, added clear an active operation, add…
TatianaLopaeva Apr 14, 2022
016841a
Web: Files: OperationPanel: Deleted useless code.
TatianaLopaeva Apr 14, 2022
0a06c2b
WEb: Files: OperationsPanel: Moved clear timer.
TatianaLopaeva Apr 14, 2022
3996816
Web: Files: OperationPanel: Changed logic of saving information. (Fix…
TatianaLopaeva Apr 14, 2022
33e8725
Web: Files: OperationsPanel: Reset loading state.
TatianaLopaeva Apr 14, 2022
9edc209
Web: Files: SelectionPanel: Fixed buttons styles for aside view.
TatianaLopaeva Apr 14, 2022
140ec80
Web: Files: Deleted opening of subfolder in tree.
TatianaLopaeva Apr 14, 2022
9890378
Web: Files: Optimization, refactoring.
TatianaLopaeva Apr 15, 2022
b01ba79
Web: Refactoring.
TatianaLopaeva Apr 15, 2022
6f0a0b3
Web: Files: OperationsPanel: Refactoring, added new translation.
TatianaLopaeva Apr 15, 2022
cad93e9
Web: Files: OperationsPanel: Refactoring.
TatianaLopaeva Apr 15, 2022
b33575e
Web: Components: Deleted useless code.
TatianaLopaeva Apr 15, 2022
dc39d3a
Web: Files: Added onCloseAside.
TatianaLopaeva Apr 15, 2022
eecb160
Web: Components: Added abbreviation of a long name in the tree.
TatianaLopaeva Apr 15, 2022
df92f99
Web: Files: Deleted useless code.
TatianaLopaeva Apr 15, 2022
ce73b30
Merge branch 'feature/virtual-rooms-1.2' into selectors-redesign
TatianaLopaeva Apr 15, 2022
28102a6
Web: Files: SelectionPanel: Added show loader for files after a while.
TatianaLopaeva Apr 15, 2022
2511dc2
Web: files: Fixed styles.
TatianaLopaeva Apr 15, 2022
8021b83
Web: Files: Added ability to cancel requests.
TatianaLopaeva Apr 15, 2022
6b00d8c
Web: Components: Fixed length of title when folder is selected.
TatianaLopaeva Apr 15, 2022
a1e54b4
Web: files: fixed empty container.
TatianaLopaeva Apr 15, 2022
fa543e5
WEb: Files: Fixed after merge.
TatianaLopaeva Apr 15, 2022
4e0f74f
Web: Editor: Disabled button when file name is empty.
TatianaLopaeva Apr 15, 2022
96b69e9
Web: files: Fixed styles for tree.
TatianaLopaeva Apr 15, 2022
1d48995
Web: Files: Fixed tree styles.
TatianaLopaeva Apr 15, 2022
cae74ef
Web: Files: Deleted <strong> from translation.
TatianaLopaeva Apr 15, 2022
e7e34ba
Web: Backup: Fixed styles for empty list.
TatianaLopaeva Apr 15, 2022
34ef545
Web: Backup: Fixed buttons styles.
TatianaLopaeva Apr 15, 2022
d8cefc6
Web: Editor: Added icons url.
TatianaLopaeva Apr 15, 2022
ebdd047
Web: Files: Refactoring.
TatianaLopaeva Apr 15, 2022
5c85464
Web: Files: SelectFileDialogWrapper: Restore I18nextProvider.
TatianaLopaeva Apr 15, 2022
7dbc67f
Merge branch 'feature/virtual-rooms-1.2' into selectors-redesign
AlexeySafronov Apr 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 34 additions & 13 deletions packages/asc-web-common/api/files/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import axios from "axios";
import FilesFilter from "./filter";
import { FolderType } from "../../constants";
import find from "lodash/find";
import { getFolderOptions } from "../../utils";

export function openEdit(fileId, version, doc, view) {
const params = []; // doc ? `?doc=${doc}` : "";
Expand Down Expand Up @@ -48,19 +49,7 @@ export function getFolderPath(folderId) {
}

export function getFolder(folderId, filter) {
if (folderId && typeof folderId === "string") {
folderId = encodeURIComponent(folderId.replace(/\\\\/g, "\\"));
}

const params =
filter && filter instanceof FilesFilter
? `${folderId}?${filter.toApiUrlParams()}`
: folderId;
const options = {
method: "get",
url: `/files/${params}`,
};

const options = getFolderOptions(folderId, filter);
return request(options);
}

Expand Down Expand Up @@ -181,6 +170,38 @@ export function getFoldersTree() {
);
}

export function getCommonFoldersTree() {
const index = 1;
return request({ method: "get", url: "/files/@common" }).then(
(commonFolders) => {
return [
{
id: commonFolders.current.id,
key: `0-${index}`,
parentId: commonFolders.current.parentId,
title: commonFolders.current.title,
rootFolderType: +commonFolders.current.rootFolderType,
rootFolderName: "@common",
pathParts: commonFolders.pathParts,
foldersCount: commonFolders.current.foldersCount,
newItems: commonFolders.new,
},
];
}
);
}

export function getThirdPartyCommonFolderTree() {
return request({ method: "get", url: "/files/thirdparty/common" }).then(
(commonThirdPartyArray) => {
commonThirdPartyArray.map((currentValue, index) => {
commonThirdPartyArray[index].key = `0-${index}`;
});
return commonThirdPartyArray;
}
);
}

export function getMyFolderList(filter = FilesFilter.getDefault()) {
const options = {
method: "get",
Expand Down
7 changes: 0 additions & 7 deletions packages/asc-web-common/api/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,6 @@ export function validateTfaCode(code) {
});
}

export function getCommonThirdPartyList() {
const options = {
method: "get",
url: "/files/thirdparty/common",
};
return request(options);
}
export function getBackupStorage() {
const options = {
method: "get",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import PropTypes from "prop-types";
import { StyledRow } from "./StyledListLoader";
import RectangleLoader from "../RectangleLoader";

const ListItemLoader = ({ id, className, style, isRectangle, ...rest }) => {
const ListItemLoader = ({
id,
className,
style,
withoutFirstRectangle,
withoutLastRectangle,
...rest
}) => {
const {
title,
borderRadius,
Expand All @@ -16,8 +23,14 @@ const ListItemLoader = ({ id, className, style, isRectangle, ...rest }) => {
} = rest;

return (
<StyledRow id={id} className={className} style={style}>
{isRectangle && (
<StyledRow
id={id}
className={className}
style={style}
withoutFirstRectangle={withoutFirstRectangle}
withoutLastRectangle={withoutLastRectangle}
>
{!withoutFirstRectangle && (
<RectangleLoader
title={title}
width="16"
Expand Down Expand Up @@ -60,18 +73,20 @@ const ListItemLoader = ({ id, className, style, isRectangle, ...rest }) => {
animate={animate}
/>

<RectangleLoader
title={title}
width="16"
height="16"
borderRadius={borderRadius}
backgroundColor={backgroundColor}
foregroundColor={foregroundColor}
backgroundOpacity={backgroundOpacity}
foregroundOpacity={foregroundOpacity}
speed={speed}
animate={animate}
/>
{!withoutLastRectangle && (
<RectangleLoader
title={title}
width="16"
height="16"
borderRadius={borderRadius}
backgroundColor={backgroundColor}
foregroundColor={foregroundColor}
backgroundOpacity={backgroundOpacity}
foregroundOpacity={foregroundOpacity}
speed={speed}
animate={animate}
/>
)}
</StyledRow>
);
};
Expand All @@ -80,14 +95,16 @@ ListItemLoader.propTypes = {
id: PropTypes.string,
className: PropTypes.string,
style: PropTypes.object,
isRectangle: PropTypes.bool,
withoutFirstRectangle: PropTypes.bool,
withoutLastRectangle: PropTypes.bool,
};

ListItemLoader.defaultProps = {
id: undefined,
className: undefined,
style: undefined,
isRectangle: true,
withoutFirstRectangle: false,
withoutLastRectangle: false,
};

export default ListItemLoader;
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,26 @@ const StyledRow = styled.div`
width: 100%;
display: grid;
grid-template-columns: 16px 32px 1fr 16px;
${(props) =>
props.withoutFirstRectangle &&
props.withoutLastRectangle &&
"grid-template-columns: 32px 1fr"};
${(props) =>
props.withoutFirstRectangle &&
!props.withoutLastRectangle &&
"grid-template-columns: 32px 1fr 16px"};
grid-template-rows: 1fr;
grid-column-gap: 8px;
margin-bottom: 16px;
justify-items: center;
align-items: center;

.list-loader_rectangle {
padding-right: 4px;
}

.list-loader_rectangle-content {
width: 32px;
height: 32px;
}

.list-loader_rectangle-row {
margin-right: auto;
max-width: 167px;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import styled from "styled-components";
import { desktop } from "@appserver/components/utils/device";

const StyledTreeFolder = styled.div`
padding-right: 16px;
`;

const StyledLoader = styled.div`
width: 100%;
display: grid;
grid-template-columns: 8px 16px 1fr;
grid-template-rows: 1fr;
grid-column-gap: 6px;
margin-bottom: 8px;
box-sizing: border-box;

.tree-node-loader_additional-rectangle {
padding-top: 4px;
}

${(props) => props.paddingLeft && `padding-left: ${props.paddingLeft}`};
`;

export { StyledLoader, StyledTreeFolder };
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from "react";
import PropTypes from "prop-types";
import { StyledTreeFolder, StyledLoader } from "./StyledTreeFolder";
import TreeNodeLoader from "../TreeNodeLoader";

const NewTreeFolderLoader = ({ id, className, style, ...rest }) => {
return (
<StyledTreeFolder id={id} className={className} style={style}>
<StyledLoader>
<TreeNodeLoader {...rest} withRectangle />
</StyledLoader>
<StyledLoader paddingLeft={"16px"}>
<TreeNodeLoader {...rest} withRectangle />
</StyledLoader>

<StyledLoader paddingLeft={"32px"}>
<TreeNodeLoader {...rest} withRectangle />
</StyledLoader>
<StyledLoader paddingLeft={"32px"}>
<TreeNodeLoader {...rest} withRectangle />
</StyledLoader>
<StyledLoader paddingLeft={"32px"}>
<TreeNodeLoader {...rest} withRectangle />
</StyledLoader>

<StyledLoader>
<TreeNodeLoader {...rest} withRectangle />
</StyledLoader>
<StyledLoader paddingLeft={"16px"}>
<TreeNodeLoader {...rest} withRectangle />
</StyledLoader>
<StyledLoader paddingLeft={"16px"}>
<TreeNodeLoader {...rest} withRectangle />
</StyledLoader>
</StyledTreeFolder>
);
};

NewTreeFolderLoader.propTypes = {
id: PropTypes.string,
className: PropTypes.string,
style: PropTypes.object,
};

NewTreeFolderLoader.defaultProps = {
id: undefined,
className: undefined,
style: undefined,
};

export default NewTreeFolderLoader;
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const TreeNodeLoader = ({
foregroundOpacity,
speed,
animate,
withRectangle = false,
}) => {
return (
<>
Expand All @@ -25,6 +26,23 @@ const TreeNodeLoader = ({
speed={speed}
animate={animate}
/>

{withRectangle && (
<RectangleLoader
title={title}
width="16"
height="16"
borderRadius={borderRadius}
backgroundColor={backgroundColor}
foregroundColor={foregroundColor}
backgroundOpacity={backgroundOpacity}
foregroundOpacity={foregroundOpacity}
speed={speed}
animate={animate}
className="tree-node-loader_additional-rectangle"
/>
)}

<RectangleLoader
title={title}
width="100%"
Expand Down
2 changes: 2 additions & 0 deletions packages/asc-web-common/components/Loaders/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ArticleButton from "./ArticleButtonLoader";
import ArticleFolder from "./ArticleFolderLoader";
import ArticleGroup from "./ArticleGroupsLoader";
import TreeFolders from "./TreeFolderLoader";
import NewTreeFolders from "./NewTreeFolderLoader";
import TreeSettingsLoader from "./TreeSettingsLoader";
import Row from "./RowLoader";
import Rows from "./RowsLoader";
Expand Down Expand Up @@ -46,4 +47,5 @@ export default {
ArticleFolder,
ArticleGroup,
ListLoader,
NewTreeFolders,
};
19 changes: 19 additions & 0 deletions packages/asc-web-common/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,22 @@ export function convertLanguage(key) {

return key;
}

import FilesFilter from "../api/files/filter";
export function getFolderOptions(folderId, filter) {
if (folderId && typeof folderId === "string") {
folderId = encodeURIComponent(folderId.replace(/\\\\/g, "\\"));
}

const params =
filter && filter instanceof FilesFilter
? `${folderId}?${filter.toApiUrlParams()}`
: folderId;

const options = {
method: "get",
url: `/files/${params}`,
};

return options;
}
9 changes: 8 additions & 1 deletion packages/asc-web-components/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ Button.propTypes = {
/** Size of button.

The normal size equals 36px and 40px in height on the Desktop and Touchcreen devices. */
size: PropTypes.oneOf(["extraSmall", "small", "normal", "medium"]),
size: PropTypes.oneOf([
"extraSmall",
"small",
"normal",
"medium",
"normalDesktop",
"normalTouchscreen",
]),
/** Scale width of button to 100% */
scale: PropTypes.bool,
/** Icon node element */
Expand Down
4 changes: 3 additions & 1 deletion packages/asc-web-components/modal-dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ class ModalDialog extends React.Component {
<BodyBox paddingProp={modalBodyPadding}>
{body ? body.props.children : null}
</BodyBox>
<Box>{footer ? footer.props.children : null}</Box>
<Box className="modal-dialog-modal-footer">
{footer ? footer.props.children : null}
</Box>
</>
)}
</Content>
Expand Down
1 change: 1 addition & 0 deletions packages/asc-web-components/themes/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ const Base = {
minHeight: "47px",
width: "100%",
borderBottom: globalColors.grayLightMid,
backgroundColor: globalColors.lightHover,
minWidth: "160px",
overflow: "hidden",
textOverflow: "ellipsis",
Expand Down
1 change: 1 addition & 0 deletions packages/asc-web-components/themes/dark.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ const Dark = {
minHeight: "47px",
width: "100%",
borderBottom: "#474747",
backgroundColor: globalColors.veryDarkGrey,
minWidth: "160px",
overflow: "hidden",
textOverflow: "ellipsis",
Expand Down
Loading