Commit dccbf6b 1 parent 6339b8d commit dccbf6b Copy full SHA for dccbf6b
File tree 3 files changed +32
-5
lines changed
js/pages/concept-sets/components/modal
3 files changed +32
-5
lines changed Original file line number Diff line number Diff line change 44
44
The following will happen:
45
45
< ul >
46
46
< li > Concept Set read-only mode will be disabled</ li >
47
+ < li > Optional: Take a snapshot after unlock</ li >
47
48
</ ul >
48
49
</ p >
50
+ < div class ="checkbox-container ">
51
+ < input type ="checkbox " class ="form-control snapshot-checkbox "
52
+ data-bind ="checked: takeSnapshotWhenUnlocking, enable: true " />
53
+ < label for ="snapshotCheckbox " class ="snapshot-label "> Take snapshot</ label >
54
+ </ div >
49
55
< p class ="modal-text " style ="margin-top: 20px; "> < strong > Unlock confirmation message*:</ strong > </ p >
50
56
< textarea class ="form-control large-text-input "
51
57
data-bind ="textInput: snapshotDescriptionMessage, enable: true " rows ="4 "> </ textarea >
52
58
< div class ="center-buttons ">
53
- < button class ="btn btn-success btn-sm " data-bind ="click: unlockConceptSet, enable: canExecuteActions() "
59
+ < button class ="btn btn-success btn-sm "
60
+ data-bind ="click: () => unlockConceptSet(takeSnapshotWhenUnlocking()), enable: canExecuteActions() "
54
61
style ="background-color: green "> Confirm</ button >
55
62
< button class ="btn btn-primary btn-sm " data-bind ="click: () => isModalShown(false) "
56
63
style ="background-color: blue "> Cancel</ button >
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ define([
26
26
super ( params ) ;
27
27
this . isModalShown = params . isModalShown ;
28
28
this . isLocked = params . isLocked ;
29
+ this . takeSnapshotWhenUnlocking = ko . observable ( false ) ;
29
30
this . currentConceptSetId = params . currentConceptSetId ;
30
31
this . currentVocabularyVersion = params . currentVocabularyVersion ;
31
32
this . currentVocabularySchema = ko . observable ( ) ;
@@ -57,12 +58,13 @@ define([
57
58
}
58
59
59
60
60
- createSnapshotActionRequest ( action ) {
61
+ createSnapshotActionRequest ( action , takeSnapshot = true ) {
61
62
return {
62
63
sourceKey : sharedState . sourceKeyOfVocabUrl ( ) ,
63
64
action : action ,
64
65
user : authApi . subject ( ) ,
65
- message : this . snapshotDescriptionMessage ( )
66
+ message : this . snapshotDescriptionMessage ( ) ,
67
+ takeSnapshot : takeSnapshot
66
68
} ;
67
69
}
68
70
@@ -89,8 +91,8 @@ define([
89
91
. catch ( error => console . error ( `Error creating snapshot: ${ error } ` ) ) ;
90
92
}
91
93
92
- unlockConceptSet ( ) {
93
- const request = this . createSnapshotActionRequest ( "UNLOCK" ) ;
94
+ unlockConceptSet ( takeSnapshot ) {
95
+ const request = this . createSnapshotActionRequest ( "UNLOCK" , takeSnapshot ) ;
94
96
conceptSetService . invokeConceptSetSnapshotAction ( this . currentConceptSetId ( ) , request )
95
97
. then ( ( ) => {
96
98
this . isLocked ( false ) ;
Original file line number Diff line number Diff line change 119
119
120
120
.ui-autocomplete {
121
121
z-index : 10000 ;
122
+ }
123
+
124
+ .snapshot-label {
125
+ margin : 0 ;
126
+ }
127
+
128
+ .checkbox-container {
129
+ display : flex ;
130
+ align-items : center ;
131
+ justify-content : flex-start ;
132
+ margin-top : 10px ;
133
+ font-size : 16px ;
134
+ }
135
+
136
+ .snapshot-checkbox {
137
+ width : 16px ;
138
+ height : 16px ;
139
+ margin-right : 8px ;
122
140
}
You can’t perform that action at this time.
0 commit comments