-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workshop 3 #1139
Merged
Merged
Workshop 3 #1139
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8ba5ace
Add stakeholders urlmodel
nas-tabchiche 6121a30
Write StakeholderForm
nas-tabchiche 40c9c06
Internationalize stakeholder fields
nas-tabchiche 1b9f758
Write workshop 3 ecosystem page
nas-tabchiche 3f552d0
Map workshop 3.1 and 3.3 page to EBIOS RM tiles
nas-tabchiche 6d000ac
Add string representation for Stakeholder model
nas-tabchiche 5e52b95
Update stakeholder modeltable default fields
nas-tabchiche 68a4efb
Add attack paths urlmodel
nas-tabchiche 0603fd6
Write AttackPathForm component
nas-tabchiche 13d33e0
Internationalize likelihood field
nas-tabchiche 8b09582
Add strategic scenarios page
nas-tabchiche 7f9d0c7
Internationalize stakeholders field
nas-tabchiche 6de8a03
Fix AttackPathForm
nas-tabchiche 58196b9
Improve RO/TO and AttackPath __str__ methods
nas-tabchiche f3a27de
Serialize attack path risk origin and target objective
nas-tabchiche 99765de
Add ebios_rm_study filterset field to stakeholder and attack path vie…
nas-tabchiche d686b8d
Add translations
nas-tabchiche f150dc4
Properly display RO/TO choices in AttackPathForm
nas-tabchiche e0b6835
Update attack path schema and crud entry
nas-tabchiche d8468a0
Update attack path model table
nas-tabchiche ce6e1a2
Properly display stakeholders choices in AttackPathForm
nas-tabchiche 5f9ddee
Internationalize criticality fields
nas-tabchiche 4c3eb2e
Remove unused import
nas-tabchiche 2c8128f
feat: add attack-paths and stakeholders ebios-rm foreignKey
Mohamed-Hacene a75fefe
feat: add attack-paths and stakeholders folder foreignKey
Mohamed-Hacene 96ba91c
feat : add ebios foreignKeyFields endpointUrls
Mohamed-Hacene File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
frontend/src/lib/components/Forms/ModelForm/AttackPathForm.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<script lang="ts"> | ||
import type { SuperValidated } from 'sveltekit-superforms'; | ||
import type { ModelInfo, CacheLock } from '$lib/utils/types'; | ||
import TextField from '$lib/components/Forms/TextField.svelte'; | ||
import AutocompleteSelect from '$lib/components/Forms/AutocompleteSelect.svelte'; | ||
import Select from '$lib/components/Forms/Select.svelte'; | ||
import * as m from '$paraglide/messages.js'; | ||
import { getOptions } from '$lib/utils/crud'; | ||
import TextArea from '../TextArea.svelte'; | ||
import NumberField from '../NumberField.svelte'; | ||
import Checkbox from '../Checkbox.svelte'; | ||
|
||
export let form: SuperValidated<any>; | ||
export let model: ModelInfo; | ||
export let cacheLocks: Record<string, CacheLock> = {}; | ||
export let formDataCache: Record<string, any> = {}; | ||
export let initialData: Record<string, any> = {}; | ||
export let context: 'create' | 'edit' = 'create'; | ||
</script> | ||
|
||
<AutocompleteSelect | ||
{form} | ||
options={getOptions({ objects: model.foreignKeys['ro_to_couple'], label: 'str' })} | ||
field="ro_to_couple" | ||
cacheLock={cacheLocks['ro_to_couple']} | ||
bind:cachedValue={formDataCache['ro_to_couple']} | ||
label={m.roToCouple()} | ||
hidden={initialData.ro_to_couple} | ||
/> | ||
<AutocompleteSelect | ||
{form} | ||
multiple | ||
options={getOptions({ | ||
objects: model.foreignKeys['stakeholders'], | ||
label: 'str' | ||
})} | ||
field="stakeholders" | ||
cacheLock={cacheLocks['stakeholders']} | ||
bind:cachedValue={formDataCache['stakeholders']} | ||
label={m.stakeholders()} | ||
/> | ||
|
||
<Checkbox {form} field="is_selected" label={m.selected()} /> | ||
<TextArea | ||
{form} | ||
field="justification" | ||
label={m.justification()} | ||
cacheLock={cacheLocks['justification']} | ||
bind:cachedValue={formDataCache['justification']} | ||
/> |
116 changes: 116 additions & 0 deletions
116
frontend/src/lib/components/Forms/ModelForm/StakeholderForm.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<script lang="ts"> | ||
import type { SuperValidated } from 'sveltekit-superforms'; | ||
import type { ModelInfo, CacheLock } from '$lib/utils/types'; | ||
import AutocompleteSelect from '$lib/components/Forms/AutocompleteSelect.svelte'; | ||
import Select from '$lib/components/Forms/Select.svelte'; | ||
import * as m from '$paraglide/messages.js'; | ||
import { getOptions } from '$lib/utils/crud'; | ||
import TextArea from '../TextArea.svelte'; | ||
import NumberField from '../NumberField.svelte'; | ||
import Checkbox from '../Checkbox.svelte'; | ||
|
||
export let form: SuperValidated<any>; | ||
export let model: ModelInfo; | ||
export let cacheLocks: Record<string, CacheLock> = {}; | ||
export let formDataCache: Record<string, any> = {}; | ||
export let initialData: Record<string, any> = {}; | ||
export let context: 'create' | 'edit' = 'create'; | ||
</script> | ||
|
||
<AutocompleteSelect | ||
{form} | ||
options={getOptions({ objects: model.foreignKeys['entity'] })} | ||
field="entity" | ||
cacheLock={cacheLocks['entity']} | ||
bind:cachedValue={formDataCache['entity']} | ||
label={m.entity()} | ||
hidden={initialData.entity} | ||
/> | ||
<Select | ||
{form} | ||
options={model.selectOptions['category']} | ||
field="category" | ||
label={m.category()} | ||
cacheLock={cacheLocks['category']} | ||
bind:cachedValue={formDataCache['category']} | ||
/> | ||
|
||
{#if context === 'edit'} | ||
<NumberField | ||
{form} | ||
field="current_dependency" | ||
label={m.currentDependency()} | ||
cacheLock={cacheLocks['current_dependency']} | ||
bind:cachedValue={formDataCache['current_dependency']} | ||
/> | ||
<NumberField | ||
{form} | ||
field="current_penetration" | ||
label={m.currentPenetration()} | ||
cacheLock={cacheLocks['current_penetration']} | ||
bind:cachedValue={formDataCache['current_penetration']} | ||
/> | ||
<NumberField | ||
{form} | ||
field="current_maturity" | ||
label={m.currentMaturity()} | ||
cacheLock={cacheLocks['current_maturity']} | ||
bind:cachedValue={formDataCache['current_maturity']} | ||
/> | ||
<NumberField | ||
{form} | ||
field="current_trust" | ||
label={m.currentTrust()} | ||
cacheLock={cacheLocks['current_trust']} | ||
bind:cachedValue={formDataCache['current_trust']} | ||
/> | ||
|
||
<AutocompleteSelect | ||
multiple | ||
{form} | ||
options={getOptions({ | ||
objects: model.foreignKeys['applied_controls'], | ||
extra_fields: [['folder', 'str']] | ||
})} | ||
field="applied_controls" | ||
label={m.appliedControls()} | ||
/> | ||
|
||
<NumberField | ||
{form} | ||
field="residual_dependency" | ||
label={m.residualDependency()} | ||
cacheLock={cacheLocks['residual_dependency']} | ||
bind:cachedValue={formDataCache['residual_dependency']} | ||
/> | ||
<NumberField | ||
{form} | ||
field="residual_penetration" | ||
label={m.residualPenetration()} | ||
cacheLock={cacheLocks['residual_penetration']} | ||
bind:cachedValue={formDataCache['residual_penetration']} | ||
/> | ||
<NumberField | ||
{form} | ||
field="residual_maturity" | ||
label={m.residualMaturity()} | ||
cacheLock={cacheLocks['residual_maturity']} | ||
bind:cachedValue={formDataCache['residual_maturity']} | ||
/> | ||
<NumberField | ||
{form} | ||
field="residual_trust" | ||
label={m.residualTrust()} | ||
cacheLock={cacheLocks['residual_trust']} | ||
bind:cachedValue={formDataCache['residual_trust']} | ||
/> | ||
|
||
<Checkbox {form} field="is_selected" label={m.selected()} /> | ||
<TextArea | ||
{form} | ||
field="justification" | ||
label={m.justification()} | ||
cacheLock={cacheLocks['justification']} | ||
bind:cachedValue={formDataCache['justification']} | ||
/> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add in attack-paths and stakeholdes
ebios_rm_study, folder
foreignKeyFields for link in DetailedView.