@@ -766,8 +766,49 @@ export const findTrackAction = (action, state) => {
766
766
text : `${ actionDescription . SURFACE } ${ actionDescription . TURNED_OFF } ${ objectType } ${ objectName } of dataset: ${ action . payload . datasetID } `
767
767
} ;
768
768
}
769
+ } else if ( action . type === nglConstants . UPDATE_COMPONENT_REPRESENTATION_VISIBILITY ) {
770
+ let objectType = actionObjectType . REPRESENTATION ;
771
+ let value = action . newVisibility ;
772
+ let valueDescription = value === true ? actionDescription . VISIBLE : actionDescription . HIDDEN ;
773
+
774
+ trackAction = {
775
+ type : actionType . REPRESENTATION_VISIBILITY_UPDATED ,
776
+ annotation : actionAnnotation . CHECK ,
777
+ timestamp : Date . now ( ) ,
778
+ username : username ,
779
+ object_type : actionObjectType . REPRESENTATION ,
780
+ object_name : action . objectInViewID ,
781
+ object_id : action . objectInViewID ,
782
+ representation_id : action . representationID ,
783
+ representation : action . representation ,
784
+ value : value ,
785
+ text : `${ objectType } '${ action . representation ?. type } ' ${ actionDescription . VISIBILITY } of ${ action . objectInViewID } ${ actionDescription . CHANGED } to: ${ valueDescription } `
786
+ } ;
787
+ } else if ( action . type === nglConstants . UPDATE_COMPONENT_REPRESENTATION_VISIBILITY_ALL ) {
788
+ let objectType = actionObjectType . REPRESENTATION ;
789
+ let value = action . newVisibility ;
790
+ let valueDescription = value === true ? actionDescription . VISIBLE : actionDescription . HIDDEN ;
791
+
792
+ trackAction = {
793
+ type : actionType . REPRESENTATION_VISIBILITY_ALL_UPDATED ,
794
+ annotation : actionAnnotation . CHECK ,
795
+ timestamp : Date . now ( ) ,
796
+ username : username ,
797
+ object_type : actionObjectType . REPRESENTATION ,
798
+ object_name : action . objectInViewID ,
799
+ object_id : action . objectInViewID ,
800
+ value : value ,
801
+ text : `${ objectType } ${ actionDescription . VISIBILITY } of ${ action . objectInViewID } ${ actionDescription . CHANGED } to: ${ valueDescription } `
802
+ } ;
769
803
} else if ( action . type . includes ( nglConstants . UPDATE_COMPONENT_REPRESENTATION ) ) {
770
804
let objectType = actionObjectType . REPRESENTATION ;
805
+ let key = action . change ?. key ;
806
+ let oldValue = action . change ?. oldValue ;
807
+ let newValue = action . change ?. value ;
808
+ let valueDescription =
809
+ key !== 'clipCenter'
810
+ ? `from value: ${ oldValue } to value: ${ newValue } `
811
+ : getClipCenterChange ( oldValue , newValue ) ;
771
812
772
813
trackAction = {
773
814
type : actionType . REPRESENTATION_UPDATED ,
@@ -780,7 +821,7 @@ export const findTrackAction = (action, state) => {
780
821
representation_id : action . representationID ,
781
822
representation : action . newRepresentation ,
782
823
change : action . change ,
783
- text : `${ objectType } '${ action . change ?. key } ' of ${ action . objectInViewID } ${ actionDescription . UPDATED } from value: ${ action . change ?. oldValue } to value: ${ action . change ?. value } `
824
+ text : `${ objectType } '${ key } ' of ${ action . objectInViewID } ${ actionDescription . UPDATED } ${ valueDescription } `
784
825
} ;
785
826
} else if ( action . type . includes ( nglConstants . ADD_COMPONENT_REPRESENTATION ) ) {
786
827
let objectType = actionObjectType . REPRESENTATION ;
@@ -885,10 +926,17 @@ export const findTrackAction = (action, state) => {
885
926
oldSetting : oldSetting ,
886
927
newSetting : newSetting ,
887
928
getText : function ( ) {
888
- return "Clip far of NGL " + actionDescription . CHANGED + " from value: " + this . oldSetting + " to value: " + this . newSetting ;
929
+ return (
930
+ 'Clip far of NGL ' +
931
+ actionDescription . CHANGED +
932
+ ' from value: ' +
933
+ this . oldSetting +
934
+ ' to value: ' +
935
+ this . newSetting
936
+ ) ;
889
937
} ,
890
938
text : `Clip far of NGL ${ actionDescription . CHANGED } from value: ${ oldSetting } to value: ${ newSetting } `
891
- } ;
939
+ } ;
892
940
} else if ( action . type . includes ( nglConstants . SET_CLIP_DIST ) ) {
893
941
let oldSetting = action . payload . oldValue ;
894
942
let newSetting = action . payload . newValue ;
@@ -904,10 +952,17 @@ export const findTrackAction = (action, state) => {
904
952
oldSetting : oldSetting ,
905
953
newSetting : newSetting ,
906
954
getText : function ( ) {
907
- return "Clip dist of NGL " + actionDescription . CHANGED + " from value: " + this . oldSetting + " to value: " + this . newSetting ;
955
+ return (
956
+ 'Clip dist of NGL ' +
957
+ actionDescription . CHANGED +
958
+ ' from value: ' +
959
+ this . oldSetting +
960
+ ' to value: ' +
961
+ this . newSetting
962
+ ) ;
908
963
} ,
909
964
text : `Clip dist of NGL ${ actionDescription . CHANGED } from value: ${ oldSetting } to value: ${ newSetting } `
910
- } ;
965
+ } ;
911
966
} else if ( action . type . includes ( nglConstants . SET_FOG_NEAR ) ) {
912
967
let oldSetting = action . payload . oldValue ;
913
968
let newSetting = action . payload . newValue ;
@@ -923,10 +978,17 @@ export const findTrackAction = (action, state) => {
923
978
oldSetting : oldSetting ,
924
979
newSetting : newSetting ,
925
980
getText : function ( ) {
926
- return "Fog near of NGL " + actionDescription . CHANGED + " from value: " + this . oldSetting + " to value: " + this . newSetting ;
981
+ return (
982
+ 'Fog near of NGL ' +
983
+ actionDescription . CHANGED +
984
+ ' from value: ' +
985
+ this . oldSetting +
986
+ ' to value: ' +
987
+ this . newSetting
988
+ ) ;
927
989
} ,
928
990
text : `For near of NGL ${ actionDescription . CHANGED } from value: ${ oldSetting } to value: ${ newSetting } `
929
- } ;
991
+ } ;
930
992
} else if ( action . type . includes ( nglConstants . SET_FOG_FAR ) ) {
931
993
let oldSetting = action . payload . oldValue ;
932
994
let newSetting = action . payload . newValue ;
@@ -942,10 +1004,17 @@ export const findTrackAction = (action, state) => {
942
1004
oldSetting : oldSetting ,
943
1005
newSetting : newSetting ,
944
1006
getText : function ( ) {
945
- return "Fog far of NGL " + actionDescription . CHANGED + " from value: " + this . oldSetting + " to value: " + this . newSetting ;
1007
+ return (
1008
+ 'Fog far of NGL ' +
1009
+ actionDescription . CHANGED +
1010
+ ' from value: ' +
1011
+ this . oldSetting +
1012
+ ' to value: ' +
1013
+ this . newSetting
1014
+ ) ;
946
1015
} ,
947
1016
text : `For far of NGL ${ actionDescription . CHANGED } from value: ${ oldSetting } to value: ${ newSetting } `
948
- } ;
1017
+ } ;
949
1018
}
950
1019
}
951
1020
return trackAction ;
@@ -1001,6 +1070,22 @@ const getTypeDescriptionOfSelectedAllAction = type => {
1001
1070
}
1002
1071
} ;
1003
1072
1073
+ const getClipCenterChange = ( oldValue , newValue ) => {
1074
+ let description = '' ;
1075
+ if ( oldValue && newValue ) {
1076
+ if ( oldValue . x !== newValue . x ) {
1077
+ description += ' from value: x:' + oldValue . x + ' to value: x:' + newValue . x ;
1078
+ }
1079
+ if ( oldValue . y !== newValue . y ) {
1080
+ description += ' from value: y:' + oldValue . y + ' to value: y:' + newValue . y ;
1081
+ }
1082
+ if ( oldValue . z !== newValue . z ) {
1083
+ description += ' from value: z:' + oldValue . z + ' to value: z:' + newValue . z ;
1084
+ }
1085
+ }
1086
+ return description ;
1087
+ } ;
1088
+
1004
1089
export const createInitAction = target_on => ( dispatch , getState ) => {
1005
1090
const state = getState ( ) ;
1006
1091
const username = DJANGO_CONTEXT [ 'username' ] ;
0 commit comments