MM-56775 Limit Bookmarks Title and URL (#28424)
* additional validation for channelbookmark * add fixes for webapp * only set permissions correct for type --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9726eedbe2
Коммит
5dc86d5010
@@ -37,6 +37,9 @@ import './bookmark_create_modal.scss';
|
||||
import CreateModalNameInput from './create_modal_name_input';
|
||||
import {useCanUploadFiles} from './utils';
|
||||
|
||||
const MAX_LINK_LENGTH = 1024;
|
||||
const MAX_TITLE_LENGTH = 64;
|
||||
|
||||
type Props = {
|
||||
channelId: string;
|
||||
bookmarkType?: ChannelBookmark['type'];
|
||||
@@ -377,6 +380,7 @@ function ChannelBookmarkCreateModal({
|
||||
{type === 'link' ? (
|
||||
<>
|
||||
<Input
|
||||
maxLength={MAX_LINK_LENGTH}
|
||||
type='text'
|
||||
name='bookmark-link'
|
||||
containerClassName='linkInput'
|
||||
@@ -449,13 +453,14 @@ function ChannelBookmarkCreateModal({
|
||||
/>
|
||||
</FieldLabel>
|
||||
<CreateModalNameInput
|
||||
maxLength={MAX_TITLE_LENGTH}
|
||||
type={type}
|
||||
imageUrl={icon}
|
||||
fileInfo={pendingFile || fileInfo}
|
||||
emoji={emoji}
|
||||
setEmoji={setEmoji}
|
||||
displayName={displayName}
|
||||
placeholder={displayNameValue}
|
||||
displayName={displayName?.substring(0, MAX_TITLE_LENGTH)}
|
||||
placeholder={displayNameValue?.substring(0, MAX_TITLE_LENGTH)}
|
||||
setDisplayName={setDisplayName}
|
||||
onAddCustomEmojiClick={onHide}
|
||||
showEmojiPicker={showEmojiPicker}
|
||||
|
||||
@@ -20,6 +20,7 @@ import {isKeyPressed} from 'utils/keyboard';
|
||||
import BookmarkIcon from './bookmark_icon';
|
||||
|
||||
type Props = {
|
||||
maxLength: number;
|
||||
type: ChannelBookmark['type'];
|
||||
fileInfo: FileInfo | undefined;
|
||||
imageUrl: string | undefined;
|
||||
@@ -33,6 +34,7 @@ type Props = {
|
||||
onAddCustomEmojiClick?: () => void;
|
||||
}
|
||||
const CreateModalNameInput = ({
|
||||
maxLength,
|
||||
type,
|
||||
imageUrl,
|
||||
fileInfo,
|
||||
@@ -138,6 +140,7 @@ const CreateModalNameInput = ({
|
||||
<ChevronDownIcon size={'12px'}/>
|
||||
</button>
|
||||
<Input
|
||||
maxLength={maxLength}
|
||||
type='text'
|
||||
name='bookmark-display-name'
|
||||
onChange={handleInputChange}
|
||||
|
||||
Ссылка в новой задаче
Block a user