Skip to content
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

use uuid instead of urn #878

Merged
merged 7 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading