File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export class QueryLayout {
44
44
}
45
45
}
46
46
47
- protected applyQueryLayoutOptions ( ) {
47
+ public applyQueryLayoutOptions ( ) {
48
48
const taskListHiddenClasses : string [ ] = [ ] ;
49
49
const componentsToGenerateClassesOnly : [ boolean , string ] [ ] = [
50
50
// The following components are handled in QueryRenderer.ts and thus are not part of the same flow that
@@ -83,9 +83,6 @@ function hiddenComponentClassName(component: string) {
83
83
* modified by applying {@link TaskLayoutOptions} objects.
84
84
*/
85
85
export class TaskLayout extends QueryLayout {
86
- public taskListHiddenClasses ( ) : string [ ] {
87
- return [ ...this . applyTaskLayoutOptions ( ) , ...this . applyQueryLayoutOptions ( ) ] ;
88
- }
89
86
private taskLayoutOptions : TaskLayoutOptions ;
90
87
91
88
constructor ( taskLayoutOptions ?: TaskLayoutOptions , queryLayoutOptions ?: QueryLayoutOptions ) {
@@ -97,7 +94,7 @@ export class TaskLayout extends QueryLayout {
97
94
this . taskLayoutOptions = new TaskLayoutOptions ( ) ;
98
95
}
99
96
}
100
- private applyTaskLayoutOptions ( ) {
97
+ public applyTaskLayoutOptions ( ) {
101
98
const taskListHiddenClasses : string [ ] = [ ] ;
102
99
this . taskLayoutOptions . toggleableComponents . forEach ( ( component ) => {
103
100
generateHiddenClassForTaskList (
Original file line number Diff line number Diff line change @@ -224,7 +224,7 @@ class QueryRenderChild extends MarkdownRenderChild {
224
224
const layout = new TaskLayout ( this . query . taskLayoutOptions , this . query . queryLayoutOptions ) ;
225
225
const taskList = content . createEl ( 'ul' ) ;
226
226
taskList . addClasses ( [ 'contains-task-list' , 'plugin-tasks-query-result' ] ) ;
227
- taskList . addClasses ( layout . taskListHiddenClasses ( ) ) ;
227
+ taskList . addClasses ( [ ... layout . applyTaskLayoutOptions ( ) , ... layout . applyQueryLayoutOptions ( ) ] ) ;
228
228
const groupingAttribute = this . getGroupingAttribute ( ) ;
229
229
if ( groupingAttribute && groupingAttribute . length > 0 ) taskList . dataset . taskGroupBy = groupingAttribute ;
230
230
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ import { TaskLayout } from '../../src/Layout/TaskLayout';
9
9
describe ( 'TaskLayout tests' , ( ) => {
10
10
it ( 'should generate expected CSS classes for default layout' , ( ) => {
11
11
const taskLayout = new TaskLayout ( ) ;
12
- expect ( taskLayout . taskListHiddenClasses ( ) . join ( '\n' ) ) . toMatchInlineSnapshot ( '"tasks-layout-hide-urgency"' ) ;
12
+ expect (
13
+ [ ...taskLayout . applyTaskLayoutOptions ( ) , ...taskLayout . applyQueryLayoutOptions ( ) ] . join ( '\n' ) ,
14
+ ) . toMatchInlineSnapshot ( '"tasks-layout-hide-urgency"' ) ;
13
15
} ) ;
14
16
15
17
it ( 'should generate expected CSS classes with all default options reversed' , ( ) => {
@@ -25,7 +27,8 @@ describe('TaskLayout tests', () => {
25
27
26
28
const taskLayout = new TaskLayout ( taskLayoutOptions , queryLayoutOptions ) ;
27
29
28
- expect ( taskLayout . taskListHiddenClasses ( ) . join ( '\n' ) ) . toMatchInlineSnapshot ( `
30
+ expect ( [ ...taskLayout . applyTaskLayoutOptions ( ) , ...taskLayout . applyQueryLayoutOptions ( ) ] . join ( '\n' ) )
31
+ . toMatchInlineSnapshot ( `
29
32
"tasks-layout-hide-id
30
33
tasks-layout-hide-blockedBy
31
34
tasks-layout-hide-priority
You can’t perform that action at this time.
0 commit comments