Web: Files: SelectFileDialog/SelectFileInput: Added custom header.

This commit is contained in:
Tatiana Lopaeva 2021-07-01 18:47:55 +03:00
parent 996e1d6086
commit c9665cf692
6 changed files with 13 additions and 3 deletions

View File

@ -31,6 +31,7 @@ const SelectFileDialogAsideView = ({
loadNextPage,
selectedFolder,
iconUrl,
header,
}) => {
console.log("isLoadingData", isLoadingData, "selectedFolder", selectedFolder);
return (
@ -48,7 +49,7 @@ const SelectFileDialogAsideView = ({
size="medium"
className="select-file-dialog_aside-header_title"
>
{t("SelectFile")}
{header ? header : t("SelectFile")}
</Heading>
</StyledHeaderContent>

View File

@ -141,7 +141,7 @@ const FilesListBody = ({
);
};
FilesListBody.defaultProps = {
listHeight: 320,
listHeight: 300,
};
export default inject(({ auth }) => {
const { user } = auth.userStore;

View File

@ -172,6 +172,7 @@ class SelectFileDialogBody extends React.Component {
isCommonWithoutProvider,
iconUrl,
folderId,
header,
} = this.props;
const {
isVisible,
@ -205,6 +206,7 @@ class SelectFileDialogBody extends React.Component {
loadNextPage={this.loadNextPage}
selectedFolder={selectedFolder}
iconUrl={iconUrl}
header={header}
/>
) : (
<SelectFileDialogModalView
@ -225,6 +227,7 @@ class SelectFileDialogBody extends React.Component {
iconUrl={iconUrl}
selectedKeys={selectedKeys}
folderId={folderId}
header={header}
/>
);
}

View File

@ -100,6 +100,7 @@ class SelectFileDialogModalViewBody extends React.Component {
iconUrl,
selectedKeys,
folderId,
header,
} = this.props;
const { isLoading } = this.state;
console.log("selectedKeys", selectedKeys);
@ -113,7 +114,9 @@ class SelectFileDialogModalViewBody extends React.Component {
style={{ maxWidth: "890px" }}
displayType="modal"
>
<ModalDialog.Header>{t("SelectFile")}</ModalDialog.Header>
<ModalDialog.Header>
{header ? header : t("SelectFile")}
</ModalDialog.Header>
<ModalDialog.Body className="select-file_body-modal-dialog">
<StyledSelectFilePanel>
{!isLoading ? (

View File

@ -43,6 +43,7 @@ class SelectFile extends React.PureComponent {
withSubfolders,
onSelectFile,
folderId,
header,
} = this.props;
const { isLoading, fileName } = this.state;
const zIndex = 310;
@ -71,6 +72,7 @@ class SelectFile extends React.PureComponent {
filterType={filterType}
onSelectFile={onSelectFile}
folderId={folderId}
header={header}
/>
</StyledComponent>
);

View File

@ -565,6 +565,7 @@ const StyledSelectFilePanel = styled.div`
display: grid;
grid-template-columns: 240px 1fr;
height: 300px;
grid-gap: 8px;
.modal-dialog_tree-body {
padding-top: 16px;
border-right: 1px solid #dee2e6;