-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: introduce standalone mode #162
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
sbb-icon-sidebar-container { | ||
top: 85px; | ||
} | ||
|
||
::ng-deep a.SideBarMainIcon { | ||
background: whitesmoke; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ import {DomSanitizer} from "@angular/platform-browser"; | |
import {EditorMode} from "../view/editor-menu/editor-mode"; | ||
import {UndoService} from "../services/data/undo.service"; | ||
import {EditorView} from "../view/editor-main-view/data-views/editor.view"; | ||
import {NetzgrafikDefault} from "../sample-netzgrafik/netzgrafik.default"; | ||
import {environment} from "../../environments/environment"; | ||
|
||
export enum IconSidebarMode { | ||
VARIANTEN = "varianten", | ||
|
@@ -29,6 +31,8 @@ export class NetzgrafikApplicationComponent { | |
mode = IconSidebarMode.NONE; | ||
expanded = false; | ||
|
||
readonly disableBackend = environment.disableBackend; | ||
|
||
private readonly destroyed = new Subject<void>(); | ||
|
||
constructor( | ||
|
@@ -48,13 +52,24 @@ export class NetzgrafikApplicationComponent { | |
.subscribe((params) => { | ||
uiInteractionService.setEditorMode(EditorMode.NetzgrafikEditing); | ||
uiInteractionService.showNetzgrafik(); | ||
versionControlService.load(params.getVariantId(), true); | ||
try { | ||
versionControlService.load(params.getVariantId(), true); | ||
} catch (e) { | ||
versionControlService.loadNetzgrafikDTO(NetzgrafikDefault.getDefaultNetzgrafik()); | ||
} | ||
uiInteractionService.setViewboxProperties( | ||
EditorView.svgName, | ||
uiInteractionService.getDefaultViewProperties()); | ||
}); | ||
} | ||
|
||
getSidebarContainerStyle(): string { | ||
if (this.disableBackend) { | ||
return "top: 53px;"; | ||
} | ||
return "top: 85px;"; | ||
} | ||
Comment on lines
+66
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I wonder if we should instead add a |
||
|
||
getVariantIsWritable(): boolean { | ||
if (this.versionControlService.variant === null) { | ||
return true; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { | |
Input, | ||
Output, | ||
} from "@angular/core"; | ||
import {environment} from "../../../environments/environment"; | ||
|
||
/** | ||
* Different layout modes. Generally the layout contains (up to) 3 columns that are distributed over a 4 columen layout: | ||
|
@@ -70,6 +71,13 @@ export class ColumnLayoutComponent implements AfterViewInit { | |
this.newView = false; | ||
} | ||
|
||
getLayoutContentStyle(): string { | ||
if (environment.disableBackend) { | ||
return "height: 100%;"; | ||
} | ||
return ""; | ||
} | ||
Comment on lines
+74
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto: could use a CSS class here instead. |
||
|
||
hideAside() { | ||
switch (this.mode) { | ||
case LayoutMode.FILTER_ONLY: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this is a
try
/catch
instead of aif (disableBackend)
?