From def15e8082a52e9d98132aae1164eda81374248b Mon Sep 17 00:00:00 2001 From: Carina Kothe <69976260+grischperl@users.noreply.github.com> Date: Fri, 8 Dec 2023 11:50:52 +0100 Subject: [PATCH] Update UI with improved notifications (#286) * Nats backend notification * First try: human-readable info * Add callout warning when NATS unavailable * Add alert for empty backend * Add empty backend sample Improve visibility of alerts --- config/samples/empty_backend.yaml | 22 +++++++++++++++++++ config/ui-extensions/eventing/details | 8 +++++++ config/ui-extensions/eventing/form | 6 +++++ .../ui-extensions/eventing/kustomization.yaml | 2 +- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 config/samples/empty_backend.yaml diff --git a/config/samples/empty_backend.yaml b/config/samples/empty_backend.yaml new file mode 100644 index 00000000..7120e7ac --- /dev/null +++ b/config/samples/empty_backend.yaml @@ -0,0 +1,22 @@ +apiVersion: operator.kyma-project.io/v1alpha1 +kind: Eventing +metadata: + labels: + app.kubernetes.io/name: eventing + app.kubernetes.io/instance: eventing + app.kubernetes.io/part-of: eventing-manager + app.kubernetes.io/created-by: eventing-manager + name: eventing + namespace: kyma-system +spec: + publisher: + replicas: + min: 2 + max: 2 + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 40m + memory: 64Mi diff --git a/config/ui-extensions/eventing/details b/config/ui-extensions/eventing/details index 0b1fdb83..d6b2e20b 100644 --- a/config/ui-extensions/eventing/details +++ b/config/ui-extensions/eventing/details @@ -25,6 +25,14 @@ body: - source: '$readableTimestamp(lastTransitionTime)' name: Last transition sort: true + - source: "'NATS unavailable: If you chose the NATS backend, you must enable the NATS module.'" + widget: Alert + severity: warning + visibility: "$exists(status.conditions[reason = 'NATSUnavailable'])" + - source: "'No backend: If you enable the Eventing module, you must configure a backend.'" + widget: Alert + severity: warning + visibility: "$exists(status.conditions[reason = 'BackendNotSpecified'])" - name: Events widget: EventList filter: '$matchEvents($$, $root.kind, $root.metadata.name)' diff --git a/config/ui-extensions/eventing/form b/config/ui-extensions/eventing/form index c599c5e4..f7672769 100644 --- a/config/ui-extensions/eventing/form +++ b/config/ui-extensions/eventing/form @@ -7,6 +7,12 @@ - EventMesh description: Choose a backend type from the dropdown. +- simple: true + widget: Alert + severity: info + alert: "'If you choose the NATS backend, you must enable the NATS module.'" + visibility: "spec.backend.type = 'NATS'" + - path: spec.backend.config.eventMeshSecret visibility: "spec.backend.type = 'EventMesh'" widget: ResourceRef diff --git a/config/ui-extensions/eventing/kustomization.yaml b/config/ui-extensions/eventing/kustomization.yaml index 9175e1a1..2e87ec5a 100644 --- a/config/ui-extensions/eventing/kustomization.yaml +++ b/config/ui-extensions/eventing/kustomization.yaml @@ -1,6 +1,6 @@ configMapGenerator: - name: eventings.operator.kyma-project.io - namespace: kube-public + namespace: kyma-system files: - general - form