Skip to content

Commit

Permalink
Merge pull request #878 from intuitem/hotfix/show-library
Browse files Browse the repository at this point in the history
use uuid instead of urn
  • Loading branch information
eric-intuitem authored Sep 29, 2024
2 parents a481f56 + ad8652e commit 1a96af8
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 15 deletions.
8 changes: 4 additions & 4 deletions backend/core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class Meta:

class ReferenceControlReadSerializer(ReferentialSerializer):
folder = FieldsRelatedField()
library = FieldsRelatedField(["name", "urn"])
library = FieldsRelatedField(["name", "id"])

class Meta:
model = ReferenceControl
Expand Down Expand Up @@ -249,7 +249,7 @@ class Meta:

class ThreatReadSerializer(ReferentialSerializer):
folder = FieldsRelatedField()
library = FieldsRelatedField(["name", "urn"])
library = FieldsRelatedField(["name", "id"])

class Meta:
model = Threat
Expand Down Expand Up @@ -478,7 +478,7 @@ class Meta:

class FrameworkReadSerializer(ReferentialSerializer):
folder = FieldsRelatedField()
library = FieldsRelatedField(["name", "urn"])
library = FieldsRelatedField(["name", "id"])

class Meta:
model = Framework
Expand Down Expand Up @@ -630,7 +630,7 @@ class Meta:
class RequirementMappingSetReadSerializer(BaseModelSerializer):
source_framework = FieldsRelatedField()
target_framework = FieldsRelatedField()
library = FieldsRelatedField(["name", "urn"])
library = FieldsRelatedField(["name", "id"])
folder = FieldsRelatedField()

class Meta:
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/DetailView/DetailView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
>
{#if value !== null && value !== undefined && value !== ''}
{#if key === 'library'}
{@const itemHref = `/libraries/${value.urn}`}
{@const itemHref = `/libraries/${value.id}?loaded`}
<a href={itemHref} class="anchor">{value.name}</a>
{:else if Array.isArray(value)}
{#if Object.keys(value).length > 0}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/components/ModelTable/LibraryActions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<span class="hover:text-primary-500">
<form
method="post"
action="/libraries/{library.urn}?/load"
action="/libraries/{library.id}?/load"
use:enhance={() => {
loading.form = true;
loading.library = library.urn;
Expand Down Expand Up @@ -99,7 +99,7 @@
<span class="hover:text-primary-500">
<form
method="post"
action="/libraries/{library.urn}?/update"
action="/libraries/{library.id}?/update"
use:enhance={() => {
loading.form = true;
loading.library = library.urn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<li class="text-gray-600 list-none">
{#if value}
{#if key === 'library'}
{@const itemHref = `/libraries/${value.urn}`}
{@const itemHref = `/libraries/${value.id}?loaded`}
<a href={itemHref} class="anchor">{value.str}</a>
{:else if key === 'scores_definition'}
{#each Object.entries(value) as [key, definition]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
const breadcrumb_library_data = {
...data.library,
id: data.library.urn
id: data.library.id
};
$: breadcrumbObject.set(breadcrumb_library_data);
Expand Down Expand Up @@ -110,7 +110,7 @@
{:else}
<form
method="post"
action="/libraries/{data.library.urn}?/load"
action="/libraries/{data.library.id}?/load"
use:enhance={() => {
loading.form = true;
loading.library = data.library.urn;
Expand Down Expand Up @@ -138,11 +138,7 @@
<p class="text-md leading-5 text-gray-700">
{m.dependencies()}:
{#each data.library.dependencies as dependency}
<li>
<a href="/libraries/{dependency.urn}" target="_parent" class="anchor"
>{dependency.name}</a
>
</li>
<li>{dependency.name}</li>
{/each}
</p>
{/if}
Expand Down
1 change: 1 addition & 0 deletions frontend/tests/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ fi
echo "=========================================================================================="

if [[ " ${SCRIPT_SHORT_ARGS[@]} " =~ " -q " ]]; then
echo "| quick mode"
npx playwright test ./tests/functional/"${TEST_PATHS[@]}" -x --project=chromium "${SCRIPT_LONG_ARGS[@]}"
else
npx playwright test ./tests/functional/"${TEST_PATHS[@]}" "${SCRIPT_LONG_ARGS[@]}"
Expand Down

0 comments on commit 1a96af8

Please sign in to comment.