From 56ef5adcbe0082f40887260e61e5bef943e3dd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20Echterh=C3=B6lter?= Date: Mon, 5 Aug 2024 17:15:13 +0200 Subject: [PATCH] feat: adding providers placeholder --- .../example-resources/assets/providers.json | 26 ++++++ .../content-configurations/providers.yaml | 12 +++ .../content-configs_test.yaml.snap | 80 ++++++++++++++++++- .../tests/content-configs_test.yaml | 8 +- charts/example-resources/values.yaml | 3 +- 5 files changed, 126 insertions(+), 3 deletions(-) create mode 100644 charts/example-resources/assets/providers.json create mode 100644 charts/example-resources/templates/content-configurations/providers.yaml diff --git a/charts/example-resources/assets/providers.json b/charts/example-resources/assets/providers.json new file mode 100644 index 0000000..438a716 --- /dev/null +++ b/charts/example-resources/assets/providers.json @@ -0,0 +1,26 @@ +{ + "name": "overview", + "luigiConfigFragment": [ + { + "data": { + "nodes": [ + { + "pathSegment": "providers", + "label": "Providers", + "entityType": "main", + "loadingIndicator": { + "enabled": false + }, + "keepSelectedForChildren": true, + "url": "https://fiddle.luigi-project.io/examples/microfrontends/multipurpose.html", + "children": [ ], + "context": { + "title": "Catalog of Active Providers", + "content": " " + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/charts/example-resources/templates/content-configurations/providers.yaml b/charts/example-resources/templates/content-configurations/providers.yaml new file mode 100644 index 0000000..40662ba --- /dev/null +++ b/charts/example-resources/templates/content-configurations/providers.yaml @@ -0,0 +1,12 @@ +{{- if .Values.contentConfigurations.providers }} +apiVersion: core.openmfp.io/v1alpha1 +kind: ContentConfiguration +metadata: + name: providers + namespace: {{ .Release.Namespace }} +spec: + inlineConfiguration: + content: |- + {{ .Files.Get "assets/providers.json" | nindent 6 }} + contentType: json +{{- end }} \ No newline at end of file diff --git a/charts/example-resources/tests/__snapshot__/content-configs_test.yaml.snap b/charts/example-resources/tests/__snapshot__/content-configs_test.yaml.snap index 3ec1fbc..fe66798 100644 --- a/charts/example-resources/tests/__snapshot__/content-configs_test.yaml.snap +++ b/charts/example-resources/tests/__snapshot__/content-configs_test.yaml.snap @@ -40,7 +40,7 @@ matches the snapshot: ] } contentType: json -matches the snapshot (gardener: +matches the snapshot (gardener): 1: | apiVersion: core.openmfp.io/v1alpha1 kind: ContentConfiguration @@ -130,3 +130,81 @@ matches the snapshot (gardener: ] } contentType: json +matches the snapshot (providers): + 1: | + apiVersion: core.openmfp.io/v1alpha1 + kind: ContentConfiguration + metadata: + name: home + namespace: NAMESPACE + spec: + inlineConfiguration: + content: |2- + { + "name": "overview", + "luigiConfigFragment": [ + { + "data": { + "nodes": [ + { + "entityType": "global", + "pathSegment": "home", + "hideFromNav": true, + "defineEntity": { + "id": "main" + }, + "children": [ + { + "pathSegment": "overview", + "label": "Overview", + "icon": "home", + "url": "https://fiddle.luigi-project.io/examples/microfrontends/multipurpose.html", + "context": { + "title": "Welcome to OpenMFP Portal", + "content": " " + } + } + ] + } + ] + } + } + ] + } + contentType: json + 2: | + apiVersion: core.openmfp.io/v1alpha1 + kind: ContentConfiguration + metadata: + name: providers + namespace: NAMESPACE + spec: + inlineConfiguration: + content: |2- + { + "name": "overview", + "luigiConfigFragment": [ + { + "data": { + "nodes": [ + { + "pathSegment": "providers", + "label": "Providers", + "entityType": "main", + "loadingIndicator": { + "enabled": false + }, + "keepSelectedForChildren": true, + "url": "https://fiddle.luigi-project.io/examples/microfrontends/multipurpose.html", + "children": [ ], + "context": { + "title": "Catalog of Active Providers", + "content": " " + } + } + ] + } + } + ] + } + contentType: json diff --git a/charts/example-resources/tests/content-configs_test.yaml b/charts/example-resources/tests/content-configs_test.yaml index 862a7fa..2cfcb77 100644 --- a/charts/example-resources/tests/content-configs_test.yaml +++ b/charts/example-resources/tests/content-configs_test.yaml @@ -5,9 +5,15 @@ tests: - it: matches the snapshot asserts: - matchSnapshot: {} - - it: matches the snapshot (gardener + - it: matches the snapshot (gardener) set: contentConfigurations: gardener: true asserts: - matchSnapshot: {} + - it: matches the snapshot (providers) + set: + contentConfigurations: + providers: true + asserts: + - matchSnapshot: {} diff --git a/charts/example-resources/values.yaml b/charts/example-resources/values.yaml index aa808e1..ddf92ac 100644 --- a/charts/example-resources/values.yaml +++ b/charts/example-resources/values.yaml @@ -5,4 +5,5 @@ accounts: contentConfigurations: home: true - gardener: false \ No newline at end of file + gardener: false + providers: false \ No newline at end of file