Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

feat: OPTIC-9: Event logging prework #1617

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Timeline/Controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const Controls: FC<TimelineControlsProps> = memo(({

const handlePlay = useCallback(() => {
playing ? onPause?.() : onPlay?.();
//fb-optic-9: event logging: Play/Pause video
}, [playing, onPlay, onPause]);

const onSetVolumeModal = (e: MouseEvent<HTMLButtonElement>) => {
Expand Down
1 change: 1 addition & 0 deletions src/components/Timeline/Seeker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const Seeker: FC<SeekerProps> = ({
const percent = newOffset / parentWidth;
const newPosition = Math.ceil(length * percent);

//fb-optic-9: event logging: onSeekerDrag
onSeek?.(newPosition);
};

Expand Down
2 changes: 1 addition & 1 deletion src/core/Hotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const Hotkey = (

e.stopPropagation();
e.preventDefault();

//fb-optic-9: event logging: on hotkey press
func(...args);
};

Expand Down
1 change: 1 addition & 0 deletions src/mixins/Regions.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ const RegionsMixin = types
const connectedRegions = self.getConnectedDynamicRegions(destroy);

env.events.invoke('regionFinishedDrawing', self, connectedRegions);
//fb-optic-9: event logging: onRegionFinishedDrawing
}, timeout);
}
},
Expand Down
1 change: 1 addition & 0 deletions src/regions/PolygonRegion.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ const Model = types
},

addPoint(x, y) {
//fb-optic-9: event logging: polygon draw events addPoint
if (self.closed) return;

const point = self.control?.getSnappedPoint({ x, y });
Expand Down
3 changes: 2 additions & 1 deletion src/stores/Annotation/Annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ export const Annotation = types
if (region.type === 'polygonregion') {
detach(region);
}

//fb-optic-9: event logging: mouse deleteArea'
destroy(region);

// If the annotation was in a drawing state and the user deletes it, we need to reset the drawing state
Expand Down Expand Up @@ -775,6 +775,7 @@ export const Annotation = types
}

if (self.userGenerate && !self.sentUserGenerate) {
//fb-optic-9: event logging: annotation loaded
self.loadedDate = new Date();
}
},
Expand Down
2 changes: 2 additions & 0 deletions src/tags/object/AudioNext/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const AudioNextView: FC<AudioNextProps> = ({ item }) => {
}, []);

const handlePlay = useCallback(() => {
//fb-optic-9: event logging: start playing audio
setPlaying((playing) => {
if (!item._ws) return false;

Expand All @@ -69,6 +70,7 @@ const AudioNextView: FC<AudioNextProps> = ({ item }) => {
}, [item, playing]);

const handlePause = useCallback(() => {
//fb-optic-9: event logging: stop playing audio
setPlaying((playing) => {
if (!item._ws) return false;

Expand Down
2 changes: 2 additions & 0 deletions src/tags/object/Video/Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ const Model = types
},

triggerSyncPlay() {
//fb-optic-9: event logging: start playing video
self.triggerSync('play', { playing: true });
},

triggerSyncPause() {
//fb-optic-9: event logging: start playing audio
self.triggerSync('pause', { playing: false });
},

Expand Down
2 changes: 2 additions & 0 deletions src/tools/Polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const _Tool = types
},

startDrawing(x, y) {
//fb-optic-9: event logging: polygon draw events startDrawing
const point = self.control?.getSnappedPoint({ x, y });

if (isFF(FF_DEV_2432)) {
Expand All @@ -126,6 +127,7 @@ const _Tool = types
},

_finishDrawing() {
//fb-optic-9: event logging: polygon draw events _finishDrawing
if (isFF(FF_DEV_2432)) {
const { currentArea, control } = self;

Expand Down