diff --git a/src/app/netzgrafik-application/netzgrafik-application.component.ts b/src/app/netzgrafik-application/netzgrafik-application.component.ts index 9c65994d..4764d747 100644 --- a/src/app/netzgrafik-application/netzgrafik-application.component.ts +++ b/src/app/netzgrafik-application/netzgrafik-application.component.ts @@ -71,10 +71,7 @@ export class NetzgrafikApplicationComponent { } getVariantIsWritable(): boolean { - if (this.versionControlService.variant === null) { - return true; - } - return this.versionControlService.variant.isWritable; + return this.versionControlService.getVariantIsWritable(); } onVariantenClicked() { diff --git a/src/app/perlenkette/perlenkette-node/perlenkette-node.component.html b/src/app/perlenkette/perlenkette-node/perlenkette-node.component.html index ad5d5eaa..4cccdfe7 100644 --- a/src/app/perlenkette/perlenkette-node/perlenkette-node.component.html +++ b/src/app/perlenkette/perlenkette-node/perlenkette-node.component.html @@ -1,4 +1,6 @@ -
+
+
-
+
{{ 'app.view.editor-edit-tools-view-component.delete-all-visible-elements' | translate }} - + {{ 'app.view.editor-edit-tools-view-component.merge-netzgrafik-title' | translate }} diff --git a/src/app/view/editor-edit-tools-view-component/editor-edit-tools-view.component.ts b/src/app/view/editor-edit-tools-view-component/editor-edit-tools-view.component.ts index e1f2bbea..e640a999 100644 --- a/src/app/view/editor-edit-tools-view-component/editor-edit-tools-view.component.ts +++ b/src/app/view/editor-edit-tools-view-component/editor-edit-tools-view.component.ts @@ -16,6 +16,7 @@ import {LabelService} from "../../services/data/label.serivce"; import {LabelGroupService} from "../../services/data/labelgroup.service"; import {LabelGroup} from "../../models/labelGroup.model"; import {environment} from "../../../environments/environment"; +import {VersionControlService} from "../../services/data/version-control.service"; @Component({ selector: "sbb-editor-edit-tools-view-component", @@ -46,6 +47,7 @@ export class EditorEditToolsViewComponent implements OnDestroy { private logger: LogService, public filterService: FilterService, private uiInteractionService: UiInteractionService, + private versionControlService : VersionControlService ) { this.nodeLabelGroups = this.labelGroupService.getLabelGroupsFromLabelRef( LabelRef.Node, @@ -76,6 +78,10 @@ export class EditorEditToolsViewComponent implements OnDestroy { this.destroyed.complete(); } + getVariantIsWritable() { + return this.versionControlService.getVariantIsWritable(); + } + onClearAllFiltered() { const confirmationDialogParamter = new ConfirmationDialogParameter( $localize`:@@app.view.editor-edit-tools-view-component.delete:Delete`, diff --git a/src/app/view/editor-filter-view/editor-filter-view.component.html b/src/app/view/editor-filter-view/editor-filter-view.component.html index fbf38e94..5bb95bd0 100644 --- a/src/app/view/editor-filter-view/editor-filter-view.component.html +++ b/src/app/view/editor-filter-view/editor-filter-view.component.html @@ -198,107 +198,109 @@

{{ 'app.view.editor-filter-view.filter' | translate }}< - - - {{ 'app.view.editor-filter-view.saved-filters' | translate }} - -
- - - + + + + {{ 'app.view.editor-filter-view.saved-filters' | translate }} + +
+ + + - + + + + + + - - - - + + +
- -
- - -
-
+
+
+
diff --git a/src/app/view/editor-filter-view/editor-filter-view.component.ts b/src/app/view/editor-filter-view/editor-filter-view.component.ts index f71c1014..12cf52b1 100644 --- a/src/app/view/editor-filter-view/editor-filter-view.component.ts +++ b/src/app/view/editor-filter-view/editor-filter-view.component.ts @@ -13,6 +13,7 @@ import {FilterSetting} from "../../models/filterSettings.model"; import {takeUntil} from "rxjs/operators"; import {StaticDomTags} from "../editor-main-view/data-views/static.dom.tags"; import {environment} from "../../../environments/environment"; +import {VersionControlService} from "../../services/data/version-control.service"; @Component({ selector: "sbb-editor-filter-view", @@ -45,6 +46,7 @@ export class EditorFilterViewComponent implements OnInit, OnDestroy { public dataService: DataService, public uiInteractionService: UiInteractionService, public filterService: FilterService, + public versionControlService : VersionControlService, ) { this.activeFilterName = undefined; this.activeEditFilterSettingId = undefined; diff --git a/src/app/view/editor-main-view/data-views/d3.utils.spec.ts b/src/app/view/editor-main-view/data-views/d3.utils.spec.ts index 8305516d..35bf64b1 100644 --- a/src/app/view/editor-main-view/data-views/d3.utils.spec.ts +++ b/src/app/view/editor-main-view/data-views/d3.utils.spec.ts @@ -167,7 +167,8 @@ describe("3d.Utils.tests", () => { copyService, logService, viewportCullSerivce, - levelOfDetailService + levelOfDetailService, + undefined ); controller.bindViewToServices(); editorView = controller.editorView; diff --git a/src/app/view/editor-main-view/data-views/data.view.spec.ts b/src/app/view/editor-main-view/data-views/data.view.spec.ts index 4137a1e7..79ae5eaf 100644 --- a/src/app/view/editor-main-view/data-views/data.view.spec.ts +++ b/src/app/view/editor-main-view/data-views/data.view.spec.ts @@ -172,7 +172,8 @@ describe("Editor-DataView", () => { copyService, logService, viewportCullSerivce, - levelOfDetailService + levelOfDetailService, + undefined ); controller.bindViewToServices(); diff --git a/src/app/view/editor-main-view/data-views/editor.keyEvents.ts b/src/app/view/editor-main-view/data-views/editor.keyEvents.ts index f5ad4b65..0629dd36 100644 --- a/src/app/view/editor-main-view/data-views/editor.keyEvents.ts +++ b/src/app/view/editor-main-view/data-views/editor.keyEvents.ts @@ -193,16 +193,26 @@ export class EditorKeyEvents { } private onInsertAllVisibleElementsFromCopyCache(): boolean { + if ( !this.trainrunSectionPreviewLineView.getVariantIsWritable() ) { + return true; + } this.copyService.insertCopiedNetzgrafik(); return false; } private onRevertLastChange(): boolean { + if ( !this.trainrunSectionPreviewLineView.getVariantIsWritable() ) { + return true; + } this.undoService.undo(); return true; } private onDuplicate(): boolean { + if ( !this.trainrunSectionPreviewLineView.getVariantIsWritable() ) { + return true; + } + if (this.doDuplicateTrainrun()) { return true; } @@ -490,6 +500,10 @@ export class EditorKeyEvents { } private onKeyPressedInsert(): boolean { + if ( !this.trainrunSectionPreviewLineView.getVariantIsWritable() ) { + return true; + } + if (this.onDuplicate()) { return true; } @@ -573,6 +587,9 @@ export class EditorKeyEvents { } private onKeyPressedDelete(): boolean { + if ( !this.trainrunSectionPreviewLineView.getVariantIsWritable() ) { + return true; + } const selectedTrainrunSectionId = this.getSelectedTrainSectionId(); const connections = this.nodeSerivce.getAllSelectedConnections(); diff --git a/src/app/view/editor-main-view/data-views/editor.view.ts b/src/app/view/editor-main-view/data-views/editor.view.ts index 659cfb5c..12d2e7c3 100644 --- a/src/app/view/editor-main-view/data-views/editor.view.ts +++ b/src/app/view/editor-main-view/data-views/editor.view.ts @@ -33,6 +33,7 @@ import {CopyService} from "../../../services/data/copy.service"; import {StreckengrafikDrawingContext} from "../../../streckengrafik/model/util/streckengrafik.drawing.context"; import {LevelOfDetail, LevelOfDetailService} from "../../../services/ui/level.of.detail.service"; import {ViewportCullService} from "../../../services/ui/viewport.cull.service"; +import {VersionControlService} from "../../../services/data/version-control.service"; export class EditorView implements SVGMouseControllerObserver { static svgName = "graphContainer"; @@ -128,7 +129,8 @@ export class EditorView implements SVGMouseControllerObserver { private copyService: CopyService, private logService: LogService, private viewportCullService: ViewportCullService, - private levelOfDetailService: LevelOfDetailService + private levelOfDetailService: LevelOfDetailService, + private versionControlService : VersionControlService ) { this.controller = controller; this.svgMouseController = new SVGMouseController(EditorView.svgName, this); @@ -139,6 +141,7 @@ export class EditorView implements SVGMouseControllerObserver { this.trainrunSectionPreviewLineView = new TrainrunSectionPreviewLineView( nodeService, filterService, + versionControlService ); this.multiSelectRenderer = new MultiSelectRenderer(); this.notesView = new NotesView(this); diff --git a/src/app/view/editor-main-view/data-views/nodes.view.scss b/src/app/view/editor-main-view/data-views/nodes.view.scss index 7be45f8e..0dab3138 100644 --- a/src/app/view/editor-main-view/data-views/nodes.view.scss +++ b/src/app/view/editor-main-view/data-views/nodes.view.scss @@ -55,6 +55,14 @@ font-size: $BP_LABEL_FONT_SIZE; } +::ng-deep text.node_text.readonly { + cursor: default; +} + +::ng-deep rect.node_hover_drag_root_background.readonly { + cursor: default; +} + ::ng-deep text.node_text.hover { fill: $COLOR_Edit; } diff --git a/src/app/view/editor-main-view/data-views/nodes.view.spec.ts b/src/app/view/editor-main-view/data-views/nodes.view.spec.ts index 8675ad75..664456bb 100644 --- a/src/app/view/editor-main-view/data-views/nodes.view.spec.ts +++ b/src/app/view/editor-main-view/data-views/nodes.view.spec.ts @@ -167,6 +167,7 @@ describe("Nodes-View", () => { logService, viewportCullSerivce, levelOfDetailService, + undefined ); controller.bindViewToServices(); editorView = controller.editorView; diff --git a/src/app/view/editor-main-view/data-views/nodes.view.ts b/src/app/view/editor-main-view/data-views/nodes.view.ts index fbfea1f6..1f43766b 100644 --- a/src/app/view/editor-main-view/data-views/nodes.view.ts +++ b/src/app/view/editor-main-view/data-views/nodes.view.ts @@ -324,9 +324,10 @@ export class NodesView { } private makeHoverDragBackground(groupEnter: any) { - - groupEnter - .append(StaticDomTags.NODE_HOVER_DRAG_AREA_BACKGROUND_SVG) + const added= + groupEnter + .append(StaticDomTags.NODE_HOVER_DRAG_AREA_BACKGROUND_SVG); + added .attr("class", StaticDomTags.NODE_HOVER_DRAG_AREA_BACKGROUND_CLASS) .classed(StaticDomTags.TAG_SELECTED, (n: NodeViewObject) => n.node.selected(), @@ -340,7 +341,17 @@ export class NodesView { "y", (n: NodeViewObject) => n.node.getNodeHeight() - NODE_TEXT_AREA_HEIGHT, ) - .call(this.draggable) + .classed( + StaticDomTags.NODE_READONLY, + !this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable() + ); + + if ( this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable() ){ + added + .call(this.draggable); + } + + added .on("mouseover", (n: NodeViewObject, i, a) => this.onNodeMouseoverDragButton(n.node, a[i]), ) @@ -352,7 +363,9 @@ export class NodesView { } private makeHoverDragRoot(groupEnter: any) { - + if ( !this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable() ){ + return; + } groupEnter .append(StaticDomTags.NODE_HOVER_DRAG_AREA_SVG) .attr("class", StaticDomTags.NODE_HOVER_DRAG_AREA_CLASS) @@ -561,9 +574,9 @@ export class NodesView { } private makeLabelText(groupEnter: any) { - - groupEnter - .append(StaticDomTags.NODE_LABELAREA_TEXT_SVG) + const added = groupEnter + .append(StaticDomTags.NODE_LABELAREA_TEXT_SVG); + added .attr("class", StaticDomTags.NODE_LABELAREA_TEXT_CLASS) .attr(StaticDomTags.NODE_ID, (n: NodeViewObject) => n.node.getId()) .attr("x", NODE_TEXT_LEFT_SPACING) @@ -576,6 +589,16 @@ export class NodesView { StaticDomTags.NODE_HAS_CONNECTIONS, (n: NodeViewObject) => n.node.getConnections().length > 0, ) + .classed( + StaticDomTags.NODE_READONLY, + !this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable() + ); + + if ( !this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable() ){ + return; + } + + added .call(this.draggable) .on("mouseover", (n: NodeViewObject, i, a) => this.onNodeLabelAreaMouseover(n.node, a[i]), diff --git a/src/app/view/editor-main-view/data-views/notes.view.spec.ts b/src/app/view/editor-main-view/data-views/notes.view.spec.ts index 281e3f30..882e579e 100644 --- a/src/app/view/editor-main-view/data-views/notes.view.spec.ts +++ b/src/app/view/editor-main-view/data-views/notes.view.spec.ts @@ -166,7 +166,8 @@ describe("Notes-View", () => { copyService, logService, viewportCullSerivce, - levelOfDetailService + levelOfDetailService, + undefined ); controller.bindViewToServices(); editorView = controller.editorView; diff --git a/src/app/view/editor-main-view/data-views/notes.view.ts b/src/app/view/editor-main-view/data-views/notes.view.ts index 0cc47553..4e0dd6d5 100644 --- a/src/app/view/editor-main-view/data-views/notes.view.ts +++ b/src/app/view/editor-main-view/data-views/notes.view.ts @@ -227,9 +227,9 @@ export class NotesView { } private makeNoteHoverRoot(groupEnter: any) { - - groupEnter - .append(StaticDomTags.NOTE_HOVER_ROOT_SVG) + const added = groupEnter + .append(StaticDomTags.NOTE_HOVER_ROOT_SVG); + added .attr("class", StaticDomTags.NOTE_HOVER_ROOT_CLASS) .attr(StaticDomTags.NOTE_ID, (n: NoteViewObject) => n.note.getId()) .attr( @@ -241,7 +241,13 @@ export class NotesView { (n: NoteViewObject) => NotesView.extractTextBasedHeight(n.note) + 48, ) .attr("x", -24) - .attr("y", -24) + .attr("y", -24); + + if ( !this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable() ){ + return; + } + + added .call(this.draggable) .on("mouseout", (n: NoteViewObject) => this.onNoteMouseout(n.note, null)) .on("mouseover", (n: NoteViewObject, i, a) => @@ -377,8 +383,10 @@ export class NotesView { private makeNoteDragAreaBackground(groupEnter: any) { - groupEnter - .append(StaticDomTags.NOTE_HOVER_DRAG_AREA_BACKGROUND_SVG) + const added = groupEnter + .append(StaticDomTags.NOTE_HOVER_DRAG_AREA_BACKGROUND_SVG); + + added .attr("class", StaticDomTags.NOTE_HOVER_DRAG_AREA_BACKGROUND_CLASS) .classed(StaticDomTags.TAG_SELECTED, (n: NoteViewObject) => n.note.selected(), @@ -388,7 +396,13 @@ export class NotesView { .attr("width", 28) .attr("height", 28) .attr("x", 0) - .attr("y", 0) + .attr("y", 0); + + if ( !this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable() ){ + return; + } + + added .on("mouseout", (n: NoteViewObject) => this.onNoteMouseoutDragButton(n.note, null), ) @@ -399,7 +413,9 @@ export class NotesView { } private makeNoteDragArea(groupEnter: any) { - + if ( !this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable() ){ + return; + } groupEnter .append(StaticDomTags.NOTE_HOVER_DRAG_AREA_SVG) .attr("class", StaticDomTags.NOTE_HOVER_DRAG_AREA_CLASS) @@ -427,6 +443,11 @@ export class NotesView { } onNoteMousedown(note: Note) { + if ( !this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable() ){ + d3.event.stopPropagation(); + return; + } + if (this.editorView.editorMode === EditorMode.MultiNodeMoving) { const multiSelected = this.editorView.isNoteSelected(note.getId()); if (multiSelected) { @@ -439,6 +460,11 @@ export class NotesView { } onNoteMouseup(note: Note, domObj: any) { + if ( !this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable() ){ + d3.event.stopPropagation(); + return; + } + const rect: DOMRect = d3.select(domObj).node().getBoundingClientRect(); const clickPosition = new Vec2D( rect.x + rect.width / 2, diff --git a/src/app/view/editor-main-view/data-views/static.dom.tags.ts b/src/app/view/editor-main-view/data-views/static.dom.tags.ts index 35ea7546..c3e19c57 100644 --- a/src/app/view/editor-main-view/data-views/static.dom.tags.ts +++ b/src/app/view/editor-main-view/data-views/static.dom.tags.ts @@ -77,6 +77,7 @@ export class StaticDomTags { static NODE_TAG_REQ_FOR_DRAGGING = "req_for_dragging"; static NODE_TAG_JUNCTION_ONLY = "junction_only"; static NODE_HAS_CONNECTIONS = "has_connections"; + static NODE_READONLY = "readonly"; static NODE_HOVER_ROOT_SVG = "rect"; static NODE_HOVER_ROOT_CLASS = "node_hover_root"; diff --git a/src/app/view/editor-main-view/data-views/trainrunsection.previewline.view.ts b/src/app/view/editor-main-view/data-views/trainrunsection.previewline.view.ts index 4eaab377..d51f7353 100644 --- a/src/app/view/editor-main-view/data-views/trainrunsection.previewline.view.ts +++ b/src/app/view/editor-main-view/data-views/trainrunsection.previewline.view.ts @@ -8,6 +8,7 @@ import {Transition} from "../../../models/transition.model"; import {SimpleTrainrunSectionRouter} from "../../../services/util/trainrunsection.routing"; import {NodeService} from "../../../services/data/node.service"; import {FilterService} from "../../../services/ui/filter.service"; +import {VersionControlService} from "../../../services/data/version-control.service"; export enum PreviewLineMode { NotDragging, @@ -55,6 +56,7 @@ export class TrainrunSectionPreviewLineView { constructor( private nodeService: NodeService, private filterService: FilterService, + private versionControlService : VersionControlService ) {} static setGroup(nodeGroup: d3.Selector) { @@ -69,6 +71,13 @@ export class TrainrunSectionPreviewLineView { .attr("class", StaticDomTags.PREVIEW_CONNECTION_LINE_ROOT_CLASS); } + getVariantIsWritable() : boolean { + if ( !this.versionControlService?.getVariantIsWritable()){ + return false; + } + return true; + } + getMode(): PreviewLineMode { return this.mode; } @@ -93,6 +102,9 @@ export class TrainrunSectionPreviewLineView { dragIntermediateStopInfo: DragIntermediateStopInfo, startPosition: Vec2D, ) { + if ( !this.versionControlService?.getVariantIsWritable()){ + return; + } this.mode = PreviewLineMode.DragIntermediateStop; this.dragIntermediateStopInfo = dragIntermediateStopInfo; this.startIntermediatePos = startPosition; @@ -105,6 +117,9 @@ export class TrainrunSectionPreviewLineView { dragTransition: DragTransitionInfo, startPosition: Vec2D, ) { + if ( !this.versionControlService?.getVariantIsWritable()){ + return; + } this.filterService.switchOffTemporaryEmptyAndNonStopFiltering(); this.mode = PreviewLineMode.DragTransition; this.dragTransitionInfo = dragTransition; @@ -143,6 +158,9 @@ export class TrainrunSectionPreviewLineView { } startPreviewLine(nodeId: number) { + if ( !this.versionControlService?.getVariantIsWritable()){ + return; + } this.mode = PreviewLineMode.DragNewTrainrunSection; const mousePosition = d3.mouse( d3.select(StaticDomTags.PREVIEW_LINE_ROOT_DOM_REF).node(), @@ -153,6 +171,9 @@ export class TrainrunSectionPreviewLineView { } startPreviewLineAtPosition(startNode: Node, startPosition: Vec2D) { + if ( !this.versionControlService?.getVariantIsWritable()){ + return; + } this.mode = PreviewLineMode.DragExistingTrainrunSection; this.startNode = startNode; this.startPos = startPosition; diff --git a/src/app/view/editor-main-view/data-views/trainrunsections.view.spec.ts b/src/app/view/editor-main-view/data-views/trainrunsections.view.spec.ts index 7f6cd843..5c4befa2 100644 --- a/src/app/view/editor-main-view/data-views/trainrunsections.view.spec.ts +++ b/src/app/view/editor-main-view/data-views/trainrunsections.view.spec.ts @@ -171,7 +171,8 @@ describe("TrainrunSection-View", () => { copyService, logService, viewportCullSerivce, - levelOfDetailService + levelOfDetailService, + undefined ); controller.bindViewToServices(); diff --git a/src/app/view/editor-main-view/data-views/trainrunsections.view.ts b/src/app/view/editor-main-view/data-views/trainrunsections.view.ts index 99d9ddeb..0232ec33 100644 --- a/src/app/view/editor-main-view/data-views/trainrunsections.view.ts +++ b/src/app/view/editor-main-view/data-views/trainrunsections.view.ts @@ -1221,7 +1221,9 @@ export class TrainrunSectionsView { connectedTrainIds: any, atSource: boolean, ) { - + if (!this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable()){ + return; + } groupEnter .append(StaticDomTags.EDGE_LINE_PIN_SVG) .attr("class", StaticDomTags.EDGE_LINE_PIN_CLASS) diff --git a/src/app/view/editor-main-view/data-views/transitions.view.spec.ts b/src/app/view/editor-main-view/data-views/transitions.view.spec.ts index 302cfd11..9a168d30 100644 --- a/src/app/view/editor-main-view/data-views/transitions.view.spec.ts +++ b/src/app/view/editor-main-view/data-views/transitions.view.spec.ts @@ -167,7 +167,8 @@ describe("Transitions-View", () => { copyService, logService, viewportCullSerivce, - levelOfDetailService + levelOfDetailService, + undefined ); controller.bindViewToServices(); diff --git a/src/app/view/editor-main-view/data-views/transitions.view.ts b/src/app/view/editor-main-view/data-views/transitions.view.ts index 8a6f166a..4788acc6 100644 --- a/src/app/view/editor-main-view/data-views/transitions.view.ts +++ b/src/app/view/editor-main-view/data-views/transitions.view.ts @@ -151,6 +151,9 @@ export class TransitionsView { selectedTrainrun: Trainrun, connectedTrainIds: any, ) { + if (!this.editorView.trainrunSectionPreviewLineView.getVariantIsWritable()){ + return; + } grpEnter .append(StaticDomTags.TRANSITION_BUTTON_SVG) .attr( diff --git a/src/app/view/editor-main-view/editor-main-view.component.ts b/src/app/view/editor-main-view/editor-main-view.component.ts index 365192af..1e3caa73 100644 --- a/src/app/view/editor-main-view/editor-main-view.component.ts +++ b/src/app/view/editor-main-view/editor-main-view.component.ts @@ -91,7 +91,8 @@ export class EditorMainViewComponent implements AfterViewInit, OnDestroy { copyService, logService, viewportCullSerivce, - levelOfDetailService + levelOfDetailService, + versionControlService ); this.uiInteractionService.zoomInObservable .pipe(takeUntil(this.destroyed)) diff --git a/src/app/view/editor-menu/editor-menu.component.html b/src/app/view/editor-menu/editor-menu.component.html index dfed58c5..7ca57c1b 100644 --- a/src/app/view/editor-menu/editor-menu.component.html +++ b/src/app/view/editor-menu/editor-menu.component.html @@ -142,7 +142,8 @@ [class.isStreckengrafikEditing]=" isStreckengrafikEditing() || isAnalytics() " - [disabled]="isStreckengrafikEditing() || isAnalytics()" + [class.readonly]="isStreckengrafikEditing() || isAnalytics() || !getVariantIsWritable()" + [disabled]="isStreckengrafikEditing() || isAnalytics() || !getVariantIsWritable()" (click)="onTopologieEditor()" [title]="'app.view.editor-menu.topology-editor-disabled' | translate" > @@ -242,7 +243,8 @@ [class.isStreckengrafikEditing]=" isStreckengrafikEditing() || isAnalytics() " - [disabled]="isStreckengrafikEditing() || isAnalytics()" + [class.readonly]="!getVariantIsWritable()" + [disabled]="isStreckengrafikEditing() || isAnalytics() || !getVariantIsWritable()" (click)="onNoteEditor()" [title]="'app.view.editor-menu.note-editor-disabled' | translate" > diff --git a/src/app/view/editor-menu/editor-menu.component.scss b/src/app/view/editor-menu/editor-menu.component.scss index a7d5436e..646e5197 100644 --- a/src/app/view/editor-menu/editor-menu.component.scss +++ b/src/app/view/editor-menu/editor-menu.component.scss @@ -87,52 +87,6 @@ $COLOR_TOPO_EDITOR_ACTIVE: #eb0000; } } -.ButtonSave { - width: $EDITOR_MENU_BUTTON_SIZE; - height: $INSIDE_OBJECT_HEIGHT; - min-width: $EDITOR_MENU_BUTTON_SIZE; - max-width: $EDITOR_MENU_BUTTON_SIZE; - text-align: center; - font-size: 25px; - padding: 8px 0 0 0; - margin: 0; - outline: none; - border: none; -} - -.ButtonSave:hover { - border-bottom: 3px solid var(--sbb-primary-alternative-button-background-color-hover); -} - -.ButtonSave:active { - border-bottom: 3px solid var(--sbb-primary-alternative-button-background-color-default); -} - -.ButtonLoad > input { - display: none; -} - -.ButtonLoad { - width: $EDITOR_MENU_BUTTON_SIZE; - height: $INSIDE_OBJECT_HEIGHT; - min-width: $EDITOR_MENU_BUTTON_SIZE; - max-width: $EDITOR_MENU_BUTTON_SIZE; - text-align: center; - font-size: 25px; - padding: 8px 0 0 0; - margin: 0; - outline: none; - border: none; -} - -.ButtonLoad:hover { - border-bottom: 3px solid var(--sbb-primary-alternative-button-background-color-hover); -} - -.ButtonLoad:active { - border-bottom: 3px solid var(--sbb-primary-alternative-button-background-color-default); -} - .ButtonFilter { width: $EDITOR_MENU_BUTTON_SIZE; height: $INSIDE_OBJECT_HEIGHT; @@ -254,6 +208,7 @@ $COLOR_TOPO_EDITOR_ACTIVE: #eb0000; } .ButtonTopologieEditor.TopologyEditing { + border-bottom: 3px solid $COLOR_TOPO_EDITOR_ACTIVE; color: $COLOR_TOPO_EDITOR_ACTIVE; } @@ -294,6 +249,7 @@ $COLOR_TOPO_EDITOR_ACTIVE: #eb0000; } .ButtonNoteEditor.NoteEditing { + border-bottom: 3px solid $COLOR_TOPO_EDITOR_ACTIVE; color: $COLOR_TOPO_EDITOR_ACTIVE; } @@ -344,6 +300,7 @@ $COLOR_TOPO_EDITOR_ACTIVE: #eb0000; } .ButtonStreckengrafikEditor.StreckengrafikEditing { + border-bottom: 3px solid $COLOR_TOPO_EDITOR_ACTIVE; color: $COLOR_TOPO_EDITOR_ACTIVE; } @@ -394,7 +351,7 @@ $COLOR_TOPO_EDITOR_ACTIVE: #eb0000; } .ButtonMultiNodeMoving.MultiNodeMoving { - border-bottom: 3px solid var(--sbb-primary-alternative-button-background-color-default); + border-bottom: 3px solid $COLOR_TOPO_EDITOR_ACTIVE; color: $COLOR_TOPO_EDITOR_ACTIVE; } @@ -411,10 +368,6 @@ path.ButtonMultiNodeMoving { fill: currentColor; } -path.ButtonMultiNodeMoving.disabled { -} - - .ButtonAnalytics { width: $EDITOR_MENU_BUTTON_SIZE; height: $INSIDE_OBJECT_HEIGHT; @@ -442,6 +395,7 @@ path.ButtonMultiNodeMoving.disabled { } .ButtonAnalytics.ButtonAnalyticsActive { + border-bottom: 3px solid $COLOR_TOPO_EDITOR_ACTIVE; color: $COLOR_TOPO_EDITOR_ACTIVE; } @@ -510,3 +464,54 @@ div.LabelNetzgrafik{ div.NodeZoomValue{ background: var(--sbb-header-lean-background-color); } + +button.ButtonTopologieEditor.readonly { + fill-opacity: 0.35; +} + +button.ButtonNoteEditor.readonly { + fill-opacity: 0.35; +} + +button.ButtonTopologieEditor.readonly:hover { + border-bottom: 0 solid var(--sbb-header-lean-background-color); +} + +button.ButtonNoteEditor.readonly:hover { + border-bottom: 0 solid var(--sbb-header-lean-background-color); +} + +.ButtonTopologieEditor.NetzgrafikEditing.isStreckengrafikEditing.readonly { + border-bottom: 0 solid var(--sbb-header-lean-background-color); +} + +.ButtonStreckengrafikEditor.NetzgrafikEditing.isNotStreckengrafikAllowed:hover { + border-bottom: 0 solid var(--sbb-header-lean-background-color); +} + +.ButtonMultiNodeMoving.NetzgrafikEditing.isStreckengrafikEditing { + fill-opacity: 0.35; + border-bottom: 0 solid var(--sbb-header-lean-background-color); +} + +.ButtonNoteEditor.NetzgrafikEditing.isStreckengrafikEditing { + fill-opacity: 0.35; + border-bottom: 0 solid var(--sbb-header-lean-background-color); +} + +.ButtonMultiNodeMoving.NetzgrafikEditing.isStreckengrafikEditing:hover { + border-bottom: 0 solid var(--sbb-header-lean-background-color); +} + +.ButtonNoteEditor.NetzgrafikEditing.isStreckengrafikEditing:hover { + border-bottom: 0 solid var(--sbb-header-lean-background-color); +} + +.ButtonAnalytics.isStreckengrafikEditing { + fill-opacity: 0.35; + border-bottom: 0 solid var(--sbb-header-lean-background-color); +} + +.ButtonAnalytics.isStreckengrafikEditing:hover { + border-bottom: 0 solid var(--sbb-header-lean-background-color); +} diff --git a/src/app/view/editor-menu/editor-menu.component.ts b/src/app/view/editor-menu/editor-menu.component.ts index 497ac174..c5532ebe 100644 --- a/src/app/view/editor-menu/editor-menu.component.ts +++ b/src/app/view/editor-menu/editor-menu.component.ts @@ -100,6 +100,10 @@ export class EditorMenuComponent implements OnInit, OnDestroy { this.destroyed.complete(); } + getVariantIsWritable() : boolean { + return this.versionControlService.getVariantIsWritable(); + } + onZoomIn() { if ( this.uiInteractionService.getEditorMode() === diff --git a/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.html b/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.html index 3cc0681f..d90ce735 100644 --- a/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.html +++ b/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.html @@ -6,21 +6,30 @@

{{ 'app.view.editor-side-view.editor-node-detail-view.base-data' | translate }} - + - + - +
- + {{ 'app.view.editor-side-view.editor-node-detail-view.filterable-labels' | translate }} - + - +
{{ 'app.view.editor-side-view.editor-node-detail-view.ipv' | translate }} @@ -300,12 +317,14 @@

- + + + diff --git a/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.scss b/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.scss index 2e851d09..95497863 100644 --- a/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.scss +++ b/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.scss @@ -61,3 +61,13 @@ } } } + +sbb-form-field.readonly { + pointer-events: none; + cursor: default; +} + +table.NodeDataTable.readonly { + pointer-events: none; + cursor: default; +} diff --git a/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.ts b/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.ts index ea68518e..1ac22d36 100644 --- a/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.ts +++ b/src/app/view/editor-side-view/editor-node-detail-view/editor-node-detail-view.component.ts @@ -23,6 +23,7 @@ import {LabelGroupService} from "../../../services/data/labelgroup.service"; import {SbbChipEvent, SbbChipInputEvent} from "@sbb-esta/angular/chips"; import {COMMA, ENTER} from "@angular/cdk/keycodes"; import {environment} from "../../../../environments/environment"; +import {VersionControlService} from "../../../services/data/version-control.service"; interface NodeProperties { nodeId: number; @@ -71,6 +72,7 @@ export class EditorNodeDetailViewComponent implements OnInit, OnDestroy { private nodeService: NodeService, private labelService: LabelService, private labelGroupService: LabelGroupService, + public versionControlService : VersionControlService, private cd: ChangeDetectorRef, ) {} diff --git a/src/app/view/editor-tools-view-component/editor-tools-view.component.html b/src/app/view/editor-tools-view-component/editor-tools-view.component.html index 2b9fd681..fde30347 100644 --- a/src/app/view/editor-tools-view-component/editor-tools-view.component.html +++ b/src/app/view/editor-tools-view-component/editor-tools-view.component.html @@ -40,22 +40,25 @@

{{ 'app.view.editor-side-view.editor-tools-view-compone {{ 'app.view.editor-side-view.editor-tools-view-component.export-netzgrafik-as-json' | translate }} -
- - - {{ 'app.view.editor-side-view.editor-tools-view-component.import-netzgrafik-as-json' | translate }} + +
+ + + {{ 'app.view.editor-side-view.editor-tools-view-component.import-netzgrafik-as-json' | translate }} +
+
- {{ 'app.view.editor-side-view.editor-tools-view-component.import-base-data' | translate }} - {{ 'app.view.editor-side-view.editor-tools-view-component.help-csv-data' | translate }} - -
+ + + {{ 'app.view.editor-side-view.editor-tools-view-component.import-base-data' | translate }} + {{ 'app.view.editor-side-view.editor-tools-view-component.help-csv-data' | translate }} + +
+
diff --git a/src/app/view/variant/variants-view/variants-view.component.ts b/src/app/view/variant/variants-view/variants-view.component.ts index a744f1c5..9218b15a 100644 --- a/src/app/view/variant/variants-view/variants-view.component.ts +++ b/src/app/view/variant/variants-view/variants-view.component.ts @@ -166,6 +166,10 @@ export class VariantsViewComponent implements OnDestroy { } getVariantDataActions(variant: VariantSummaryDto): Observable { + if (this.project.isArchived) { + return undefined; + } + if (variant.isArchived) { return of([ { diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index d0d4de3e..0831f58c 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -272,7 +272,7 @@ }, "editor-edit-tools-view-component": { "edit": "Bearbeiten", - "filterable-labels": "Filterbare labels", + "filterable-labels": "Filterbare Labels", "trainruns": "Zugfahrten", "nodes": "Knoten", "notes": "Kommentare", @@ -443,7 +443,7 @@ "import-netzgrafik": "Netzgrafik importieren", "import-netzgrafik-as-json": "Netzgrafik aus JSON importieren", "export-trainruns": "Zugfahrten exportieren", - "export-trainruns-as-csv": "Netzgrafik aus JSON importieren", + "export-trainruns-as-csv": "Zugfahrten als CSV exportieren", "export-trainruns-as-csv-excel": "In Excel: Daten -> Aus Text/CSV -> Filename ... importieren", "base-data": "Stammdaten", "import-base-data": "Stammdaten importieren", @@ -590,7 +590,6 @@ "archived": "(archiviert)", "edit-variant": "Variante bearbeiten", "delete-variant": { - "_value": "Variante löschen", "title": "Variante löschen", "content": "Möchten Sie die Variante und alle enthaltenen Versionen endgültig löschen? Diese Aktion kann nicht rückgängig gemacht werden." }, @@ -604,13 +603,11 @@ "project-description": "Projekt Beschreibung", "edit-project": "Projekt bearbeiten", "archive-project": { - "_value": "Projekt archivieren", "title": "Projekt archivieren", "content": "Möchten Sie das Projekt jetzt archivieren?" }, "undo-archiving": "Archivierung rückgängig machen", "delete-project": { - "_value": "Projekt löschen", "title": "Projekt löschen", "content": "Möchten Sie das Projekt und alle enthaltenen Varianten endgültig löschen? Diese Aktion kann nicht rückgängig gemacht werden." }, diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 98ac66ce..04cbf5dc 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -590,7 +590,6 @@ "archived": "(archived)", "edit-variant": "Edit variant", "delete-variant": { - "_value": "Delete variant", "title": "Delete variant", "content": "Do you want to permanently delete the variant and all versions it contains? This action cannot be undone." }, @@ -604,13 +603,11 @@ "project-description": "Project description", "edit-project": "Edit project", "archive-project": { - "_value": "Archive project", "title": "Archive project", "content": "Would you like to archive the project now?" }, "undo-archiving": "Undo archiving", "delete-project": { - "_value": "Delete project", "title": "Delete projekt", "content": "Do you want to permanently delete the project and all the variants it contains? This action cannot be undone." }, diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 98ac66ce..04cbf5dc 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -590,7 +590,6 @@ "archived": "(archived)", "edit-variant": "Edit variant", "delete-variant": { - "_value": "Delete variant", "title": "Delete variant", "content": "Do you want to permanently delete the variant and all versions it contains? This action cannot be undone." }, @@ -604,13 +603,11 @@ "project-description": "Project description", "edit-project": "Edit project", "archive-project": { - "_value": "Archive project", "title": "Archive project", "content": "Would you like to archive the project now?" }, "undo-archiving": "Undo archiving", "delete-project": { - "_value": "Delete project", "title": "Delete projekt", "content": "Do you want to permanently delete the project and all the variants it contains? This action cannot be undone." }, diff --git a/src/assets/i18n/it.json b/src/assets/i18n/it.json index 98ac66ce..04cbf5dc 100644 --- a/src/assets/i18n/it.json +++ b/src/assets/i18n/it.json @@ -590,7 +590,6 @@ "archived": "(archived)", "edit-variant": "Edit variant", "delete-variant": { - "_value": "Delete variant", "title": "Delete variant", "content": "Do you want to permanently delete the variant and all versions it contains? This action cannot be undone." }, @@ -604,13 +603,11 @@ "project-description": "Project description", "edit-project": "Edit project", "archive-project": { - "_value": "Archive project", "title": "Archive project", "content": "Would you like to archive the project now?" }, "undo-archiving": "Undo archiving", "delete-project": { - "_value": "Delete project", "title": "Delete projekt", "content": "Do you want to permanently delete the project and all the variants it contains? This action cannot be undone." },