diff --git a/enterprise/frontend/src/lib/components/Forms/ModelForm.svelte b/enterprise/frontend/src/lib/components/Forms/ModelForm.svelte deleted file mode 100644 index 1ca3994eb..000000000 --- a/enterprise/frontend/src/lib/components/Forms/ModelForm.svelte +++ /dev/null @@ -1,1418 +0,0 @@ - - - createModalCache.deleteCache(model.urlModel)} - {...$$restProps} -> - - - - {#if shape.reference_control} - { - if (e.detail) { - await fetch(`/reference-controls/${e.detail}`) - .then((r) => r.json()) - .then((r) => { - form.form.update((currentData) => { - if ( - context === 'edit' && - currentData['reference_control'] === initialData['reference_control'] && - !updated_fields.has('reference_control') - ) { - return currentData; // Keep the current values in the edit form. - } - updated_fields.add('reference_control'); - return { ...currentData, category: r.category, csf_function: r.csf_function }; - }); - }); - } - }} - /> - {/if} - {#if shape.name} - - {/if} - {#if shape.description} - - {/if} - {#if URLModel === 'projects'} - - - - {:else if URLModel === 'folders'} - - {:else if URLModel === 'risk-assessments' || URLModel === 'risk-assessment-duplicate'} - - - {#if !riskAssessmentDuplication} - - - - - - - - {/if} - {:else if URLModel === 'threats'} - - - - - {:else if URLModel === 'risk-scenarios'} - - - {:else if URLModel === 'applied-controls' || URLModel === 'policies'} - {#if schema.shape.category} - - {/if} - - - - - - - - - - - {:else if URLModel === 'risk-acceptances'} - - {#if object.id && $page.data.user.id === object.approver} - - {/if} - - - - {:else if URLModel === 'reference-controls'} - - - - - - - {:else if URLModel === 'evidences'} - - - - {#if !(initialData.applied_controls || initialData.requirement_assessments)} - - {:else} - - {/if} - - {:else if URLModel === 'compliance-assessments'} - {#if context === 'fromBaseline' && initialData.baseline} - - {/if} - - - - { - if (e.detail) { - await fetch(`/frameworks/${e.detail}`) - .then((r) => r.json()) - .then((r) => { - const implementation_groups = r['implementation_groups_definition'] || []; - model.selectOptions['selected_implementation_groups'] = implementation_groups.map( - (group) => ({ label: group.name, value: group.ref_id }) - ); - }); - } - }} - /> - {#if model.selectOptions['selected_implementation_groups'] && model.selectOptions['selected_implementation_groups'].length} - - {/if} - - - - - - {:else if URLModel === 'assets'} - - - - - {:else if URLModel === 'requirement-assessments'} - - - - - - - {:else if URLModel === 'entities'} - - - - {:else if URLModel === 'entity-assessments'} - - {#if !data.compliance_assessment} - - { - if (e.detail) { - await fetch(`/frameworks/${e.detail}`) - .then((r) => r.json()) - .then((r) => { - const implementation_groups = r['implementation_groups_definition'] || []; - model.selectOptions['selected_implementation_groups'] = implementation_groups.map( - (group) => ({ label: group.name, value: group.ref_id }) - ); - }); - } - }} - /> - {#if model.selectOptions['selected_implementation_groups'] && model.selectOptions['selected_implementation_groups'].length} - - {/if} - {/if} - - - - - - - - - - - - - - - - {:else if URLModel === 'solutions'} - - - - {:else if URLModel === 'representatives'} - - {#if !data.user} - - {/if} - - - - - - {:else if URLModel === 'frameworks'} - - - {:else if URLModel === 'users'} - - {#if shape.first_name && shape.last_name} - - - {/if} - {#if shape.user_groups} - - {/if} - {#if shape.is_active} - - {/if} - {:else if URLModel === 'sso-settings'} - - - - {#if data.provider !== 'saml'} - - {m.IdPConfiguration()} - - - - - {#if data.provider !== 'saml'} - - - {/if} - - - {/if} - {#if data.provider === 'saml'} - - {m.SAMLIdPConfiguration()} - - - Option 1: Fill the metadata url - - - - {m.or()} - - - Option 2: Fill the SSO URL, SLO URL and x509cert - - - - - - - - {m.SPConfiguration()} - - - - - - {m.advancedSettings()} - - - - - - - - - - - - - - - - - - - - - - - - - {/if} - - {/if} - - {#if closeModal} - { - parent.onClose(event); - createModalCache.deleteCache(model.urlModel); - }}>{m.cancel()} - { - createModalCache.deleteCache(model.urlModel); - }}>{m.save()} - {:else} - {#if cancelButton} - {m.cancel()} - {/if} - {m.save()} - {/if} - - diff --git a/enterprise/frontend/src/lib/components/Forms/ModelForm/FolderForm.svelte b/enterprise/frontend/src/lib/components/Forms/ModelForm/FolderForm.svelte new file mode 100644 index 000000000..f9123d39a --- /dev/null +++ b/enterprise/frontend/src/lib/components/Forms/ModelForm/FolderForm.svelte @@ -0,0 +1,23 @@ + + + diff --git a/frontend/src/lib/components/Forms/ModelForm.svelte b/frontend/src/lib/components/Forms/ModelForm.svelte index 458849090..8b3099750 100644 --- a/frontend/src/lib/components/Forms/ModelForm.svelte +++ b/frontend/src/lib/components/Forms/ModelForm.svelte @@ -23,6 +23,7 @@ import FrameworksForm from './ModelForm/FrameworkForm.svelte'; import UsersForm from './ModelForm/UserForm.svelte'; import SsoSettingsForm from './ModelForm/SsoSettingForm.svelte'; + import FolderForm from './ModelForm/FolderForm.svelte'; import AutocompleteSelect from './AutocompleteSelect.svelte'; @@ -175,6 +176,8 @@ {/if} {#if URLModel === 'projects'} + {:else if URLModel === 'folders'} + {:else if URLModel === 'risk-assessments' || URLModel === 'risk-assessment-duplicate'} + // NOTE: The community version of FolderForm does nothing special at the moment. + // It was created to simplify operations. +
Option 1: Fill the metadata url
Option 2: Fill the SSO URL, SLO URL and x509cert