Skip to content

Commit 1d095b5

Browse files
Merge pull request #8 from codeplaysoftware/better-legacy-routes-n-fixes
Small UI Fixes and Legacy Route Support
2 parents 5b39d2c + c118a9c commit 1d095b5

File tree

6 files changed

+70
-6
lines changed

6 files changed

+70
-6
lines changed

routes.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@
1414
/privacy
1515
/cookies
1616
/404
17+
/learn
18+
/releases
19+
/projects
20+
/research
21+
/sessions
22+
/summer-sessions/2020/sessions
23+
/summer-sessions/2021/sessions

src/app/app.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { provideHighlightOptions } from 'ngx-highlightjs';
3030
import { MonacoEditorModule, NgxMonacoEditorConfig } from 'ngx-monaco-editor-v2';
3131
import { TitleCasePipe } from '@angular/common';
3232
import { httpCacheInterceptor } from './http-cache.interceptor';
33+
import { appLegacyRoutes } from './app.legacy-routes';
3334

3435
const scrollConfig: InMemoryScrollingOptions = {
3536
scrollPositionRestoration: 'top',
@@ -65,14 +66,14 @@ const monacoConfig: NgxMonacoEditorConfig = {
6566
export const appConfig: ApplicationConfig = {
6667
providers: [
6768
provideRouter(
68-
routes,
69+
appLegacyRoutes.concat(routes),
6970
inMemoryScrollingFeature,
7071
withPreloading(PreloadAllModules)
7172
),
7273
provideClientHydration(
7374
// withNoHttpTransferCache Enabled = Faster HTML page download, requires API call on first load
7475
// withNoHttpTransferCache Disabled = Slower HTML page download, no API call required
75-
//withNoHttpTransferCache()
76+
// withNoHttpTransferCache()
7677
),
7778
provideHttpClient(
7879
withInterceptors([httpCacheInterceptor]),

src/app/app.legacy-routes.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*---------------------------------------------------------------------------------------------
2+
*
3+
* Copyright (C) Codeplay Software Ltd.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*--------------------------------------------------------------------------------------------*/
18+
19+
import { Routes } from '@angular/router';
20+
21+
export const appLegacyRoutes: Routes = [
22+
{
23+
path: 'learn',
24+
redirectTo: 'getting-started'
25+
},
26+
{
27+
path: 'releases',
28+
redirectTo: 'ecosystem/implementations'
29+
},
30+
{
31+
path: 'projects',
32+
redirectTo: 'ecosystem/projects'
33+
},
34+
{
35+
path: 'research',
36+
redirectTo: 'ecosystem/research'
37+
},
38+
{
39+
path: 'sessions',
40+
redirectTo: 'calendar'
41+
},
42+
{
43+
path: 'events',
44+
redirectTo: 'calendar'
45+
},
46+
{
47+
path: 'summer-sessions/2020/sessions',
48+
redirectTo: 'calendar'
49+
},
50+
{
51+
path: 'summer-sessions/2021/sessions',
52+
redirectTo: 'calendar'
53+
}
54+
];

src/app/app.routes.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ export const routes: Routes = [
115115
path: 'contributors/:username',
116116
component: ContributorComponent
117117
},
118-
{
119-
path: 'learn',
120-
redirectTo: 'getting-started'
121-
},
122118
{
123119
path: 'e404',
124120
component: Error404Component

src/app/pages/ecosystem/research/research.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ export class ResearchComponent extends FilterableBaseComponent implements OnInit
5454
protected meta: Meta
5555
) {
5656
super(researchService);
57+
58+
this.maxResultsPerPage = 20;
59+
5760
this.titleService.setTitle('Research - Ecosystem - SYCL.tech');
5861
this.meta.addTag({ name: 'keywords', content: this.getKeywords().join(', ') });
5962
this.meta.addTag({ name: 'description', content: this.getDescription() });

src/app/pages/ecosystem/videos/videos.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ export class VideosComponent extends FilterableBaseComponent implements OnInit,
5454
protected meta: Meta
5555
) {
5656
super(videosService);
57+
58+
this.maxResultsPerPage = 20;
59+
5760
this.titleService.setTitle('Videos - Ecosystem - SYCL.tech');
5861
this.meta.addTag({ name: 'keywords', content: this.getKeywords().join(', ') });
5962
this.meta.addTag({ name: 'description', content: this.getDescription() });

0 commit comments

Comments
 (0)