Bugfix/Credential mandatory field when preview chunks (#2356)
check if credential is mandatory field when preview chunks
This commit is contained in:
parent
43b22476e3
commit
26e7a1ac35
|
|
@ -120,9 +120,14 @@ const LoaderConfigPreviewChunks = () => {
|
|||
let canSubmit = true
|
||||
const inputParams = (selectedDocumentLoader.inputParams ?? []).filter((inputParam) => !inputParam.hidden)
|
||||
for (const inputParam of inputParams) {
|
||||
if (!inputParam.optional && !selectedDocumentLoader.inputs[inputParam.name]) {
|
||||
canSubmit = false
|
||||
break
|
||||
if (!inputParam.optional && (!selectedDocumentLoader.inputs[inputParam.name] || !selectedDocumentLoader.credential)) {
|
||||
if (inputParam.type === 'credential' && !selectedDocumentLoader.credential) {
|
||||
canSubmit = false
|
||||
break
|
||||
} else if (inputParam.type !== 'credential' && !selectedDocumentLoader.inputs[inputParam.name]) {
|
||||
canSubmit = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!canSubmit) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue