From b2be851d031f8ccbe6ac7112d346b17e0a934468 Mon Sep 17 00:00:00 2001 From: mofogasy Date: Thu, 8 Aug 2019 15:20:02 +0200 Subject: [PATCH] fix: support mac command key when opening view in new view tab fixes: #155 --- .../src/app/testing/testing-routing.module.ts | 2 + .../src/app/testing/testing.module.ts | 2 + .../view-b8bbbb11.component.html | 1 + .../view-b8bbbb11/view-b8bbbb11.component.ts | 22 ++++++++ .../testing-app/src/assets/manifest.json | 14 +++++ .../src/app/app-routing.module.ts | 2 + .../workbench-app/src/app/app.module.ts | 2 + .../view-bb9700a6.component.html | 1 + .../view-bb9700a6/view-bb9700a6.component.ts | 25 +++++++++ .../page-object/testcase-b8bbbb11-view.po.ts | 29 ++++++++++ .../src/router-link.e2e-spec.ts | 53 +++++++++++++++++++ .../src/util/testing.util.ts | 10 ++++ .../page-object/testcase-bb9700a6-view.po.ts | 26 +++++++++ .../e2e/workbench/src/router-link.e2e-spec.ts | 52 ++++++++++++++++++ .../e2e/workbench/src/util/testing.util.ts | 10 ++++ .../lib/workbench-router-link.directive.ts | 12 ++--- .../lib/routing/wb-router-link.directive.ts | 12 ++--- .../how-to-navigate-to-a-view.md | 4 +- .../how-to/workbench/how-to-open-a-view.md | 4 +- 19 files changed, 267 insertions(+), 16 deletions(-) create mode 100644 projects/app/workbench-application-platform/testing-app/src/app/testing/view-b8bbbb11/view-b8bbbb11.component.html create mode 100644 projects/app/workbench-application-platform/testing-app/src/app/testing/view-b8bbbb11/view-b8bbbb11.component.ts create mode 100644 projects/app/workbench/workbench-app/src/app/view-bb9700a6/view-bb9700a6.component.html create mode 100644 projects/app/workbench/workbench-app/src/app/view-bb9700a6/view-bb9700a6.component.ts create mode 100644 projects/e2e/workbench-application-platform/src/page-object/testcase-b8bbbb11-view.po.ts create mode 100644 projects/e2e/workbench-application-platform/src/router-link.e2e-spec.ts create mode 100644 projects/e2e/workbench/src/page-object/testcase-bb9700a6-view.po.ts create mode 100644 projects/e2e/workbench/src/router-link.e2e-spec.ts diff --git a/projects/app/workbench-application-platform/testing-app/src/app/testing/testing-routing.module.ts b/projects/app/workbench-application-platform/testing-app/src/app/testing/testing-routing.module.ts index cab6f8d14..996ab0c70 100644 --- a/projects/app/workbench-application-platform/testing-app/src/app/testing/testing-routing.module.ts +++ b/projects/app/workbench-application-platform/testing-app/src/app/testing/testing-routing.module.ts @@ -45,6 +45,7 @@ import { Activity6d806beaComponent } from './activity-6d806bea/activity-6d806bea import { Activity5782ab19Component } from './activity-5782ab19/activity-5782ab19.component'; import { ViewC91805e8Component } from './view-c91805e8/view-c91805e8.component'; import { ViewCba33eafComponent } from './view-cba33eaf/view-cba33eaf.component'; +import { ViewB8bbbb11Component } from './view-b8bbbb11/view-b8bbbb11.component'; const routes: Routes = [ {path: 'view', component: TestingViewComponent}, @@ -69,6 +70,7 @@ const routes: Routes = [ {path: 'view-be587bd6', component: ViewBe587bd6Component}, {path: 'view-c91805e8', component: ViewC91805e8Component}, {path: 'view-cba33eaf', component: ViewCba33eafComponent}, + {path: 'view-b8bbbb11', component: ViewB8bbbb11Component}, {path: 'popup-1a90c8d2', component: Popup1a90c8d2Component}, {path: 'popup-7330f506', component: Popup7330f506Component}, {path: 'popup-9c5319f7', component: Popup9c5319f7Component}, diff --git a/projects/app/workbench-application-platform/testing-app/src/app/testing/testing.module.ts b/projects/app/workbench-application-platform/testing-app/src/app/testing/testing.module.ts index 52f6dc623..57951b113 100644 --- a/projects/app/workbench-application-platform/testing-app/src/app/testing/testing.module.ts +++ b/projects/app/workbench-application-platform/testing-app/src/app/testing/testing.module.ts @@ -61,6 +61,7 @@ import { ViewC91805e8Component } from './view-c91805e8/view-c91805e8.component'; import { PingIntentPanelComponent } from './ping-intent/ping-intent-panel.component'; import { ViewCba33eafComponent } from './view-cba33eaf/view-cba33eaf.component'; import { ViewC985a55bComponent } from './view-c985a55b/view-c985a55b.component'; +import { ViewB8bbbb11Component } from './view-b8bbbb11/view-b8bbbb11.component'; @NgModule({ declarations: [ @@ -98,6 +99,7 @@ import { ViewC985a55bComponent } from './view-c985a55b/view-c985a55b.component'; ViewC91805e8Component, ViewCba33eafComponent, ViewC985a55bComponent, + ViewB8bbbb11Component, Popup1a90c8d2Component, Popup7330f506Component, Popup9c5319f7Component, diff --git a/projects/app/workbench-application-platform/testing-app/src/app/testing/view-b8bbbb11/view-b8bbbb11.component.html b/projects/app/workbench-application-platform/testing-app/src/app/testing/view-b8bbbb11/view-b8bbbb11.component.html new file mode 100644 index 000000000..fc961553c --- /dev/null +++ b/projects/app/workbench-application-platform/testing-app/src/app/testing/view-b8bbbb11/view-b8bbbb11.component.html @@ -0,0 +1 @@ +Testing View diff --git a/projects/app/workbench-application-platform/testing-app/src/app/testing/view-b8bbbb11/view-b8bbbb11.component.ts b/projects/app/workbench-application-platform/testing-app/src/app/testing/view-b8bbbb11/view-b8bbbb11.component.ts new file mode 100644 index 000000000..f51e38f09 --- /dev/null +++ b/projects/app/workbench-application-platform/testing-app/src/app/testing/view-b8bbbb11/view-b8bbbb11.component.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2018-2019 Swiss Federal Railways + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ + +import { Component } from '@angular/core'; +import { provideWorkbenchView } from '@scion/workbench-application.angular'; + +@Component({ + selector: 'app-view-b8bbbb11', + templateUrl: 'view-b8bbbb11.component.html', + providers: [ + provideWorkbenchView(ViewB8bbbb11Component), + ], +}) +export class ViewB8bbbb11Component { +} diff --git a/projects/app/workbench-application-platform/testing-app/src/assets/manifest.json b/projects/app/workbench-application-platform/testing-app/src/assets/manifest.json index d5a8c929f..c04fa611c 100644 --- a/projects/app/workbench-application-platform/testing-app/src/assets/manifest.json +++ b/projects/app/workbench-application-platform/testing-app/src/assets/manifest.json @@ -421,6 +421,20 @@ "cssClass": "e2e-view-cba33eaf" } }, + { + "type": "view", + "qualifier": { + "entity": "testing", + "testcase": "b8bbbb11-view" + }, + "description": "Provides a view for testcase 'b8bbbb11'", + "properties": { + "path": "testing/view-b8bbbb11", + "title": "e2e-view-b8bbbb11", + "heading": "b8bbbb11", + "cssClass": "e2e-view-b8bbbb11" + } + }, { "type": "popup", "qualifier": { diff --git a/projects/app/workbench/workbench-app/src/app/app-routing.module.ts b/projects/app/workbench/workbench-app/src/app/app-routing.module.ts index 53aef9973..a5db5a74f 100644 --- a/projects/app/workbench/workbench-app/src/app/app-routing.module.ts +++ b/projects/app/workbench/workbench-app/src/app/app-routing.module.ts @@ -6,6 +6,7 @@ import { WelcomePageComponent } from './welcome-page/welcome-page.component'; import { ViewComponent } from './view/view.component'; import { View4a3a8932Component } from './view-4a3a8932/view-4a3a8932.component'; import { ViewNavigationComponent } from './view-navigation/view-navigation.component'; +import { ViewBb9700a6Component } from './view-bb9700a6/view-bb9700a6.component'; const routes: Routes = [ {path: '', component: WelcomePageComponent}, @@ -14,6 +15,7 @@ const routes: Routes = [ {path: 'activity-1a90c8d31-2', component: Activity1a90c8d32Component}, {path: 'view', component: ViewComponent}, {path: 'view-4a3a8932', component: View4a3a8932Component}, + {path: 'view-bb9700a6', component: ViewBb9700a6Component}, {path: 'view-navigation', component: ViewNavigationComponent}, ]; diff --git a/projects/app/workbench/workbench-app/src/app/app.module.ts b/projects/app/workbench/workbench-app/src/app/app.module.ts index e4e86e31e..aab910e04 100644 --- a/projects/app/workbench/workbench-app/src/app/app.module.ts +++ b/projects/app/workbench/workbench-app/src/app/app.module.ts @@ -13,6 +13,7 @@ import { View4a3a8932Component } from './view-4a3a8932/view-4a3a8932.component'; import { ViewNavigationComponent } from './view-navigation/view-navigation.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { SciParamsEnterModule, SciPropertyModule } from '@scion/app/common'; +import { ViewBb9700a6Component } from './view-bb9700a6/view-bb9700a6.component'; @NgModule({ declarations: [ @@ -22,6 +23,7 @@ import { SciParamsEnterModule, SciPropertyModule } from '@scion/app/common'; WelcomePageComponent, ViewComponent, View4a3a8932Component, + ViewBb9700a6Component, ViewNavigationComponent, ], imports: [ diff --git a/projects/app/workbench/workbench-app/src/app/view-bb9700a6/view-bb9700a6.component.html b/projects/app/workbench/workbench-app/src/app/view-bb9700a6/view-bb9700a6.component.html new file mode 100644 index 000000000..c48487039 --- /dev/null +++ b/projects/app/workbench/workbench-app/src/app/view-bb9700a6/view-bb9700a6.component.html @@ -0,0 +1 @@ +View diff --git a/projects/app/workbench/workbench-app/src/app/view-bb9700a6/view-bb9700a6.component.ts b/projects/app/workbench/workbench-app/src/app/view-bb9700a6/view-bb9700a6.component.ts new file mode 100644 index 000000000..6dc862f32 --- /dev/null +++ b/projects/app/workbench/workbench-app/src/app/view-bb9700a6/view-bb9700a6.component.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2018-2019 Swiss Federal Railways + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ + +import { Component } from '@angular/core'; +import { WorkbenchView } from '@scion/workbench'; + +@Component({ + selector: 'app-view-bb9700a6', + templateUrl: 'view-bb9700a6.component.html', +}) + +export class ViewBb9700a6Component { + + constructor(view: WorkbenchView) { + view.title = 'Testcase bb9700a6'; + view.cssClass = 'e2e-view-bb9700a6'; + } +} diff --git a/projects/e2e/workbench-application-platform/src/page-object/testcase-b8bbbb11-view.po.ts b/projects/e2e/workbench-application-platform/src/page-object/testcase-b8bbbb11-view.po.ts new file mode 100644 index 000000000..ebef913bf --- /dev/null +++ b/projects/e2e/workbench-application-platform/src/page-object/testcase-b8bbbb11-view.po.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018-2019 Swiss Federal Railways + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ + +import { clickElement, switchToIFrameContext } from '../util/testing.util'; +import { $ } from 'protractor'; + +const E2E_TESTING_VIEW_CONTEXT = ['e2e-testing-app', 'e2e-view', 'e2e-view-b8bbbb11']; + +export class TestcaseB8bbbb11ViewPO { + + private _linkFinder = $('a.e2e-testing-view-link'); + + public async clickLink(pressKey?: string): Promise { + await switchToIFrameContext(E2E_TESTING_VIEW_CONTEXT); + + if (pressKey) { + await clickElement(this._linkFinder, pressKey); + } else { + await this._linkFinder.click(); + } + } +} diff --git a/projects/e2e/workbench-application-platform/src/router-link.e2e-spec.ts b/projects/e2e/workbench-application-platform/src/router-link.e2e-spec.ts new file mode 100644 index 000000000..a5f6f0eab --- /dev/null +++ b/projects/e2e/workbench-application-platform/src/router-link.e2e-spec.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2019 Swiss Federal Railways + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ + +import { browser, Key } from 'protractor'; +import { TestcaseB8bbbb11ViewPO } from './page-object/testcase-b8bbbb11-view.po'; +import { TestingViewPO } from './page-object/testing-view.po'; +import { HostAppPO } from './page-object/host-app.po'; + +describe('RouterLink', () => { + + const hostAppPO = new HostAppPO(); + const testingViewPO = new TestingViewPO(); + const viewPO = new TestcaseB8bbbb11ViewPO(); + + beforeEach(async () => { + await browser.get('/'); + await testingViewPO.navigateTo(); + const viewNavigationPO = await testingViewPO.openViewNavigationPanel(); + await viewNavigationPO.enterQualifier({ + entity: 'testing', + testcase: 'b8bbbb11-view', + }); + await viewNavigationPO.selectTarget('self'); + await viewNavigationPO.execute(); + }); + + it('should open testing view in current view [testcase: b8bbbb11-view]', async () => { + await viewPO.clickLink(); + await expect(hostAppPO.getViewTabCount()).toBe(1); + }); + + it('should open testing view in new view tab when CTRL + click [testcase: b8bbbb11-view]', async () => { + await viewPO.clickLink(Key.CONTROL); + await expect(hostAppPO.getViewTabCount()).toBe(2); + }); + + it('should open testing view in new view tab when COMMAND + click [testcase: b8bbbb11-view]', async () => { + await viewPO.clickLink(Key.COMMAND); + await expect(hostAppPO.getViewTabCount()).toBe(2); + }); + + it('should open testing view in new view tab when META + click [testcase: b8bbbb11-view]', async () => { + await viewPO.clickLink(Key.META); + await expect(hostAppPO.getViewTabCount()).toBe(2); + }); +}); diff --git a/projects/e2e/workbench-application-platform/src/util/testing.util.ts b/projects/e2e/workbench-application-platform/src/util/testing.util.ts index 722785c2b..47fed54e5 100644 --- a/projects/e2e/workbench-application-platform/src/util/testing.util.ts +++ b/projects/e2e/workbench-application-platform/src/util/testing.util.ts @@ -153,3 +153,13 @@ export async function getCssClasses(elementFinder: ElementFinder): Promise { + await browser.actions().mouseMove(elementFinder).perform(); + + // It is important to release the pressed key by {@link #keyUp} in order to avoid side effects in other tests. + await browser.actions().keyDown(pressKey).click().keyUp(pressKey).perform(); +} diff --git a/projects/e2e/workbench/src/page-object/testcase-bb9700a6-view.po.ts b/projects/e2e/workbench/src/page-object/testcase-bb9700a6-view.po.ts new file mode 100644 index 000000000..54638e5ff --- /dev/null +++ b/projects/e2e/workbench/src/page-object/testcase-bb9700a6-view.po.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2018-2019 Swiss Federal Railways + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ + +import { $ } from 'protractor'; +import { clickElement } from '../util/testing.util'; + +export class TestcaseBb9700a6ViewPO { + + private _viewFinder = $('app-view-bb9700a6'); + private _linkFinder = this._viewFinder.$('a.e2e-view-link'); + + public async clickLink(pressKey?: string): Promise { + if (pressKey) { + await clickElement(this._linkFinder, pressKey); + } else { + await this._linkFinder.click(); + } + } +} diff --git a/projects/e2e/workbench/src/router-link.e2e-spec.ts b/projects/e2e/workbench/src/router-link.e2e-spec.ts new file mode 100644 index 000000000..2fe3939d0 --- /dev/null +++ b/projects/e2e/workbench/src/router-link.e2e-spec.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2019 Swiss Federal Railways + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ + +import { browser, Key } from 'protractor'; +import { TestcaseBb9700a6ViewPO } from './page-object/testcase-bb9700a6-view.po'; +import { AppPO } from './page-object/app.po'; +import { ViewNavigationPO } from './page-object/view-navigation.po'; + +describe('RouterLink', () => { + + const appPO = new AppPO(); + const viewNavigationPO = new ViewNavigationPO(); + const viewPO = new TestcaseBb9700a6ViewPO(); + + beforeEach(async () => { + await browser.get('/'); + await viewNavigationPO.navigateTo(); + + // open view-bb9700a6 + await viewNavigationPO.enterPath('view-bb9700a6'); + await viewNavigationPO.enterMatrixParams({viewCssClass: 'e2e-view-bb9700a6', viewTitle: 'view-bb9700a6'}); + await viewNavigationPO.selectTarget('self'); + await viewNavigationPO.navigate(); + }); + + it('should open the testing view in current view [testcase: bb9700a6-view]', async () => { + await viewPO.clickLink(); + await expect(appPO.getViewTabCount()).toBe(1); + }); + + it('should open the testing view in new view tab when CTRL + click [testcase: bb9700a6-view]', async () => { + await viewPO.clickLink(Key.CONTROL); + await expect(appPO.getViewTabCount()).toBe(2); + }); + + it('should open the testing view in new view tab when COMMAND + click [testcase: bb9700a6-view]', async () => { + await viewPO.clickLink(Key.COMMAND); + await expect(appPO.getViewTabCount()).toBe(2); + }); + + it('should open the testing view in new view tab when META + click [testcase: bb9700a6-view]', async () => { + await viewPO.clickLink(Key.META); + await expect(appPO.getViewTabCount()).toBe(2); + }); +}); diff --git a/projects/e2e/workbench/src/util/testing.util.ts b/projects/e2e/workbench/src/util/testing.util.ts index ae9dfc85b..7c8bdd0fc 100644 --- a/projects/e2e/workbench/src/util/testing.util.ts +++ b/projects/e2e/workbench/src/util/testing.util.ts @@ -90,3 +90,13 @@ export async function hasBrowserError(error: string): Promise { const logs = await this.browserErrors(); return logs.some(log => log.message.includes(error)); } + +/** + * Clicks the given element while pressing the specified key. + */ +export async function clickElement(elementFinder: ElementFinder, pressKey: string): Promise { + await browser.actions().mouseMove(elementFinder).perform(); + + // It is important to release the pressed key by {@link #keyUp} in order to avoid side effects in other tests. + await browser.actions().keyDown(pressKey).click().keyUp(pressKey).perform(); +} diff --git a/projects/scion/workbench-application.angular/src/lib/workbench-router-link.directive.ts b/projects/scion/workbench-application.angular/src/lib/workbench-router-link.directive.ts index 5a9d36f64..49a3dda0a 100644 --- a/projects/scion/workbench-application.angular/src/lib/workbench-router-link.directive.ts +++ b/projects/scion/workbench-application.angular/src/lib/workbench-router-link.directive.ts @@ -18,7 +18,7 @@ import { Qualifier } from '@scion/workbench-application.core'; * * This directive is like 'RouterLink' but with functionality to target a workbench view outlet. * - * If in the context of a view and CTRL key is not pressed, by default, navigation replaces the content of the current view. + * If in the context of a view and CTRL or META (Mac: ⌘, Windows: ⊞) key is not pressed, by default, navigation replaces the content of the current view. * Override this default behavior by setting a view target strategy in navigational extras. */ @Directive({selector: ':not(a)[wbRouterLink]'}) @@ -36,23 +36,23 @@ export class WorkbenchRouterLinkDirective { this._viewContext = !!view; } - @HostListener('click', ['$event.button', '$event.ctrlKey']) - public onClick(button: number, ctrlKey: boolean): boolean { + @HostListener('click', ['$event.button', '$event.ctrlKey', '$event.metaKey']) + public onClick(button: number, ctrlKey: boolean, metaKey: boolean): boolean { if (button !== 0) { // not main button pressed return true; } - const extras = this.createNavigationExtras(ctrlKey); + const extras = this.createNavigationExtras(ctrlKey, metaKey); this._workbenchRouter.navigate(this.qualifier, extras); return false; } - protected createNavigationExtras(ctrlKey: boolean = false): WbNavigationExtras { + protected createNavigationExtras(ctrlKey: boolean = false, metaKey: boolean = false): WbNavigationExtras { const extras = this.extras || {}; return { ...extras, - target: extras.target || (this._viewContext && !ctrlKey ? 'self' : 'blank'), + target: extras.target || (this._viewContext && !ctrlKey && !metaKey ? 'self' : 'blank'), }; } } diff --git a/projects/scion/workbench/src/lib/routing/wb-router-link.directive.ts b/projects/scion/workbench/src/lib/routing/wb-router-link.directive.ts index ac2c83c30..59de0b6bd 100644 --- a/projects/scion/workbench/src/lib/routing/wb-router-link.directive.ts +++ b/projects/scion/workbench/src/lib/routing/wb-router-link.directive.ts @@ -19,7 +19,7 @@ import { WorkbenchService } from '../workbench.service'; /** * Like 'RouterLink' but with functionality to target a view outlet. * - * If in the context of a view and CTRL key is not pressed, by default, navigation replaces the content of the current view. + * If in the context of a view and CTRL or META (Mac: ⌘, Windows: ⊞) key is not pressed, by default, navigation replaces the content of the current view. * Override this default behavior by setting a view target strategy in navigational extras. * * By default, navigation is relative to the currently activated route, if any. @@ -47,18 +47,18 @@ export class WbRouterLinkDirective { @Optional() private _view: WorkbenchView) { } - @HostListener('click', ['$event.button', '$event.ctrlKey']) - public onClick(button: number, ctrlKey: boolean): boolean { + @HostListener('click', ['$event.button', '$event.ctrlKey', '$event.metaKey']) + public onClick(button: number, ctrlKey: boolean, metaKey: boolean): boolean { if (button !== 0) { // not main button pressed return true; } - const extras = this.createNavigationExtras(ctrlKey); + const extras = this.createNavigationExtras(ctrlKey, metaKey); this._workbenchRouter.navigate(this._commands, extras).then(noop); return false; } - protected createNavigationExtras(ctrlKey: boolean = false): WbNavigationExtras { + protected createNavigationExtras(ctrlKey: boolean = false, metaKey: boolean = false): WbNavigationExtras { const currentViewRef = this._view && this._view.viewRef; const currentViewPartRef = currentViewRef && this._workbench.resolveViewPart(currentViewRef); const isAbsolute = (typeof this._commands[0] === 'string') && this._commands[0].startsWith('/'); @@ -67,7 +67,7 @@ export class WbRouterLinkDirective { return { ...this._extras, relativeTo: this._extras.relativeTo === undefined ? relativeTo : this._extras.relativeTo, - target: this._extras.target || (this._view && !ctrlKey ? 'self' : 'blank'), + target: this._extras.target || (this._view && !ctrlKey && !metaKey ? 'self' : 'blank'), selfViewRef: this._extras.selfViewRef || currentViewRef, blankViewPartRef: this._extras.blankViewPartRef || currentViewPartRef, }; diff --git a/resources/site/how-to/workbench-application-platform/how-to-navigate-to-a-view.md b/resources/site/how-to/workbench-application-platform/how-to-navigate-to-a-view.md index 654b7c1eb..bd0e66f10 100644 --- a/resources/site/how-to/workbench-application-platform/how-to-navigate-to-a-view.md +++ b/resources/site/how-to/workbench-application-platform/how-to-navigate-to-a-view.md @@ -45,7 +45,7 @@ For Angular applications, there are two ways to navigate to a view, either from ``` > Default behavior if using [wbRouterLink]:\ - If in the context of a view and CTRL key is pressed, by default, the view is opened in a new view tab (or activated if present). If CTRL key is not pressed, by default, the content of the current view is replaced. + If in the context of a view and CTRL or META (Mac: ⌘, Windows: ⊞) key is pressed, by default, the view is opened in a new view tab (or activated if present). If CTRL key is not pressed, by default, the content of the current view is replaced. - **Navigate in the component** @@ -81,4 +81,4 @@ Following properties are supported in `WbNavigationExtras`: [menu-contributing]: /CONTRIBUTING.md [menu-changelog]: /resources/site/changelog.md [menu-sponsoring]: /resources/site/sponsors.md -[menu-links]: /resources/site/links.md \ No newline at end of file +[menu-links]: /resources/site/links.md diff --git a/resources/site/how-to/workbench/how-to-open-a-view.md b/resources/site/how-to/workbench/how-to-open-a-view.md index 284ed5e37..864597b7d 100644 --- a/resources/site/how-to/workbench/how-to-open-a-view.md +++ b/resources/site/how-to/workbench/how-to-open-a-view.md @@ -26,7 +26,7 @@ There are two ways to navigate to a view, either from within the template or in ``` > Default behavior if using [wbRouterLink]:\ - If in the context of a view and CTRL key is pressed, by default, the view is opened in a new view tab (or activated if present). If CTRL key is not pressed, by default, the content of the current view is replaced. + If in the context of a view and CTRL or META (Mac: ⌘, Windows: ⊞) key is pressed, by default, the view is opened in a new view tab (or activated if present). If CTRL / META key is not pressed, by default, the content of the current view is replaced. - **Navigate in the component** @@ -55,4 +55,4 @@ There are two ways to navigate to a view, either from within the template or in [menu-contributing]: /CONTRIBUTING.md [menu-changelog]: /resources/site/changelog.md [menu-sponsoring]: /resources/site/sponsors.md -[menu-links]: /resources/site/links.md \ No newline at end of file +[menu-links]: /resources/site/links.md