-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for route-resolving
- Loading branch information
Showing
35 changed files
with
376 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
documentation/HtmlArchitecture.md → documentation/ComponentArchitecture.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Routing: Auflösung und Validierung der URL | ||
|
||
Die Componenten werden jeweils erst initialisiert, | ||
nachdem die Route, zu der sie gehören, aufgelöst wurde. | ||
D.h. DetailComponent wird z.B erst initialisiert, wenn das anzuzeigende | ||
Element geladen ist. | ||
|
||
Folgendes Diagram veraunschaulicht in welcher Reihenfolge die Komponenten | ||
initialisiert werden, und welche Route-Parameter und Daten sie beobachten. | ||
|
||
![](uml/sequence/page_load.png) | ||
|
||
## Katalog Validierung | ||
|
||
Auf den Routen `/:lang/:catalog` und `/:lang/:catalog/:version` wird der | ||
**CatalogResolver** aktiviert um die Route aufzulösen. | ||
|
||
Dabei werden die Parameter validiert, und gegebenenfalls wird auf eine | ||
gültige Version umgeleitet. | ||
|
||
Der **CatalogResolver** stellt zudem *displayInfos* für jeden Katalog | ||
zusammen. | ||
|
||
Diese enthalten alle anzuzeigenden Versionen, verfügbaren | ||
Versionen, sowie die ausgewählte Version bezüglich der Sprache, und der | ||
**SearchFormComponent** verwendet diese um die Dropdowns zu füllen. | ||
|
||
![](uml/sequence/resolve_catalog.png) | ||
|
||
## Katalog Wechsel | ||
|
||
Wird ein Katalog oder Version ausgewählt, wird die Auswahl, bezüglich der | ||
ausgewählten Sprache, direkt vom **SearchFormComponent** validiert. | ||
|
||
Ist die Auswahl nicht gültig, wird ein Popup angezeigt um die Sprache | ||
zu wechseln . | ||
|
||
![](uml/sequence/change_catalog.png) | ||
|
||
## Katalog Element wechsel | ||
|
||
Auf der Route `:catalog/:version/:type/:code` wird der **CatalogElementResolver** | ||
aktiviert, welcher entsprechend der Route, das Element für den | ||
**DetailComponent** lädt. | ||
|
||
Entweder befindet sich das Element bereits im **CatalogElementCache**, | ||
oder wird von der API geladen. | ||
|
||
Es werden zudem alle **Parent**-Elemente geladen, damit | ||
direkt die Breadcrum angezeigt werden kann. | ||
|
||
![](uml/sequence/resolve_catalog_element.png) | ||
|
||
## Suche | ||
|
||
Beim Wechsel des QueryParameter *query*, startet der **SearchResultsComponent** | ||
die Suche. | ||
|
||
Der **CatalogSearchService** ist so aufgebaut, dass immer | ||
nur die neuste Suche gestartet wird, und veraltete ignoriert werden. | ||
|
||
![](uml/sequence/search.png) |
Binary file not shown.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@startuml | ||
actor User | ||
control Router <<@angular>> #orange | ||
|
||
entity LanguageGuard #lightgreen | ||
entity TranslateService <<Plugin>> #orange | ||
|
||
User -> Router: / | ||
|
||
activate Router #orange | ||
|
||
note over Router | ||
/ | ||
end note | ||
|
||
Router -> LanguageGuard: canActivate() | ||
activate LanguageGuard #lightgreen | ||
LanguageGuard -> LanguageGuard: | ||
note right | ||
get :lang from cookie, browser or use default | ||
end note | ||
LanguageGuard ->> Router: /:lang | ||
deactivate LanguageGuard | ||
|
||
note over Router | ||
/:lang | ||
end note | ||
|
||
Router -> LanguageGuard: canActivate(:lang) | ||
activate LanguageGuard #lightgreen | ||
|
||
LanguageGuard ->> TranslateService: setLanguage(:lang) | ||
LanguageGuard --> Router: grant access | ||
deactivate LanguageGuard | ||
|
||
Router -> Router: redirect to /:lang/ICD | ||
|
||
...resolve catalog route... | ||
|
||
Router --> User: display | ||
deactivate Router | ||
|
||
|
||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.