@@ -94,16 +94,12 @@ export class GlTimelineApp extends GlAppHost<State> {
9494 return ! this . repository ?. virtual ;
9595 }
9696
97- get isSliceByAllowed ( ) {
98- return this . config . showAllBranches && this . isSliceBySupported ;
99- }
100-
10197 get isSliceBySupported ( ) {
10298 return ! this . repository ?. virtual && ( this . scope ?. type === 'file' || this . scope ?. type === 'folder' ) ;
10399 }
104100
105101 get sliceBy ( ) {
106- return this . isSliceByAllowed ? this . config . sliceBy : 'author' ;
102+ return this . isSliceBySupported && this . config . showAllBranches ? this . config . sliceBy : 'author' ;
107103 }
108104
109105 get subscription ( ) {
@@ -465,27 +461,22 @@ export class GlTimelineApp extends GlAppHost<State> {
465461 private renderConfigSliceBy ( ) {
466462 if ( ! this . isSliceBySupported ) return nothing ;
467463
468- const { sliceBy, isSliceByAllowed } = this ;
469-
470- const template = html `< label for ="sliceBy " ?disabled =${ ! isSliceByAllowed } > Slice By</ label >
471- < select
472- class ="select "
473- name ="sliceBy "
474- position ="below "
475- .value =${ sliceBy }
476- ?disabled =${ ! isSliceByAllowed }
477- @change=${ this . onSliceByChanged }
478- >
479- < option value ="author " ?selected =${ sliceBy === 'author' } > Author</ option >
480- < option value ="branch " ?selected =${ sliceBy === 'branch' } > Branch</ option >
481- </ select > ` ;
482-
483- if ( isSliceByAllowed ) return html `< section > < span class ="select-container "> ${ template } </ span > </ section > ` ;
464+ const { sliceBy } = this ;
484465
485466 return html `< section >
486- < gl-tooltip style ="width: 100% " content ="Slicing by branches is only available when viewing all branches ">
487- < span class ="select-container "> ${ template } </ span >
488- </ gl-tooltip >
467+ < span class ="select-container "
468+ > < label for ="sliceBy "> Slice By</ label >
469+ < select
470+ class ="select "
471+ name ="sliceBy "
472+ position ="below "
473+ .value =${ sliceBy }
474+ @change =${ this . onSliceByChanged }
475+ >
476+ < option value ="author " ?selected =${ sliceBy === 'author' } > Author</ option >
477+ < option value ="branch " ?selected =${ sliceBy === 'branch' } > Branch</ option >
478+ </ select > </ span
479+ >
489480 </ section > ` ;
490481 }
491482
0 commit comments