-
Notifications
You must be signed in to change notification settings - Fork 175
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 1 #1130
Merged
Merged
Workshop 1 #1130
Changes from 35 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
04ef58a
starting point
ab-smith c32cad4
Basic tile styling
ab-smith e3c8065
Merge branch 'main' into ebios-rm-tiles
ab-smith 5683520
wip
ab-smith f15e8e0
wip
ab-smith 8e296c6
Merge branch 'main' into ebios-rm-tiles
ab-smith b410a6e
Merge branch 'main' into ebios-rm-tiles
ab-smith ff16985
Closer to the training materials
ab-smith 454aae0
Formatter
ab-smith 4f9c994
workshop1: prepare step 1/2
Mohamed-Hacene 1d44ddd
Merge remote-tracking branch 'origin/CA-660-create-base-models' into …
Mohamed-Hacene c3e6497
chore: remove bad imports
Mohamed-Hacene 2b6b927
feat: add ebios rm base endpoint
Mohamed-Hacene 25e369f
feat: manage ebios rm from front
Mohamed-Hacene fa9c7c6
feat: set ebios object breadcrumbs
Mohamed-Hacene 0789977
feat: add risk matrix field in ebios rm
Mohamed-Hacene eac11ca
Merge remote-tracking branch 'origin/CA-660-create-base-models' into …
Mohamed-Hacene 7e730ea
chore: remove repeated argument
Mohamed-Hacene b6084b4
feat: prepare step 1/2
Mohamed-Hacene eae82e4
Merge branch 'main' into CA-672-Step-1.1-1.2
Mohamed-Hacene 334bf99
Fix code scanning alert no. 18: Information exposure through an excep…
Mohamed-Hacene e0b1521
chore: format
Mohamed-Hacene 6d733ab
Merge branch 'CA-672-Step-1.1-1.2' of github.com:intuitem/ciso-assist…
Mohamed-Hacene 2023fd5
chore: format serializer
Mohamed-Hacene 4c5090b
Merge remote-tracking branch 'origin/CA-681-create-crud-endpoints-for…
Mohamed-Hacene 4a9da32
feat: map new ebios endpoint
Mohamed-Hacene 3ef3052
chore: format
Mohamed-Hacene 356b552
feat: add step 1.3
Mohamed-Hacene 3c7ec09
fix: typos
Mohamed-Hacene 7fc9aa3
Merge branch 'CA-672-Step-1.1-1.2' into CA-673-Step-1.3
Mohamed-Hacene 41373e5
feat: add qualifications endpoints
Mohamed-Hacene 1abf468
feat: add step 1.4
Mohamed-Hacene 5eeb5a3
chore: remove form debug
Mohamed-Hacene cdae724
Merge branch 'main' into CA-674-Step-1.4
Mohamed-Hacene 050c587
fix: typos
Mohamed-Hacene 17c48aa
Rename base route to baseline
nas-tabchiche 6e26974
Add risk_matrix property and endpoint to feared events
nas-tabchiche 052c067
Add gravity choices endpoint for feared events
nas-tabchiche 7f03d85
Internationalize gravity field
nas-tabchiche 981bb34
Add gravity field to feared event form
nas-tabchiche 4db984a
Add valueType parameter to SelectField interface
nas-tabchiche 1bfca6e
chore: use PrimaryKeyRelatedField insteand of SlugRelatedField
Mohamed-Hacene 76f84ef
Merge branch 'CA-674-Step-1.4' of github.com:intuitem/ciso-assistant-…
Mohamed-Hacene 475a7b0
Merge branch 'main' into CA-674-Step-1.4
Mohamed-Hacene 0120a29
Remove required contraint from ref_id
nas-tabchiche c8b5471
Add ebios_rm before core in INSTALLED_APPS
nas-tabchiche c597f00
Add selectOptions for feared event
nas-tabchiche 414e106
Fix choices for feared event gravity on create
nas-tabchiche 1263644
Serialize feared event gravity display
nas-tabchiche b6d9220
Add translations
nas-tabchiche 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
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
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
110 changes: 110 additions & 0 deletions
110
frontend/src/lib/components/Forms/ModelForm/EbiosRmForm.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,110 @@ | ||
<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'; | ||
|
||
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: string; | ||
</script> | ||
|
||
{#if context !== 'ebiosRmStudy'} | ||
<TextField | ||
{form} | ||
field="version" | ||
label={m.version()} | ||
cacheLock={cacheLocks['version']} | ||
bind:cachedValue={formDataCache['version']} | ||
/> | ||
<TextField | ||
{form} | ||
field="ref_id" | ||
label={m.refId()} | ||
cacheLock={cacheLocks['ref_id']} | ||
bind:cachedValue={formDataCache['ref_id']} | ||
/> | ||
<AutocompleteSelect | ||
{form} | ||
options={getOptions({ objects: model.foreignKeys['folder'] })} | ||
field="folder" | ||
cacheLock={cacheLocks['folder']} | ||
bind:cachedValue={formDataCache['folder']} | ||
label={m.domain()} | ||
hidden={initialData.folder} | ||
/> | ||
<AutocompleteSelect | ||
{form} | ||
options={getOptions({ objects: model.foreignKeys['risk_matrix'] })} | ||
field="risk_matrix" | ||
cacheLock={cacheLocks['risk_matrix']} | ||
bind:cachedValue={formDataCache['risk_matrix']} | ||
label={m.riskMatrix()} | ||
helpText={m.ebiosRmMatrixHelpText()} | ||
/> | ||
{:else if context === 'ebiosRmStudy'} | ||
<div class="relative p-2 space-y-2 border rounded-md"> | ||
<p class="absolute -top-3 bg-white font-bold">{m.activityOne()}</p> | ||
<TextField | ||
{form} | ||
field="version" | ||
label={m.version()} | ||
cacheLock={cacheLocks['version']} | ||
bind:cachedValue={formDataCache['version']} | ||
/> | ||
<TextField | ||
{form} | ||
required | ||
field="ref_id" | ||
label={m.refId()} | ||
cacheLock={cacheLocks['ref_id']} | ||
bind:cachedValue={formDataCache['ref_id']} | ||
/> | ||
<TextArea | ||
{form} | ||
field="observation" | ||
label={m.observation()} | ||
cacheLock={cacheLocks['observation']} | ||
bind:cachedValue={formDataCache['observation']} | ||
/> | ||
<AutocompleteSelect | ||
multiple | ||
{form} | ||
options={getOptions({ objects: model.foreignKeys['authors'], label: 'email' })} | ||
field="authors" | ||
cacheLock={cacheLocks['authors']} | ||
bind:cachedValue={formDataCache['authors']} | ||
label={m.authors()} | ||
/> | ||
<AutocompleteSelect | ||
multiple | ||
{form} | ||
options={getOptions({ objects: model.foreignKeys['reviewers'], label: 'email' })} | ||
field="reviewers" | ||
cacheLock={cacheLocks['reviewers']} | ||
bind:cachedValue={formDataCache['reviewers']} | ||
label={m.reviewers()} | ||
/> | ||
</div> | ||
<div class="relative p-2 space-y-2 border rounded-md"> | ||
<p class="absolute -top-3 bg-white font-bold">{m.activityTwo()}</p> | ||
<AutocompleteSelect | ||
multiple | ||
{form} | ||
options={getOptions({ | ||
objects: model.foreignKeys['assets'], | ||
extra_fields: [['folder', 'str']], | ||
label: 'auto' | ||
})} | ||
field="assets" | ||
label={m.assets()} | ||
/> | ||
</div> | ||
{/if} |
61 changes: 61 additions & 0 deletions
61
frontend/src/lib/components/Forms/ModelForm/FearedEventForm.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,61 @@ | ||
<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'; | ||
|
||
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: string; | ||
</script> | ||
|
||
<AutocompleteSelect | ||
{form} | ||
options={getOptions({ objects: model.foreignKeys['ebios_rm_study'] })} | ||
field="ebios_rm_study" | ||
cacheLock={cacheLocks['ebios_rm_study']} | ||
bind:cachedValue={formDataCache['ebios_rm_study']} | ||
label={m.ebiosRmStudy()} | ||
hidden={initialData.ebios_rm_study} | ||
/> | ||
<TextField | ||
{form} | ||
field="ref_id" | ||
label={m.refId()} | ||
cacheLock={cacheLocks['ref_id']} | ||
bind:cachedValue={formDataCache['ref_id']} | ||
/> | ||
<TextArea | ||
{form} | ||
field="justification" | ||
label={m.justification()} | ||
cacheLock={cacheLocks['justification']} | ||
bind:cachedValue={formDataCache['justification']} | ||
/> | ||
<AutocompleteSelect | ||
multiple | ||
{form} | ||
options={getOptions({ | ||
objects: model.foreignKeys['assets'], | ||
extra_fields: [['folder', 'str']], | ||
label: 'auto' | ||
})} | ||
field="assets" | ||
label={m.assets()} | ||
/> | ||
<AutocompleteSelect | ||
multiple | ||
{form} | ||
options={getOptions({ | ||
objects: model.foreignKeys['qualifications'] | ||
})} | ||
field="qualifications" | ||
label={m.qualifications()} | ||
/> |
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.
EBIOS RM stuff leaking on
core
should be avoided unless absolutely necessary. Since this field would only be needed in EBIOS RM contexts, what about having a serializer inheriting from this one in theebios_rm
app, with the additional field?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.
Nevermind, let's take this shortcut.