File tree Expand file tree Collapse file tree 7 files changed +31
-0
lines changed
src/components/operations/operation-list Expand file tree Collapse file tree 7 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 6
6
</ label >
7
7
</ div >
8
8
9
+ < div class ="form-group ">
10
+ < label for ="defaultGroupByTagToEnabled " class ="form-label ">
11
+ < input type ="checkbox " id ="defaultGroupByTagToEnabled " name ="defaultGroupByTagToEnabled " data-bind ="checked: defaultGroupByTagToEnabled " />
12
+ Default Group by tag to enabled
13
+ </ label >
14
+ </ div >
15
+
9
16
< div class ="form-group ">
10
17
< label class ="form-label ">
11
18
Link to operation details page
Original file line number Diff line number Diff line change @@ -11,11 +11,13 @@ import { HyperlinkModel } from "@paperbits/common/permalinks";
11
11
} )
12
12
export class OperationListEditor {
13
13
public readonly allowSelection : ko . Observable < boolean > ;
14
+ public readonly defaultGroupByTagToEnabled : ko . Observable < boolean > ;
14
15
public readonly hyperlink : ko . Observable < HyperlinkModel > ;
15
16
public readonly hyperlinkTitle : ko . Computed < string > ;
16
17
17
18
constructor ( ) {
18
19
this . allowSelection = ko . observable ( false ) ;
20
+ this . defaultGroupByTagToEnabled = ko . observable ( false ) ;
19
21
this . hyperlink = ko . observable ( ) ;
20
22
this . hyperlinkTitle = ko . computed < string > ( ( ) => this . hyperlink ( ) ? this . hyperlink ( ) . title : "Add a link..." ) ;
21
23
}
@@ -29,13 +31,16 @@ export class OperationListEditor {
29
31
@OnMounted ( )
30
32
public async initialize ( ) : Promise < void > {
31
33
this . allowSelection ( this . model . allowSelection ) ;
34
+ this . defaultGroupByTagToEnabled ( this . model . defaultGroupByTagToEnabled ) ;
32
35
this . hyperlink ( this . model . detailsPageHyperlink ) ;
33
36
34
37
this . allowSelection . subscribe ( this . applyChanges ) ;
38
+ this . defaultGroupByTagToEnabled . subscribe ( this . applyChanges ) ;
35
39
}
36
40
37
41
private applyChanges ( ) : void {
38
42
this . model . allowSelection = this . allowSelection ( ) ;
43
+ this . model . defaultGroupByTagToEnabled = this . defaultGroupByTagToEnabled ( ) ;
39
44
this . model . detailsPageHyperlink = this . hyperlink ( ) ;
40
45
this . onChange ( this . model ) ;
41
46
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export class OperationListViewModelBinder implements ViewModelBinder<OperationLi
14
14
15
15
viewModel . runtimeConfig ( JSON . stringify ( {
16
16
allowSelection : model . allowSelection ,
17
+ defaultGroupByTagToEnabled : model . defaultGroupByTagToEnabled ,
17
18
detailsPageUrl : model . detailsPageHyperlink
18
19
? model . detailsPageHyperlink . href
19
20
: undefined
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ export class OperationList {
44
44
this . selectedOperationName = ko . observable ( ) . extend ( < any > { acceptChange : this . allowSelection } ) ;
45
45
this . working = ko . observable ( false ) ;
46
46
this . groupByTag = ko . observable ( false ) ;
47
+ this . defaultGroupByTagToEnabled = ko . observable ( false ) ;
47
48
this . pattern = ko . observable ( ) ;
48
49
this . pageNumber = ko . observable ( 1 ) ;
49
50
this . hasNextPage = ko . observable ( ) ;
@@ -54,6 +55,9 @@ export class OperationList {
54
55
@Param ( )
55
56
public allowSelection : ko . Observable < boolean > ;
56
57
58
+ @Param ( )
59
+ public defaultGroupByTagToEnabled : ko . Observable < boolean > ;
60
+
57
61
@Param ( )
58
62
public detailsPageUrl : ko . Observable < string > ;
59
63
@@ -69,6 +73,8 @@ export class OperationList {
69
73
return ;
70
74
}
71
75
76
+ this . groupByTag ( this . defaultGroupByTagToEnabled ( ) ) ;
77
+
72
78
await this . loadOperations ( ) ;
73
79
74
80
this . pattern
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ export interface OperationListContract extends Contract {
10
10
*/
11
11
allowSelection : boolean ;
12
12
13
+ /**
14
+ * Default GroupByTag to enabled.
15
+ */
16
+ defaultGroupByTagToEnabled ?: boolean ;
17
+
13
18
/**
14
19
* Link to a page that contains operation details.
15
20
*/
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ export class OperationListModel {
6
6
*/
7
7
public allowSelection : boolean ;
8
8
9
+ /**
10
+ * Default GroupByTag to enabled.
11
+ */
12
+ public defaultGroupByTagToEnabled : boolean ;
13
+
9
14
/**
10
15
* Link to a page that contains operation details.
11
16
*/
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export class OperationListModelBinder implements IModelBinder<OperationListModel
20
20
const model = new OperationListModel ( ) ;
21
21
22
22
model . allowSelection = contract . allowSelection ;
23
+ model . defaultGroupByTagToEnabled = contract . defaultGroupByTagToEnabled === true ;
23
24
24
25
if ( contract . detailsPageHyperlink ) {
25
26
model . detailsPageHyperlink = await this . permalinkResolver . getHyperlinkFromConfig ( contract . detailsPageHyperlink ) ;
@@ -32,6 +33,7 @@ export class OperationListModelBinder implements IModelBinder<OperationListModel
32
33
const contract : OperationListContract = {
33
34
type : "operationList" ,
34
35
allowSelection : model . allowSelection ,
36
+ defaultGroupByTagToEnabled : model . defaultGroupByTagToEnabled ,
35
37
detailsPageHyperlink : model . detailsPageHyperlink
36
38
? {
37
39
target : model . detailsPageHyperlink . target ,
You can’t perform that action at this time.
0 commit comments