Skip to content

Commit

Permalink
Fix compliance view (#223)
Browse files Browse the repository at this point in the history
* Add env variables subsection

* Ensure targets is always an array to prevent TypeError

* Add env variables subsection

* Ensure targets is always an array to prevent TypeError

* npm audit fix

* Update node version
  • Loading branch information
anatheka authored Oct 17, 2024
1 parent cc5eebc commit 1e88b84
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:alpine AS build
FROM node:18-alpine AS build

WORKDIR /app
COPY package*.json ./
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ npm run build
You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
## Environment variables
The following environment variables can be set to configure the UI. The values are all default values.

```
PUBLIC_OAUTH_AUTHORITY=http://localhost:8080
PUBLIC_OAUTH_CLIENT_ID=dashboard
PUBLIC_OAUTH_REDIRECT_URI=http://localhost:5173/callback
PUBLIC_OAUTH_SCOPE=profile email
PUBLIC_CLOUDITOR_URL=http://localhost:8080
```
28 changes: 16 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/lib/api/orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export interface ListCertificationTargetsResponse {
}

export interface ListAuditScopesResponse {
auditScope: AuditScope[];
auditScopes: AuditScope[];
}

export interface ListControlsInScopeResponse {
Expand Down Expand Up @@ -481,7 +481,7 @@ export async function listAuditScopes(
fetch = window.fetch
): Promise<AuditScope[]> {
const apiUrl = clouditorize(`/v1/orchestrator/certification_targets/${serviceId}/audit_scopes`);

return fetch(apiUrl, {
method: 'GET',
headers: {
Expand All @@ -491,7 +491,7 @@ export async function listAuditScopes(
.then(throwError)
.then((res) => res.json())
.then((response: ListAuditScopesResponse) => {
return response.auditScope;
return response.auditScopes;
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/routes/(app)/cloud/[id]/compliance/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const load = (async ({ fetch, params, parent }) => {
throw error(405, 'Required parameter missing');
}

const targets = await listAuditScopes(params.id, fetch);
const targets = await listAuditScopes(params.id, fetch) || [];;
const data = await parent();

const leftOverCatalogs = data.catalogs.filter((c) => {
Expand Down

0 comments on commit 1e88b84

Please sign in to comment.