Skip to content

Commit

Permalink
MM-62044: Always show title in create bookmark flow (mattermost#29476)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebroseland authored Dec 16, 2024
1 parent 2b9e85f commit f556965
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ function createLinkBookmark({
// # Enter link
editTextInput('linkInput', link);

cy.wait(TIMEOUTS.HALF_SEC);

if (displayName) {
// # Enter displayname
editTextInput('titleInput', displayName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ function ChannelBookmarkCreateModal({

return undefined;
})();
const showControls = type === 'file' || (isValid || bookmark);

const cancel = useCallback(() => {
if (type === 'file') {
Expand Down Expand Up @@ -375,8 +374,8 @@ function ChannelBookmarkCreateModal({
className='channel-bookmarks-create-modal'
modalHeaderText={formatMessage(bookmark ? msg.editHeading : msg.heading)}
confirmButtonText={formatMessage(bookmark ? msg.saveText : msg.addBookmarkText)}
handleCancel={(showControls && cancel) || undefined}
handleConfirm={(showControls && confirm) || undefined}
handleCancel={cancel}
handleConfirm={confirm}
handleEnterKeyPress={(!confirmDisabled && confirm) || undefined}
onExited={handleOnExited}
compassDesign={true}
Expand Down Expand Up @@ -452,30 +451,28 @@ function ChannelBookmarkCreateModal({

)}

{showControls && (
<TitleWrapper>
<FieldLabel>
<FormattedMessage
id='channel_bookmarks.create.title_input.label'
defaultMessage='Title'
/>
</FieldLabel>
<CreateModalNameInput
maxLength={MAX_TITLE_LENGTH}
type={type}
imageUrl={icon}
fileInfo={pendingFile || fileInfo}
emoji={emoji}
setEmoji={setEmoji}
displayName={displayName?.substring(0, MAX_TITLE_LENGTH)}
placeholder={displayNameValue?.substring(0, MAX_TITLE_LENGTH)}
setDisplayName={setDisplayName}
onAddCustomEmojiClick={onHide}
showEmojiPicker={showEmojiPicker}
setShowEmojiPicker={setShowEmojiPicker}
<TitleWrapper>
<FieldLabel>
<FormattedMessage
id='channel_bookmarks.create.title_input.label'
defaultMessage='Title'
/>
</TitleWrapper>
)}
</FieldLabel>
<CreateModalNameInput
maxLength={MAX_TITLE_LENGTH}
type={type}
imageUrl={icon}
fileInfo={pendingFile || fileInfo}
emoji={emoji}
setEmoji={setEmoji}
displayName={displayName?.substring(0, MAX_TITLE_LENGTH)}
placeholder={displayNameValue?.substring(0, MAX_TITLE_LENGTH)}
setDisplayName={setDisplayName}
onAddCustomEmojiClick={onHide}
showEmojiPicker={showEmojiPicker}
setShowEmojiPicker={setShowEmojiPicker}
/>
</TitleWrapper>
</>
</GenericModal>
);
Expand Down

0 comments on commit f556965

Please sign in to comment.