Enable spot docs route and styleguide route in prod, fix event listener leak

pull/10200/head
Benjamin Bädorf 3 years ago
parent 54ab56c7f9
commit 8ad395f901
No known key found for this signature in database
GPG Key ID: 069CA2D117AB5CCF
  1. 8
      config/routes.rb
  2. 4
      frontend/src/app/spot/components/drop-modal/drop-modal.component.ts
  3. 2
      frontend/src/app/spot/spot.routes.ts

@ -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

@ -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);
}

@ -33,7 +33,7 @@ export const SPOT_DOCS_ROUTES:Ng2StateDeclaration[] = [
{
name: 'styleguide',
parent: 'root',
url: '/spot-docs',
url: '/design/spot',
views: {
'!$default': { component: SpotDocsComponent },
},

Loading…
Cancel
Save