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
|
let canSubmit = true
|
||||||
const inputParams = (selectedDocumentLoader.inputParams ?? []).filter((inputParam) => !inputParam.hidden)
|
const inputParams = (selectedDocumentLoader.inputParams ?? []).filter((inputParam) => !inputParam.hidden)
|
||||||
for (const inputParam of inputParams) {
|
for (const inputParam of inputParams) {
|
||||||
if (!inputParam.optional && !selectedDocumentLoader.inputs[inputParam.name]) {
|
if (!inputParam.optional && (!selectedDocumentLoader.inputs[inputParam.name] || !selectedDocumentLoader.credential)) {
|
||||||
canSubmit = false
|
if (inputParam.type === 'credential' && !selectedDocumentLoader.credential) {
|
||||||
break
|
canSubmit = false
|
||||||
|
break
|
||||||
|
} else if (inputParam.type !== 'credential' && !selectedDocumentLoader.inputs[inputParam.name]) {
|
||||||
|
canSubmit = false
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!canSubmit) {
|
if (!canSubmit) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue