Skip to content

Commit

Permalink
Revert "Merge pull request #640 from urfit-tech/fix/braft-editor-exte…
Browse files Browse the repository at this point in the history
…rnal-limit"

This reverts commit 6d14319, reversing
changes made to 4bd4e10.
  • Loading branch information
TedxTed committed Dec 12, 2024
1 parent bbf1052 commit 762e44e
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 92 deletions.
6 changes: 1 addition & 5 deletions src/components/appointment/AppointmentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,7 @@ const AppointmentCard: React.VFC<AppointmentCardProps> = ({
'hr',
'media',
]}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>,
)}
</Form.Item>
Expand Down
6 changes: 1 addition & 5 deletions src/components/common/MessageItemForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ const MessageItemForm: React.VFC<MessageItemFormProps> = ({ title, description,
})(
<StyledEditor
controls={['bold', 'italic', 'underline', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>,
)}
</Form.Item>
Expand Down
6 changes: 1 addition & 5 deletions src/components/common/MessageReplyCreationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ const MessageReplyCreationForm: React.VFC<MessageReplyCreationFormProps> = ({ on
language="zh-hant"
placeholder={formatMessage(issueMessages.form.placeholder.reply)}
controls={['bold', 'italic', 'underline', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>,
)}
</Form.Item>
Expand Down
6 changes: 1 addition & 5 deletions src/components/common/MessageReplyItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ const MessageReplyItem: React.VFC<{
value={contentState}
onChange={value => setContentState(value)}
controls={['bold', 'italic', 'underline', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>
<div>
<Button variant="outline" className="mr-2" onClick={() => setEditing(false)}>
Expand Down
6 changes: 1 addition & 5 deletions src/components/issue/IssueCreationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@ const IssueCreationModal: React.VFC<IssueCreationModalProps> = ({ threadId, form
'media',
]}
contentClassName="short-bf-content"
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>,
)}
</Form.Item>
Expand Down
6 changes: 1 addition & 5 deletions src/components/issue/IssueItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,7 @@ const IssueItem: React.VFC<IssueItemProps> = ({
})(
<StyledEditor
controls={['bold', 'italic', 'underline', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>,
)}
</Form.Item>
Expand Down
6 changes: 1 addition & 5 deletions src/components/issue/IssueReplyCreationBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ const IssueReplyCreationBlock: React.VFC<IssueReplyCreationBlockProps> = ({ memb
language="zh-hant"
placeholder={formatMessage(issueMessages.form.placeholder.reply)}
controls={['bold', 'italic', 'underline', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>,
)}
</Form.Item>
Expand Down
6 changes: 1 addition & 5 deletions src/components/issue/IssueReplyItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,7 @@ const IssueReplyItem: React.VFC<{
value={contentState}
onChange={value => setContentState(value)}
controls={['bold', 'italic', 'underline', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>
<div>
<Button variant="outline" className="mr-2" onClick={() => setEditing(false)}>
Expand Down
6 changes: 1 addition & 5 deletions src/components/merchandise/MerchandiseOrderContactModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,7 @@ const MerchandiseOrderContactModal: React.VFC<{ orderId: string }> = ({ orderId
isInvalid={!!errors?.message}
language="zh-hant"
controls={['bold', 'italic', 'underline', 'remove-styles', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
placeholder={formatMessage(messages.fillMessageContent)}
/>
}
Expand Down
14 changes: 2 additions & 12 deletions src/components/practice/PracticeUploadModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Controller, useForm } from 'react-hook-form'
import { defineMessages, useIntl } from 'react-intl'
import styled from 'styled-components'
import hasura from '../../hasura'
import { createUploadFn, handleError } from '../../helpers'
import { handleError } from '../../helpers'
import { uploadFile } from '../../helpers/index'
import { commonMessages } from '../../helpers/translation'
import { useUploadAttachments } from '../../hooks/data'
Expand Down Expand Up @@ -220,17 +220,7 @@ const PracticeUploadModal: React.VFC<{
</FormControl>
<Controller
name="description"
as={
<BraftEditor
className="mb-4"
placeholder={formatMessage(messages.fillDescriptionPlease)}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
/>
}
as={<BraftEditor className="mb-4" placeholder={formatMessage(messages.fillDescriptionPlease)} />}
control={control}
/>
<div className="mb-4">
Expand Down
6 changes: 1 addition & 5 deletions src/components/practice/SuggestionCreationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,7 @@ const SuggestionCreationModal: React.VFC<SuggestionCreationModalProps> = ({ thre
'media',
]}
contentClassName="short-bf-content"
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken) }}
/>
}
control={control}
Expand Down
6 changes: 1 addition & 5 deletions src/components/profile/ProfileBasicAdminCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,7 @@ const ProfileBasicAdminCard: React.VFC<ProfileBasicAdminCardProps> = ({ form, me
'separator',
'fullscreen',
]}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
placeholder={formatMessage(profileMessages.form.message.introPlaceHolder)}
/>,
)}
Expand Down
6 changes: 1 addition & 5 deletions src/components/profile/ProfileIntroBusinessCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ const ProfileIntroBusinessCard: React.VFC<ProfileIntroBusinessCardProps> = ({ fo
'separator',
'fullscreen',
]}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
placeholder={formatMessage(profileMessages.ProfileIntroBusinessCard.companyIntroPlaceholder)}
></StyledBraftEditor>,
)}
Expand Down
6 changes: 1 addition & 5 deletions src/components/review/ReviewItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,7 @@ const ReviewItem: React.VFC<
<StyledEditor
language="zh-hant"
controls={['bold', 'italic', 'underline', 'remove-styles', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>
}
control={control}
Expand Down
12 changes: 2 additions & 10 deletions src/components/review/ReviewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,7 @@ const ReviewModal: React.VFC<{
<StyledEditor
language="zh-hant"
controls={['bold', 'italic', 'underline', 'remove-styles', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>
}
control={control}
Expand All @@ -283,11 +279,7 @@ const ReviewModal: React.VFC<{
<StyledEditor
language="zh-hant"
controls={['bold', 'italic', 'underline', 'remove-styles', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>
}
control={control}
Expand Down
6 changes: 1 addition & 5 deletions src/components/review/ReviewReplyItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,7 @@ const ReviewReplyItem: React.VFC<ReviewReplyItemProps & { onRefetch?: () => void
<StyledEditor
language="zh-hant"
controls={['bold', 'italic', 'underline', 'remove-styles', 'separator', 'media']}
media={{
uploadFn: createUploadFn(appId, authToken),
accepts: { video: false, audio: false },
externals: { video: false, audio: false },
}}
media={{ uploadFn: createUploadFn(appId, authToken), accepts: { video: false, audio: false } }}
/>
}
control={control}
Expand Down

0 comments on commit 762e44e

Please sign in to comment.