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} variation={ButtonVariation.PRIMARY}
disabled={false} disabled={false}
onClick={() => { onClick={() => {
if (file !== undefined) {
handleUpload(file as File, setMarkdownContent, repoMetadata, showError, standalone, routingId) handleUpload(file as File, setMarkdownContent, repoMetadata, showError, standalone, routingId)
setOpen(false) setOpen(false)
} else {
showError(getString('uploadAFileError'))
}
}} }}
/> />
<Button <Button

View File

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

View File

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