From 8ad395f901f91bd7cdb99177c4e5ac431aff6115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 28 Feb 2022 14:50:40 +0100 Subject: [PATCH] Enable spot docs route and styleguide route in prod, fix event listener leak --- config/routes.rb | 8 +++----- .../spot/components/drop-modal/drop-modal.component.ts | 4 +++- frontend/src/app/spot/spot.routes.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index e7675eb845..44f25fff12 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -581,9 +581,7 @@ OpenProject::Application.routes.draw do get '(/*state)', to: 'angular#notifications_layout', as: :notifications_center end - # Development route for styleguide - if Rails.env.development? - get '/spot-docs', to: 'angular#empty_layout' - get '/styleguide' => redirect('/assets/styleguide.html') - end + # Routes for design related documentation and examples pages + get '/design/spot', to: 'angular#empty_layout' + get '/design/styleguide' => redirect('/assets/styleguide.html') end diff --git a/frontend/src/app/spot/components/drop-modal/drop-modal.component.ts b/frontend/src/app/spot/components/drop-modal/drop-modal.component.ts index f9f1d10ac4..4b492a3a43 100644 --- a/frontend/src/app/spot/components/drop-modal/drop-modal.component.ts +++ b/frontend/src/app/spot/components/drop-modal/drop-modal.component.ts @@ -75,9 +75,11 @@ export class SpotDropModalComponent implements OnDestroy { private closeEventListener = this.close.bind(this); - private escapeListener = (evt:KeyboardEvent) => { + private onEscape = (evt:KeyboardEvent) => { if (evt.keyCode === KeyCodes.ESCAPE) { this.close(); } }; + + private escapeListener = this.onEscape.bind(this); } diff --git a/frontend/src/app/spot/spot.routes.ts b/frontend/src/app/spot/spot.routes.ts index dc29d6047f..ee8ab2139a 100644 --- a/frontend/src/app/spot/spot.routes.ts +++ b/frontend/src/app/spot/spot.routes.ts @@ -33,7 +33,7 @@ export const SPOT_DOCS_ROUTES:Ng2StateDeclaration[] = [ { name: 'styleguide', parent: 'root', - url: '/spot-docs', + url: '/design/spot', views: { '!$default': { component: SpotDocsComponent }, },