11import { getSettings } from '../Config/Settings' ;
22import type { IQuery } from '../IQuery' ;
33import { QueryLayoutOptions , parseQueryShowHideOptions } from '../Layout/QueryLayoutOptions' ;
4- import { TaskLayoutComponent , TaskLayoutOptions } from '../Layout/TaskLayoutOptions' ;
4+ import { TaskLayoutOptions , parseTaskShowHideOptions } from '../Layout/TaskLayoutOptions' ;
55import { errorMessageForException } from '../lib/ExceptionTools' ;
66import { logging } from '../lib/logging' ;
77import { expandPlaceholders } from '../Scripting/ExpandPlaceholders' ;
@@ -20,65 +20,6 @@ import { Sort } from './Sort/Sort';
2020import type { Sorter } from './Sort/Sorter' ;
2121import { Statement } from './Statement' ;
2222
23- /**
24- * Parse show/hide options for Task layout options
25- * @param taskLayoutOptions
26- * @param option - must already have been lower-cased
27- * @param visible - whether the option should be shown
28- * @return True if the option was recognised, and false otherwise
29- */
30- function parseTaskShowHideOptions ( taskLayoutOptions : TaskLayoutOptions , option : string , visible : boolean ) {
31- if ( option . startsWith ( 'priority' ) ) {
32- taskLayoutOptions . setVisibility ( TaskLayoutComponent . Priority , visible ) ;
33- return true ;
34- }
35- if ( option . startsWith ( 'cancelled date' ) ) {
36- taskLayoutOptions . setVisibility ( TaskLayoutComponent . CancelledDate , visible ) ;
37- return true ;
38- }
39- if ( option . startsWith ( 'created date' ) ) {
40- taskLayoutOptions . setVisibility ( TaskLayoutComponent . CreatedDate , visible ) ;
41- return true ;
42- }
43- if ( option . startsWith ( 'start date' ) ) {
44- taskLayoutOptions . setVisibility ( TaskLayoutComponent . StartDate , visible ) ;
45- return true ;
46- }
47- if ( option . startsWith ( 'scheduled date' ) ) {
48- taskLayoutOptions . setVisibility ( TaskLayoutComponent . ScheduledDate , visible ) ;
49- return true ;
50- }
51- if ( option . startsWith ( 'due date' ) ) {
52- taskLayoutOptions . setVisibility ( TaskLayoutComponent . DueDate , visible ) ;
53- return true ;
54- }
55- if ( option . startsWith ( 'done date' ) ) {
56- taskLayoutOptions . setVisibility ( TaskLayoutComponent . DoneDate , visible ) ;
57- return true ;
58- }
59- if ( option . startsWith ( 'recurrence rule' ) ) {
60- taskLayoutOptions . setVisibility ( TaskLayoutComponent . RecurrenceRule , visible ) ;
61- return true ;
62- }
63- if ( option . startsWith ( 'tags' ) ) {
64- taskLayoutOptions . setTagsVisibility ( visible ) ;
65- return true ;
66- }
67- if ( option . startsWith ( 'id' ) ) {
68- taskLayoutOptions . setVisibility ( TaskLayoutComponent . Id , visible ) ;
69- return true ;
70- }
71- if ( option . startsWith ( 'depends on' ) ) {
72- taskLayoutOptions . setVisibility ( TaskLayoutComponent . DependsOn , visible ) ;
73- return true ;
74- }
75- if ( option . startsWith ( 'on completion' ) ) {
76- taskLayoutOptions . setVisibility ( TaskLayoutComponent . OnCompletion , visible ) ;
77- return true ;
78- }
79- return false ;
80- }
81-
8223export class Query implements IQuery {
8324 /** Note: source is the raw source, before expanding any placeholders */
8425 public readonly source : string ;
0 commit comments