diff --git a/src/domain/navigation/index.js b/src/domain/navigation/index.js index 1e4a5941..677319a1 100644 --- a/src/domain/navigation/index.js +++ b/src/domain/navigation/index.js @@ -37,8 +37,8 @@ function allowsChild(parent, child) { // downside of the approach: both of these will control which tile is selected return type === "room" || type === "empty-grid-tile"; case "room": - return type === "lightbox" || type === "rightpanel"; - case "rightpanel": + return type === "lightbox" || type === "right-panel"; + case "right-panel": return type === "details"|| type === "members"; default: return false; @@ -116,7 +116,7 @@ export function parseUrlPath(urlPath, currentNavPath, defaultSessionId) { } segments.push(new Segment("room", roomId)); if (currentNavPath.get("details")?.value) { - segments.push(new Segment("rightpanel")); + segments.push(new Segment("right-panel")); segments.push(new Segment("details")); } } else if (type === "last-session") { @@ -128,11 +128,11 @@ export function parseUrlPath(urlPath, currentNavPath, defaultSessionId) { segments.push(sessionSegment); } } else if (type === "details") { - segments.push(new Segment("rightpanel")); + segments.push(new Segment("right-panel")); segments.push(new Segment("details")); } else if (type === "members") { //TODO: Fix duplication here. - segments.push(new Segment("rightpanel")); + segments.push(new Segment("right-panel")); segments.push(new Segment("members")); } else { // might be undefined, which will be turned into true by Segment @@ -162,7 +162,7 @@ export function stringifyPath(path) { urlPath += `/${segment.type}/${segment.value}`; } break; - case "rightpanel": + case "right-panel": continue; default: urlPath += `/${segment.type}`; @@ -197,13 +197,13 @@ export function tests() { const urlPath = stringifyPath(path); assert.equal(urlPath, "/session/1/rooms/a,b,c/1"); }, - "stringify url with rightpanel and details segment": assert => { + "stringify url with right-panel and details segment": assert => { const nav = new Navigation(allowsChild); const path = nav.pathFrom([ new Segment("session", 1), new Segment("rooms", ["a", "b", "c"]), new Segment("room", "b"), - new Segment("rightpanel"), + new Segment("right-panel"), new Segment("details") ]); const urlPath = stringifyPath(path); @@ -287,7 +287,7 @@ export function tests() { new Segment("session", 1), new Segment("rooms", ["a", "b", "c"]), new Segment("room", "b"), - new Segment("rightpanel", true), + new Segment("right-panel", true), new Segment("details", true) ]); const segments = parseUrlPath("/session/1/open-room/a", path); @@ -298,7 +298,7 @@ export function tests() { assert.deepEqual(segments[1].value, ["a", "b", "c"]); assert.equal(segments[2].type, "room"); assert.equal(segments[2].value, "a"); - assert.equal(segments[3].type, "rightpanel"); + assert.equal(segments[3].type, "right-panel"); assert.equal(segments[3].value, true); assert.equal(segments[4].type, "details"); assert.equal(segments[4].value, true); diff --git a/src/domain/session/RoomGridViewModel.js b/src/domain/session/RoomGridViewModel.js index c0aa5a52..e0f78b29 100644 --- a/src/domain/session/RoomGridViewModel.js +++ b/src/domain/session/RoomGridViewModel.js @@ -83,7 +83,7 @@ export class RoomGridViewModel extends ViewModel { let path = this.navigation.path.until("rooms"); path = path.with(this.navigation.segment("room", roomId)); if (detailsShown) { - path = path.with(this.navigation.segment("rightpanel", true)); + path = path.with(this.navigation.segment("right-panel", true)); path = path.with(this.navigation.segment("details", true)); } this.navigation.applyPath(path); diff --git a/src/domain/session/SessionViewModel.js b/src/domain/session/SessionViewModel.js index a66d66a0..83b7f1af 100644 --- a/src/domain/session/SessionViewModel.js +++ b/src/domain/session/SessionViewModel.js @@ -82,7 +82,7 @@ export class SessionViewModel extends ViewModel { this._updateLightbox(lightbox.get()); - const rightpanel = this.navigation.observe("rightpanel"); + const rightpanel = this.navigation.observe("right-panel"); this.track(rightpanel.subscribe(() => this._updateRightPanel())); this._updateRightPanel(); } @@ -260,7 +260,7 @@ export class SessionViewModel extends ViewModel { _updateRightPanel() { this._rightPanelViewModel = this.disposeTracked(this._rightPanelViewModel); - const enable = !!this.navigation.path.get("rightpanel")?.value; + const enable = !!this.navigation.path.get("right-panel")?.value; if (enable) { const room = this._roomFromNavigation(); this._rightPanelViewModel = this.track(new RightPanelViewModel(this.childOptions({room}))); diff --git a/src/domain/session/leftpanel/LeftPanelViewModel.js b/src/domain/session/leftpanel/LeftPanelViewModel.js index 45f1f02b..0fdfcf36 100644 --- a/src/domain/session/leftpanel/LeftPanelViewModel.js +++ b/src/domain/session/leftpanel/LeftPanelViewModel.js @@ -96,7 +96,7 @@ export class LeftPanelViewModel extends ViewModel { let _path = path; const details = this.navigation.path.get("details"); if (details?.value) { - _path = _path.with(this.navigation.segment("rightpanel")); + _path = _path.with(this.navigation.segment("right-panel")); _path = _path.with(details) } return _path; diff --git a/src/domain/session/room/RoomViewModel.js b/src/domain/session/room/RoomViewModel.js index 30dae699..3b04f83a 100644 --- a/src/domain/session/room/RoomViewModel.js +++ b/src/domain/session/room/RoomViewModel.js @@ -290,7 +290,7 @@ export class RoomViewModel extends ViewModel { openDetailsPanel() { let path = this.navigation.path.until("room"); - path = path.with(this.navigation.segment("rightpanel", true)); + path = path.with(this.navigation.segment("right-panel", true)); path = path.with(this.navigation.segment("details", true)); this.navigation.applyPath(path); }