Skip to content

Commit

Permalink
A little simplification and better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkgroot committed Aug 29, 2022
1 parent 360306c commit 7bdc912
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ fun parseStructurizrDslWorkspace(workspaceFile: File) =
.workspace
?: throw IllegalStateException("Workspace could not be parsed")

val Model.internalSoftwareSystems: List<SoftwareSystem>
get() = softwareSystems.filter { it.location == Location.Internal || it.location == Location.Unspecified }
val Model.includedSoftwareSystems: List<SoftwareSystem>
get() = softwareSystems.filter { it.location != Location.External }
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nl.avisi.structurizr.site.generatr.site
import com.structurizr.Workspace
import kotlinx.html.*
import kotlinx.html.stream.appendHTML
import nl.avisi.structurizr.site.generatr.internalSoftwareSystems
import nl.avisi.structurizr.site.generatr.includedSoftwareSystems
import nl.avisi.structurizr.site.generatr.site.model.*
import nl.avisi.structurizr.site.generatr.site.views.*
import java.io.File
Expand Down Expand Up @@ -67,7 +67,7 @@ private fun generateHtmlFiles(context: GeneratorContext, exportDir: File) {
context.workspace.documentation.decisions
.forEach { writeHtmlFile(branchDir, WorkspaceDecisionPageViewModel(context, it)) }

context.workspace.model.internalSoftwareSystems.forEach {
context.workspace.model.includedSoftwareSystems.forEach {
writeHtmlFile(branchDir, SoftwareSystemHomePageViewModel(context, it))
writeHtmlFile(branchDir, SoftwareSystemContextPageViewModel(context, it))
writeHtmlFile(branchDir, SoftwareSystemContainerPageViewModel(context, it))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package nl.avisi.structurizr.site.generatr.site.model

import nl.avisi.structurizr.site.generatr.internalSoftwareSystems
import nl.avisi.structurizr.site.generatr.includedSoftwareSystems
import nl.avisi.structurizr.site.generatr.site.GeneratorContext

class MenuViewModel(generatorContext: GeneratorContext, private val pageViewModel: PageViewModel) {
Expand All @@ -18,7 +18,7 @@ class MenuViewModel(generatorContext: GeneratorContext, private val pageViewMode
.forEach { yield(createMenuItem(it.title, WorkspaceDocumentationSectionPageViewModel.url(it))) }
}.toList()

val softwareSystemItems = generatorContext.workspace.model.internalSoftwareSystems
val softwareSystemItems = generatorContext.workspace.model.includedSoftwareSystems
.sortedBy { it.name.lowercase() }
.map {
createMenuItem(it.name, SoftwareSystemPageViewModel.url(it, SoftwareSystemPageViewModel.Tab.HOME), false)
Expand Down

0 comments on commit 7bdc912

Please sign in to comment.