File tree Expand file tree Collapse file tree 3 files changed +32
-5
lines changed
js/pages/concept-sets/components/modal Expand file tree Collapse file tree 3 files changed +32
-5
lines changed Original file line number Diff line number Diff line change 4444 The following will happen:
4545 < ul >
4646 < li > Concept Set read-only mode will be disabled</ li >
47+ < li > Optional: Take a snapshot after unlock</ li >
4748 </ ul >
4849 </ 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 >
4955 < p class ="modal-text " style ="margin-top: 20px; "> < strong > Unlock confirmation message*:</ strong > </ p >
5056 < textarea class ="form-control large-text-input "
5157 data-bind ="textInput: snapshotDescriptionMessage, enable: true " rows ="4 "> </ textarea >
5258 < 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() "
5461 style ="background-color: green "> Confirm</ button >
5562 < button class ="btn btn-primary btn-sm " data-bind ="click: () => isModalShown(false) "
5663 style ="background-color: blue "> Cancel</ button >
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ define([
2626 super ( params ) ;
2727 this . isModalShown = params . isModalShown ;
2828 this . isLocked = params . isLocked ;
29+ this . takeSnapshotWhenUnlocking = ko . observable ( false ) ;
2930 this . currentConceptSetId = params . currentConceptSetId ;
3031 this . currentVocabularyVersion = params . currentVocabularyVersion ;
3132 this . currentVocabularySchema = ko . observable ( ) ;
@@ -57,12 +58,13 @@ define([
5758 }
5859
5960
60- createSnapshotActionRequest ( action ) {
61+ createSnapshotActionRequest ( action , takeSnapshot = true ) {
6162 return {
6263 sourceKey : sharedState . sourceKeyOfVocabUrl ( ) ,
6364 action : action ,
6465 user : authApi . subject ( ) ,
65- message : this . snapshotDescriptionMessage ( )
66+ message : this . snapshotDescriptionMessage ( ) ,
67+ takeSnapshot : takeSnapshot
6668 } ;
6769 }
6870
@@ -89,8 +91,8 @@ define([
8991 . catch ( error => console . error ( `Error creating snapshot: ${ error } ` ) ) ;
9092 }
9193
92- unlockConceptSet ( ) {
93- const request = this . createSnapshotActionRequest ( "UNLOCK" ) ;
94+ unlockConceptSet ( takeSnapshot ) {
95+ const request = this . createSnapshotActionRequest ( "UNLOCK" , takeSnapshot ) ;
9496 conceptSetService . invokeConceptSetSnapshotAction ( this . currentConceptSetId ( ) , request )
9597 . then ( ( ) => {
9698 this . isLocked ( false ) ;
Original file line number Diff line number Diff line change 119119
120120.ui-autocomplete {
121121 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 ;
122140}
You can’t perform that action at this time.
0 commit comments