From cdd7cf9d37d90cb20314936862abbdfd3eb29036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Krassowski?= <5832902+krassowski@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:49:01 +0100 Subject: [PATCH] Hide gallery section if no exhibits are configured (#2549) --- src/_nebari/stages/kubernetes_services/__init__.py | 1 + .../stages/kubernetes_services/template/jupyterhub.tf | 5 +++-- .../modules/kubernetes/services/jupyterhub/variables.tf | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/_nebari/stages/kubernetes_services/__init__.py b/src/_nebari/stages/kubernetes_services/__init__.py index 6cbf03dbb..75234b2ce 100644 --- a/src/_nebari/stages/kubernetes_services/__init__.py +++ b/src/_nebari/stages/kubernetes_services/__init__.py @@ -249,6 +249,7 @@ class JupyterLabGallerySettings(schema.Base): title: str = "Examples" destination: str = "examples" exhibits: List[JupyterLabGalleryExhibit] = [] + hide_gallery_without_exhibits: bool = True class JupyterLab(schema.Base): diff --git a/src/_nebari/stages/kubernetes_services/template/jupyterhub.tf b/src/_nebari/stages/kubernetes_services/template/jupyterhub.tf index 425c60bed..e95a55573 100644 --- a/src/_nebari/stages/kubernetes_services/template/jupyterhub.tf +++ b/src/_nebari/stages/kubernetes_services/template/jupyterhub.tf @@ -57,8 +57,9 @@ variable "jupyterlab-default-settings" { variable "jupyterlab-gallery-settings" { description = "Server-side settings for jupyterlab-gallery extension" type = object({ - title = optional(string) - destination = optional(string) + title = optional(string) + destination = optional(string) + hide_gallery_without_exhibits = optional(bool) exhibits = list(object({ git = string title = string diff --git a/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/variables.tf b/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/variables.tf index af6f06654..f43a25b90 100644 --- a/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/variables.tf +++ b/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/variables.tf @@ -166,8 +166,9 @@ variable "jupyterlab-default-settings" { variable "jupyterlab-gallery-settings" { description = "Server-side settings for jupyterlab-gallery extension" type = object({ - title = optional(string) - destination = optional(string) + title = optional(string) + destination = optional(string) + hide_gallery_without_exhibits = optional(bool) exhibits = list(object({ git = string title = string