@@ -34,6 +34,7 @@ export class ReviewPageOptionsComponent implements OnInit, OnChanges{
3434 @Output ( ) showDocumentationEmitter : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ;
3535 @Output ( ) showHiddenAPIEmitter : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ;
3636 @Output ( ) showLeftNavigationEmitter : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ;
37+ @Output ( ) disableCodeLinesLazyLoadingEmitter : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ;
3738 @Output ( ) markAsViewedEmitter : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ;
3839 @Output ( ) showLineNumbersEmitter : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ;
3940 @Output ( ) apiRevisionApprovalEmitter : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ;
@@ -48,13 +49,15 @@ export class ReviewPageOptionsComponent implements OnInit, OnChanges{
4849 showLeftNavigationSwitch : boolean = true ;
4950 markedAsViewSwitch : boolean = false ;
5051 showLineNumbersSwitch : boolean = true ;
52+ disableCodeLinesLazyLoading : boolean = false ;
5153
5254 canToggleApproveAPIRevision : boolean = false ;
5355 activeAPIRevisionIsApprovedByCurrentUser : boolean = false ;
5456 apiRevisionApprovalMessage : string = '' ;
5557 apiRevisionApprovalBtnClass : string = '' ;
5658 apiRevisionApprovalBtnLabel : string = '' ;
5759 showAPIRevisionApprovalModal : boolean = false ;
60+ showDisableCodeLinesLazyLoadingModal : boolean = false ;
5861 overrideActiveConversationforApproval : boolean = false ;
5962 overrideFatalDiagnosticsforApproval : boolean = false ;
6063
@@ -88,21 +91,7 @@ export class ReviewPageOptionsComponent implements OnInit, OnChanges{
8891
8992 ngOnInit ( ) {
9093 this . setSelectedDiffStyle ( ) ;
91- this . showCommentsSwitch = this . userProfile ?. preferences . showComments ?? true ;
92- this . showSystemCommentsSwitch = this . userProfile ?. preferences . showSystemComments ?? true ;
93- this . showDocumentationSwitch = this . userProfile ?. preferences . showDocumentation ?? false ;
94- this . showHiddenAPISwitch = this . userProfile ?. preferences . showHiddenApis ?? false ;
95-
96- if ( this . userProfile ?. preferences . hideLeftNavigation != undefined ) {
97- this . showLeftNavigationSwitch = ! ( this . userProfile ?. preferences . hideLeftNavigation ) ;
98- } else {
99- this . showLeftNavigationSwitch = false ;
100- }
101- if ( this . userProfile ?. preferences . hideLineNumbers ) {
102- this . showLineNumbersSwitch = false ;
103- } else {
104- this . showLineNumbersSwitch = true ;
105- }
94+ this . setPageOptionValues ( ) ;
10695
10796 this . activeAPIRevision ?. assignedReviewers . map ( revision => this . selectedApprovers . push ( revision . assingedTo ) ) ;
10897 this . setAPIRevisionApprovalStates ( ) ;
@@ -115,21 +104,7 @@ export class ReviewPageOptionsComponent implements OnInit, OnChanges{
115104 }
116105
117106 if ( changes [ 'userProfile' ] ) {
118- this . showCommentsSwitch = this . userProfile ?. preferences . showComments ?? this . showCommentsSwitch ;
119- this . showSystemCommentsSwitch = this . userProfile ?. preferences . showSystemComments ?? this . showSystemCommentsSwitch ;
120- this . showDocumentationSwitch = this . userProfile ?. preferences . showDocumentation ?? this . showDocumentationSwitch ;
121- this . showHiddenAPISwitch = this . userProfile ?. preferences . showHiddenApis ?? false ;
122-
123- if ( this . userProfile ?. preferences . hideLeftNavigation != undefined ) {
124- this . showLeftNavigationSwitch = ! ( this . userProfile ?. preferences . hideLeftNavigation ) ;
125- } else {
126- this . showLeftNavigationSwitch = false ;
127- }
128- if ( this . userProfile ?. preferences . hideLineNumbers ) {
129- this . showLineNumbersSwitch = false ;
130- } else {
131- this . showLineNumbersSwitch = true ;
132- }
107+ this . setPageOptionValues ( ) ;
133108 }
134109
135110 if ( changes [ 'activeAPIRevision' ] && changes [ 'activeAPIRevision' ] . currentValue != undefined ) {
@@ -191,6 +166,19 @@ export class ReviewPageOptionsComponent implements OnInit, OnChanges{
191166 this . showLeftNavigationEmitter . emit ( event . checked ) ;
192167 }
193168
169+ /**
170+ * Disable Lazy Loading
171+ * @param event the Filter event
172+ */
173+ onDisableLazyLoadingSwitchChange ( event : InputSwitchOnChangeEvent ) {
174+ if ( event . checked ) {
175+ this . showDisableCodeLinesLazyLoadingModal = true ;
176+ } else {
177+ this . disableCodeLinesLazyLoadingEmitter . emit ( event . checked ) ;
178+ }
179+ }
180+
181+
194182 /**
195183 * Callback for markedAsViewSwitch Change
196184 * @param event the Filter event
@@ -241,6 +229,16 @@ export class ReviewPageOptionsComponent implements OnInit, OnChanges{
241229 this . selectedDiffStyle = ( inputDiffStyle ) ? inputDiffStyle : this . diffStyleOptions [ 0 ] ;
242230 }
243231
232+ setPageOptionValues ( ) {
233+ this . showCommentsSwitch = this . userProfile ?. preferences . showComments ?? this . showCommentsSwitch ;
234+ this . showSystemCommentsSwitch = this . userProfile ?. preferences . showSystemComments ?? this . showSystemCommentsSwitch ;
235+ this . showDocumentationSwitch = this . userProfile ?. preferences . showDocumentation ?? this . showDocumentationSwitch ;
236+ this . showHiddenAPISwitch = this . userProfile ?. preferences . showHiddenApis ?? this . showHiddenAPISwitch ;
237+ this . disableCodeLinesLazyLoading = this . userProfile ?. preferences . disableCodeLinesLazyLoading ?? this . disableCodeLinesLazyLoading ;
238+ this . showLineNumbersSwitch = ( this . userProfile ?. preferences . hideLineNumbers ) ? false : this . showLineNumbersSwitch ;
239+ this . showLeftNavigationSwitch = ( this . userProfile ?. preferences . hideLeftNavigation ) ? false : this . showLeftNavigationSwitch ;
240+ }
241+
244242 setAPIRevisionApprovalStates ( ) {
245243 this . activeAPIRevisionIsApprovedByCurrentUser = this . activeAPIRevision ?. approvers . includes ( this . userProfile ?. userName ! ) ! ;
246244 const isActiveAPIRevisionAhead = ( ! this . diffAPIRevision ) ? true : ( ( new Date ( this . activeAPIRevision ?. createdOn ! ) ) > ( new Date ( this . diffAPIRevision ?. createdOn ! ) ) ) ;
0 commit comments