1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00

File attachment in personal server (#4506)

Fixes https://github.com/mattermost/focalboard/issues/4497
This commit is contained in:
Rajat Dabade 2023-01-30 15:40:31 +05:30 committed by GitHub
parent 345ff01539
commit 00d5679f42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View File

@ -240,6 +240,20 @@ exports[`components/cardDialog limited card shows hidden view (no toolbar) 1`] =
<div
class="toolbar--right"
>
<div
class="d-flex"
>
<button
type="button"
>
<i
class="CompassIcon icon-paperclip"
/>
<span>
Attach
</span>
</button>
</div>
<button
aria-label="Close dialog"
title="Close dialog"

View File

@ -159,7 +159,7 @@ const CardDialog = (props: Props): JSX.Element => {
const attachmentBlock = createAttachmentBlock(uploadingBlock)
attachmentBlock.isUploading = true
dispatch(updateAttachments([attachmentBlock]))
if (attachment.size > clientConfig.maxFileSize) {
if (attachment.size > clientConfig.maxFileSize && Utils.isFocalboardPlugin()) {
removeUploadingAttachment(uploadingBlock)
sendFlashMessage({content: intl.formatMessage({id: 'AttachmentBlock.failed', defaultMessage: 'Unable to upload the file. Attachment size limit reached.'}), severity: 'normal'})
} else {
@ -262,7 +262,10 @@ const CardDialog = (props: Props): JSX.Element => {
</>
)
return (<>{attachBtn()}{following ? unfollowBtn : followBtn}</>)
if (!isTemplate && Utils.isFocalboardPlugin() && !card?.limited) {
return (<>{attachBtn()}{following ? unfollowBtn : followBtn}</>)
}
return (<>{attachBtn()}</>)
}
const followingCards = useAppSelector(getUserBlockSubscriptionList)
@ -276,7 +279,7 @@ const CardDialog = (props: Props): JSX.Element => {
className='cardDialog'
onClose={props.onClose}
toolsMenu={!props.readonly && !card?.limited && menu}
toolbar={!isTemplate && Utils.isFocalboardPlugin() && !card?.limited && toolbar}
toolbar={toolbar}
>
{isTemplate &&
<div className='banner'>