diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/StructurizrUtilities.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/StructurizrUtilities.kt index b5f0efa9..76047276 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/StructurizrUtilities.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/StructurizrUtilities.kt @@ -19,11 +19,6 @@ fun Workspace.hasImageViews(id: String) = views.imageViews.any { it.elementId == fun Workspace.hasComponentDiagrams(container: Container) = views.componentViews.any { it.container == container} -fun Workspace.listIndexViewEnabled( - diagrams: List?, - images: List? -) = ((diagrams?.count() ?: 0) + (images?.count() ?: 0)) > 1 - val SoftwareSystem.hasContainers get() = this.containers.isNotEmpty() diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/DiagramIndexListViewModel.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/DiagramIndexListViewModel.kt index ac215325..958d5bc6 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/DiagramIndexListViewModel.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/DiagramIndexListViewModel.kt @@ -4,5 +4,5 @@ package nl.avisi.structurizr.site.generatr.site.model data class DiagramIndexListViewModel( val diagrams: List?, val images: List?, - val showList: Boolean + val showList: Boolean = ((diagrams?.count() ?: 0) + (images?.count() ?: 0)) > 1 ) diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerComponentCodePageViewModel.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerComponentCodePageViewModel.kt index 2d00149f..27be06f8 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerComponentCodePageViewModel.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerComponentCodePageViewModel.kt @@ -2,7 +2,6 @@ package nl.avisi.structurizr.site.generatr.site.model import com.structurizr.model.Container import com.structurizr.model.Component -import nl.avisi.structurizr.site.generatr.listIndexViewEnabled import nl.avisi.structurizr.site.generatr.normalize import nl.avisi.structurizr.site.generatr.site.GeneratorContext @@ -19,8 +18,7 @@ class SoftwareSystemContainerComponentCodePageViewModel(generatorContext: Genera val componentTabs = createComponentsTabViewModel(generatorContext, container) val diagramIndexListViewModel = DiagramIndexListViewModel( null, - images, - generatorContext.workspace.listIndexViewEnabled(null, images) + images ) companion object { fun url(container: Container, component: Component?) = "${url(container.softwareSystem, Tab.CODE)}/${container.name.normalize()}/${component?.name?.normalize()}" diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerComponentsPageViewModel.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerComponentsPageViewModel.kt index a27c37c9..1e4b4dac 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerComponentsPageViewModel.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerComponentsPageViewModel.kt @@ -2,7 +2,6 @@ package nl.avisi.structurizr.site.generatr.site.model import com.structurizr.model.Container import nl.avisi.structurizr.site.generatr.includedProperties -import nl.avisi.structurizr.site.generatr.listIndexViewEnabled import nl.avisi.structurizr.site.generatr.normalize import nl.avisi.structurizr.site.generatr.site.GeneratorContext @@ -24,8 +23,7 @@ class SoftwareSystemContainerComponentsPageViewModel(generatorContext: Generator val containerTabs = createContainersComponentTabViewModel(generatorContext, container.softwareSystem) val diagramIndexListViewModel = DiagramIndexListViewModel( diagrams, - images, - generatorContext.workspace.listIndexViewEnabled(diagrams, images) + images ) companion object { fun url(container: Container) = "${url(container.softwareSystem, Tab.COMPONENT)}/${container.name.normalize()}" diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerPageViewModel.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerPageViewModel.kt index 0f7def29..def44d58 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerPageViewModel.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContainerPageViewModel.kt @@ -2,7 +2,6 @@ package nl.avisi.structurizr.site.generatr.site.model import com.structurizr.model.SoftwareSystem import nl.avisi.structurizr.site.generatr.hasContainerViews -import nl.avisi.structurizr.site.generatr.listIndexViewEnabled import nl.avisi.structurizr.site.generatr.site.GeneratorContext class SoftwareSystemContainerPageViewModel(generatorContext: GeneratorContext, softwareSystem: SoftwareSystem) : @@ -18,7 +17,6 @@ class SoftwareSystemContainerPageViewModel(generatorContext: GeneratorContext, s val visible = generatorContext.workspace.views.hasContainerViews(generatorContext.workspace, softwareSystem) || images.isNotEmpty() val diagramIndexListViewModel = DiagramIndexListViewModel( diagrams, - images, - generatorContext.workspace.listIndexViewEnabled(diagrams, images) + images ) } diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContextPageViewModel.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContextPageViewModel.kt index 5f2fdcd5..7fcf58e8 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContextPageViewModel.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemContextPageViewModel.kt @@ -2,7 +2,6 @@ package nl.avisi.structurizr.site.generatr.site.model import com.structurizr.model.SoftwareSystem import nl.avisi.structurizr.site.generatr.hasSystemContextViews -import nl.avisi.structurizr.site.generatr.listIndexViewEnabled import nl.avisi.structurizr.site.generatr.site.GeneratorContext class SoftwareSystemContextPageViewModel(generatorContext: GeneratorContext, softwareSystem: SoftwareSystem) : @@ -14,7 +13,6 @@ class SoftwareSystemContextPageViewModel(generatorContext: GeneratorContext, sof val visible = generatorContext.workspace.views.hasSystemContextViews(softwareSystem) val diagramIndexListViewModel = DiagramIndexListViewModel( diagrams, - null, - generatorContext.workspace.listIndexViewEnabled(diagrams, null) + null ) } diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemDeploymentPageViewModel.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemDeploymentPageViewModel.kt index 05c3060f..443552e5 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemDeploymentPageViewModel.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemDeploymentPageViewModel.kt @@ -2,7 +2,6 @@ package nl.avisi.structurizr.site.generatr.site.model import com.structurizr.model.SoftwareSystem import nl.avisi.structurizr.site.generatr.hasDeploymentViews -import nl.avisi.structurizr.site.generatr.listIndexViewEnabled import nl.avisi.structurizr.site.generatr.site.GeneratorContext class SoftwareSystemDeploymentPageViewModel(generatorContext: GeneratorContext, softwareSystem: SoftwareSystem) : @@ -14,7 +13,6 @@ class SoftwareSystemDeploymentPageViewModel(generatorContext: GeneratorContext, val visible = generatorContext.workspace.views.hasDeploymentViews(softwareSystem) val diagramIndexListViewModel = DiagramIndexListViewModel( diagrams, - null, - generatorContext.workspace.listIndexViewEnabled(diagrams, null) + null ) } diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemDynamicPageViewModel.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemDynamicPageViewModel.kt index 0d2d128d..8c9d5195 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemDynamicPageViewModel.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemDynamicPageViewModel.kt @@ -2,7 +2,6 @@ package nl.avisi.structurizr.site.generatr.site.model import com.structurizr.model.SoftwareSystem import nl.avisi.structurizr.site.generatr.hasDynamicViews -import nl.avisi.structurizr.site.generatr.listIndexViewEnabled import nl.avisi.structurizr.site.generatr.site.GeneratorContext class SoftwareSystemDynamicPageViewModel(generatorContext: GeneratorContext, softwareSystem: SoftwareSystem) : @@ -14,7 +13,6 @@ class SoftwareSystemDynamicPageViewModel(generatorContext: GeneratorContext, sof val visible = generatorContext.workspace.views.hasDynamicViews(softwareSystem) val diagramIndexListViewModel = DiagramIndexListViewModel( diagrams, - null, - generatorContext.workspace.listIndexViewEnabled(diagrams, null) + null ) }