Skip to content

Commit

Permalink
Merge pull request #8 from codeplaysoftware/better-legacy-routes-n-fixes
Browse files Browse the repository at this point in the history
Small UI Fixes and Legacy Route Support
  • Loading branch information
scottstraughan authored Jul 11, 2024
2 parents 5b39d2c + c118a9c commit 1d095b5
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 6 deletions.
7 changes: 7 additions & 0 deletions routes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@
/privacy
/cookies
/404
/learn
/releases
/projects
/research
/sessions
/summer-sessions/2020/sessions
/summer-sessions/2021/sessions
5 changes: 3 additions & 2 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { provideHighlightOptions } from 'ngx-highlightjs';
import { MonacoEditorModule, NgxMonacoEditorConfig } from 'ngx-monaco-editor-v2';
import { TitleCasePipe } from '@angular/common';
import { httpCacheInterceptor } from './http-cache.interceptor';
import { appLegacyRoutes } from './app.legacy-routes';

const scrollConfig: InMemoryScrollingOptions = {
scrollPositionRestoration: 'top',
Expand Down Expand Up @@ -65,14 +66,14 @@ const monacoConfig: NgxMonacoEditorConfig = {
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(
routes,
appLegacyRoutes.concat(routes),
inMemoryScrollingFeature,
withPreloading(PreloadAllModules)
),
provideClientHydration(
// withNoHttpTransferCache Enabled = Faster HTML page download, requires API call on first load
// withNoHttpTransferCache Disabled = Slower HTML page download, no API call required
//withNoHttpTransferCache()
// withNoHttpTransferCache()
),
provideHttpClient(
withInterceptors([httpCacheInterceptor]),
Expand Down
54 changes: 54 additions & 0 deletions src/app/app.legacy-routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*---------------------------------------------------------------------------------------------
*
* Copyright (C) Codeplay Software Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*--------------------------------------------------------------------------------------------*/

import { Routes } from '@angular/router';

export const appLegacyRoutes: Routes = [
{
path: 'learn',
redirectTo: 'getting-started'
},
{
path: 'releases',
redirectTo: 'ecosystem/implementations'
},
{
path: 'projects',
redirectTo: 'ecosystem/projects'
},
{
path: 'research',
redirectTo: 'ecosystem/research'
},
{
path: 'sessions',
redirectTo: 'calendar'
},
{
path: 'events',
redirectTo: 'calendar'
},
{
path: 'summer-sessions/2020/sessions',
redirectTo: 'calendar'
},
{
path: 'summer-sessions/2021/sessions',
redirectTo: 'calendar'
}
];
4 changes: 0 additions & 4 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ export const routes: Routes = [
path: 'contributors/:username',
component: ContributorComponent
},
{
path: 'learn',
redirectTo: 'getting-started'
},
{
path: 'e404',
component: Error404Component
Expand Down
3 changes: 3 additions & 0 deletions src/app/pages/ecosystem/research/research.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export class ResearchComponent extends FilterableBaseComponent implements OnInit
protected meta: Meta
) {
super(researchService);

this.maxResultsPerPage = 20;

this.titleService.setTitle('Research - Ecosystem - SYCL.tech');
this.meta.addTag({ name: 'keywords', content: this.getKeywords().join(', ') });
this.meta.addTag({ name: 'description', content: this.getDescription() });
Expand Down
3 changes: 3 additions & 0 deletions src/app/pages/ecosystem/videos/videos.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export class VideosComponent extends FilterableBaseComponent implements OnInit,
protected meta: Meta
) {
super(videosService);

this.maxResultsPerPage = 20;

this.titleService.setTitle('Videos - Ecosystem - SYCL.tech');
this.meta.addTag({ name: 'keywords', content: this.getKeywords().join(', ') });
this.meta.addTag({ name: 'description', content: this.getDescription() });
Expand Down

0 comments on commit 1d095b5

Please sign in to comment.