fix: [code-1663]: add error message on submit btn (#1136)

eb/code-1016-2^2
Calvin Lee 2024-03-25 00:02:27 +00:00 committed by Harness
parent ac7ac5e881
commit 00f58fd08e
3 changed files with 8 additions and 2 deletions

View File

@ -478,8 +478,12 @@ export function MarkdownEditorWithPreview({
variation={ButtonVariation.PRIMARY}
disabled={false}
onClick={() => {
handleUpload(file as File, setMarkdownContent, repoMetadata, showError, standalone, routingId)
setOpen(false)
if (file !== undefined) {
handleUpload(file as File, setMarkdownContent, repoMetadata, showError, standalone, routingId)
setOpen(false)
} else {
showError(getString('uploadAFileError'))
}
}}
/>
<Button

View File

@ -852,6 +852,7 @@ export interface StringsMap {
updateUser: string
updateWebhook: string
updated: string
uploadAFileError: string
user: string
userCreated: string
userId: string

View File

@ -1002,3 +1002,4 @@ summary: Summary
prGenSummary: Have Harness AIDA summarize the code changes in this pull request
aidaGenSummary: '[AIDA is generating a summary...]'
importFailed: Import Failed
uploadAFileError: There is no image or video uploaded. Please upload an image or video.