Web:Files:Components: add embedding body to modal view sharing panel

This commit is contained in:
Timofey Boyko 2022-04-19 07:35:04 +03:00
parent b5d94989bf
commit e0b9e60f70
4 changed files with 55 additions and 35 deletions

View File

@ -15,6 +15,7 @@ const Header = ({
onShowUsersPanel, onShowUsersPanel,
onShowGroupsPanel, onShowGroupsPanel,
onClose, onClose,
label,
}) => { }) => {
const [showActionPanel, setShowActionPanel] = React.useState(false); const [showActionPanel, setShowActionPanel] = React.useState(false);
@ -42,6 +43,8 @@ const Header = ({
onShowGroupsPanel && onShowGroupsPanel(); onShowGroupsPanel && onShowGroupsPanel();
}, [onShowGroupsPanel]); }, [onShowGroupsPanel]);
console.log(uploadPanelVisible);
return ( return (
<StyledHeaderContent <StyledHeaderContent
isPersonal={isPersonal} isPersonal={isPersonal}
@ -50,7 +53,7 @@ const Header = ({
<div className="sharing_panel-header-info"> <div className="sharing_panel-header-info">
{uploadPanelVisible && ( {uploadPanelVisible && (
<IconButton <IconButton
size="15" size="15px"
iconName="/static/images/arrow.path.react.svg" iconName="/static/images/arrow.path.react.svg"
className="sharing_panel-arrow" className="sharing_panel-arrow"
onClick={onClose} onClick={onClose}
@ -61,7 +64,9 @@ const Header = ({
size="medium" size="medium"
truncate={!isPersonal} truncate={!isPersonal}
> >
{t("SharingSettingsTitle")} {uploadPanelVisible && label && isPersonal
? label
: t("SharingSettingsTitle")}
</Heading> </Heading>
</div> </div>

View File

@ -52,6 +52,9 @@ const StyledHeaderContent = styled.div`
max-width: calc(100% - 33px); max-width: calc(100% - 33px);
.sharing_panel-arrow { .sharing_panel-arrow {
.icon-button_svg {
width: 15px;
}
margin-right: 16px; margin-right: 16px;
} }
} }

View File

@ -24,7 +24,14 @@ newInstance.use(Backend).init({
loadPath: loadLanguagePath(config.homepage), loadPath: loadLanguagePath(config.homepage),
}, },
ns: ["SharingPanel", "Common", "Translations", "Home", "ChangeOwnerPanel"], ns: [
"SharingPanel",
"Common",
"Translations",
"EmbeddingPanel",
"Home",
"ChangeOwnerPanel",
],
defaultNS: "SharingPanel", defaultNS: "SharingPanel",
react: { react: {

View File

@ -549,16 +549,20 @@ class SharingPanelComponent extends React.Component {
<ModalDialog.Header> <ModalDialog.Header>
<Header <Header
t={t} t={t}
uploadPanelVisible={uploadPanelVisible} uploadPanelVisible={showEmbeddingContent}
isPersonal={isPersonal} isPersonal={isPersonal}
isEncrypted={isEncrypted} isEncrypted={isEncrypted}
onClose={this.onClose} onClose={this.onShowEmbeddingContainer}
onShowUsersPanel={this.onShowUsersPanel} onShowUsersPanel={this.onShowUsersPanel}
onShowGroupsPanel={this.onShowGroupsPanel} onShowGroupsPanel={this.onShowGroupsPanel}
label={t("EmbeddingPanel:EmbeddingDocument")}
/> />
</ModalDialog.Header> </ModalDialog.Header>
<ModalDialog.Body> <ModalDialog.Body>
{showEmbeddingContent ? (
<EmbeddingBody theme={theme} embeddingLink={shareLink} />
) : (
<Body <Body
t={t} t={t}
isPersonal={isPersonal} isPersonal={isPersonal}
@ -570,12 +574,10 @@ class SharingPanelComponent extends React.Component {
accessOptions={accessOptions} accessOptions={accessOptions}
externalAccessOptions={externalAccessOptions} externalAccessOptions={externalAccessOptions}
/> />
{showEmbeddingContent && (
<EmbeddingBody theme={theme} embeddingLink={shareLink} />
)} )}
</ModalDialog.Body> </ModalDialog.Body>
{!showEmbeddingContent && (
<ModalDialog.Footer> <ModalDialog.Footer>
<StyledModalFooter> <StyledModalFooter>
<Button <Button
@ -593,6 +595,7 @@ class SharingPanelComponent extends React.Component {
/> />
</StyledModalFooter> </StyledModalFooter>
</ModalDialog.Footer> </ModalDialog.Footer>
)}
</ModalDialog> </ModalDialog>
)} )}
</> </>
@ -800,6 +803,7 @@ const SharingPanel = inject(
"Translations", "Translations",
"Home", "Home",
"ChangeOwnerPanel", "ChangeOwnerPanel",
"EmbeddingPanel",
])(withLoader(SharingPanelComponent)(<Loaders.DialogAsideLoader isPanel />)) ])(withLoader(SharingPanelComponent)(<Loaders.DialogAsideLoader isPanel />))
) )
); );
@ -812,6 +816,7 @@ class Panel extends React.Component {
"Translations", "Translations",
"Home", "Home",
"ChangeOwnerPanel", "ChangeOwnerPanel",
"EmbeddingPanel",
]); ]);
const { const {
FullAccess, FullAccess,