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