@@ -88,6 +88,11 @@ interface DisplayTimestamps {
88
88
last_fetched_from_now : string ;
89
89
}
90
90
91
+ interface RelatedRepo {
92
+ name : string ;
93
+ path : string ;
94
+ }
95
+
91
96
interface ProjectArgs {
92
97
env : Env ;
93
98
@@ -96,7 +101,7 @@ interface ProjectArgs {
96
101
header : Section ;
97
102
subheader_tabs : SelectableLink [ ] ;
98
103
sidebar : SidebarSection [ ] ;
99
- related_repos : string [ ] ;
104
+ related_repos : RelatedRepo [ ] ;
100
105
101
106
info : RepoInfo ;
102
107
timestamps : DisplayTimestamps ;
@@ -142,7 +147,7 @@ export default class Projects extends Vue implements ProjectArgs {
142
147
@Prop ( )
143
148
sidebar : SidebarSection [ ] ;
144
149
@Prop ( )
145
- related_repos : string [ ] ;
150
+ related_repos : RelatedRepo [ ] ;
146
151
147
152
cancels : Function [ ] ;
148
153
show_clone_cmd : Boolean = false ;
@@ -276,6 +281,7 @@ export default class Projects extends Vue implements ProjectArgs {
276
281
const href = `${ projectPath } /${ pageConfig . path } ` . toLowerCase ( ) ;
277
282
subpages . push ( new SelectableLink ( pageName , href , selected ) ) ;
278
283
}
284
+ projectSidebar . pages = projectSidebar . pages . concat ( subpages ) ;
279
285
}
280
286
result . sidebar = [ projectSidebar , OSS_SIDEBAR , FIREBASE_SIDEBAR ] ;
281
287
@@ -289,7 +295,7 @@ export default class Projects extends Vue implements ProjectArgs {
289
295
}
290
296
291
297
// Related repos
292
- result . related_repos = this . relatedRepoNames ( configData ) ;
298
+ result . related_repos = this . relatedRepos ( configData ) ;
293
299
294
300
return result ;
295
301
}
@@ -298,7 +304,7 @@ export default class Projects extends Vue implements ProjectArgs {
298
304
return text . toLowerCase ( ) . replace ( " " , "_" ) ;
299
305
}
300
306
301
- static relatedRepoNames ( config : StoredProjectConfig ) : string [ ] {
307
+ static relatedRepos ( config : StoredProjectConfig ) : RelatedRepo [ ] {
302
308
if ( ! config . related ) {
303
309
return [ ] ;
304
310
}
@@ -307,14 +313,17 @@ export default class Projects extends Vue implements ProjectArgs {
307
313
// Format the name of a related project for display.
308
314
// Strips the "firebase/" from the name to save space, since
309
315
// the firebase context is implied on firebaseopensource.com
316
+ let name = repo ;
310
317
if ( repo . indexOf ( "firebase/" ) >= 0 ) {
311
- return repo . substring ( "firebase/" . length , repo . length ) ;
318
+ name = repo . substring ( "firebase/" . length , repo . length ) ;
312
319
}
313
320
314
- return repo ;
321
+ return {
322
+ name,
323
+ path : repo
324
+ }
315
325
} ) ;
316
326
}
317
-
318
327
get isStaging ( ) {
319
328
return this . env === Env . STAGING ;
320
329
}
0 commit comments