Skip to content

Commit

Permalink
chore: adapt security exceptions AutocompleteSelect forms
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Feb 11, 2025
1 parent bd05a85 commit 9743d05
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
<AutocompleteSelect
{form}
multiple
options={getOptions({ objects: model.foreignKeys['security_exceptions'] })}
optionsEndpoint="security-exceptions"
optionsExtraFields={[['folder', 'str']]}
field="security_exceptions"
cacheLock={cacheLocks['security_exceptions']}
bind:cachedValue={formDataCache['security_exceptions']}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/lib/components/Forms/ModelForm/AssetForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@
<AutocompleteSelect
{form}
multiple
options={getOptions({ objects: model.foreignKeys['security_exceptions'] })}
optionsEndpoint="security-exceptions"
optionsExtraFields={[['folder', 'str']]}
field="security_exceptions"
cacheLock={cacheLocks['security_exceptions']}
bind:cachedValue={formDataCache['security_exceptions']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<HiddenInput {form} field="requirement_assessments" />
<AutocompleteSelect
{form}
options={getOptions({ objects: model.foreignKeys['folder'] })}
optionsEndpoint="folders?content_type=DO&content_type=GL"
field="folder"
cacheLock={cacheLocks['folder']}
bind:cachedValue={formDataCache['folder']}
Expand All @@ -35,15 +35,17 @@
<AutocompleteSelect
{form}
multiple
options={getOptions({ objects: model.foreignKeys['owners'], label: 'email' })}
optionsEndpoint="users?is_third_party=false"
optionsLabelField="email"
field="owners"
cacheLock={cacheLocks['owners']}
bind:cachedValue={formDataCache['owners']}
label={m.owner()}
/>
<AutocompleteSelect
{form}
options={getOptions({ objects: model.foreignKeys['approver'], label: 'email' })}
optionsEndpoint="users?is_third_party=false"
optionsLabelField="email"
field="approver"
cacheLock={cacheLocks['approver']}
bind:cachedValue={formDataCache['approver']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
<AutocompleteSelect
{form}
multiple
options={getOptions({ objects: model.foreignKeys['security_exceptions'] })}
optionsEndpoint="security-exceptions"
optionsExtraFields={[['folder', 'str']]}
field="security_exceptions"
cacheLock={cacheLocks['security_exceptions']}
bind:cachedValue={formDataCache['security_exceptions']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@
<AutocompleteSelect
multiple
form={_form}
options={getOptions({ objects: data.foreignKeys['security_exceptions'] })}
optionsEndpoint="security-exceptions"
optionsExtraFields={[['folder', 'str']]}
field="security_exceptions"
label={m.securityExceptions()}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,8 @@
<AutocompleteSelect
multiple
{form}
options={getOptions({
objects: $page.data.model.foreignKeys['security_exceptions'],
extra_fields: [['folder', 'str']]
})}
optionsEndpoint="security-exceptions"
optionsExtraFields={[['folder', 'str']]}
field="security_exceptions"
/>
<ModelTable
Expand Down

0 comments on commit 9743d05

Please sign in to comment.