From ccc2004a8f9440e5e9bf591c15496ecf4bd38504 Mon Sep 17 00:00:00 2001 From: "ryota.sasazawa" Date: Thu, 26 Dec 2024 18:04:48 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20:=20Disable=20GMT=20Loggin?= =?UTF-8?q?g=20on=20Web?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppBar/CopyLinkButton/CopyLinkButton.tsx | 13 +++---- .../ERDRenderer/ERDContent/ERDContent.tsx | 30 ++++++++-------- .../RelatedTables/RelatedTables.tsx | 13 +++---- .../TableNode/TableDetail/TableDetail.tsx | 11 +++--- .../Toolbar/FitviewButton/FitviewButton.tsx | 15 ++++---- .../Toolbar/ShowModeMenu/ShowModeMenu.tsx | 15 ++++---- .../Toolbar/TidyUpButton/TidyUpButton.tsx | 22 +++++------- .../Toolbar/ZoomControls/ZoomControls.tsx | 34 ++++++++++--------- .../components/ERDRenderer/ERDRenderer.tsx | 15 ++++---- .../TableNameMenuButton.tsx | 13 +++---- .../TableNameMenuButton/VisibilityButton.tsx | 17 +++++----- 11 files changed, 102 insertions(+), 96 deletions(-) diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/AppBar/CopyLinkButton/CopyLinkButton.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/AppBar/CopyLinkButton/CopyLinkButton.tsx index e56a2343e..e8f388af1 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/AppBar/CopyLinkButton/CopyLinkButton.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/AppBar/CopyLinkButton/CopyLinkButton.tsx @@ -31,12 +31,13 @@ export const CopyLinkButton: FC = () => { }) }) - clickLogEvent({ - element: 'copyLinkButton', - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) - }, [toast, cliVersion.version, cliVersion.envName]) + cliVersion.displayedOn === 'cli' && + clickLogEvent({ + element: 'copyLinkButton', + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) + }, [toast, cliVersion]) return ( diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/ERDContent.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/ERDContent.tsx index 552b15e48..cf7bcb335 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/ERDContent.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/ERDContent.tsx @@ -68,14 +68,15 @@ export const ERDContentInner: FC = ({ const handleNodeClick = useCallback( (tableId: string) => { updateActiveTableName(tableId) - selectTableLogEvent({ - ref: 'mainArea', - tableId, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + selectTableLogEvent({ + ref: 'mainArea', + tableId, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) }, - [cliVersion.version, cliVersion.envName], + [cliVersion], ) const handlePaneClick = useCallback(() => { @@ -115,15 +116,16 @@ export const ERDContentInner: FC = ({ const operationId = `id_${new Date().getTime()}` for (const node of nodes) { const tableId = node.id - repositionTableLogEvent({ - tableId, - operationId, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + repositionTableLogEvent({ + tableId, + operationId, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) } }, - [cliVersion.version, cliVersion.envName], + [cliVersion], ) const panOnDrag = [1, 2] diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/RelatedTables/RelatedTables.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/RelatedTables/RelatedTables.tsx index b7849a2f4..4f153ccd9 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/RelatedTables/RelatedTables.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/RelatedTables/RelatedTables.tsx @@ -36,12 +36,13 @@ export const RelatedTables: FC = ({ table }) => { replaceHiddenNodeIds(hiddenNodeIds) updateActiveTableName(undefined) - openRelatedTablesLogEvent({ - tableId: table.name, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) - }, [nodes, getNodes, table.name, cliVersion.version, cliVersion.envName]) + cliVersion.displayedOn === 'cli' && + openRelatedTablesLogEvent({ + tableId: table.name, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) + }, [nodes, getNodes, table.name, cliVersion]) return (
diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/TableDetail.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/TableDetail.tsx index 24977c58c..0bfef408a 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/TableDetail.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/TableDetail.tsx @@ -17,11 +17,12 @@ type Props = { export const TableDetail: FC = ({ table }) => { const { cliVersion } = useCliVersion() const handleDrawerClose = () => { - clickLogEvent({ - element: 'closeTableDetailButton', - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + clickLogEvent({ + element: 'closeTableDetailButton', + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) } return ( diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/FitviewButton/FitviewButton.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/FitviewButton/FitviewButton.tsx index 669df785a..3b96979cd 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/FitviewButton/FitviewButton.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/FitviewButton/FitviewButton.tsx @@ -12,14 +12,15 @@ export const FitviewButton: FC = () => { const { cliVersion } = useCliVersion() const handleClick = useCallback(() => { - toolbarActionLogEvent({ - element: 'fitview', - showMode, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + toolbarActionLogEvent({ + element: 'fitview', + showMode, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) fitView() - }, [fitView, showMode, cliVersion.version, cliVersion.envName]) + }, [fitView, showMode, cliVersion]) return ( diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/ShowModeMenu/ShowModeMenu.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/ShowModeMenu/ShowModeMenu.tsx index cc0907ec8..b8a3b1eb2 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/ShowModeMenu/ShowModeMenu.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/ShowModeMenu/ShowModeMenu.tsx @@ -33,15 +33,16 @@ export const ShowModeMenu: FC = () => { if (parsed.success) { updateShowMode(parsed.output) - toolbarActionLogEvent({ - element: 'changeShowMode', - showMode: value, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + toolbarActionLogEvent({ + element: 'changeShowMode', + showMode: value, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) } }, - [cliVersion.version, cliVersion.envName], + [cliVersion], ) return ( diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/TidyUpButton/TidyUpButton.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/TidyUpButton/TidyUpButton.tsx index 6c80a1aa9..a9996bffb 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/TidyUpButton/TidyUpButton.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/TidyUpButton/TidyUpButton.tsx @@ -13,21 +13,15 @@ export const TidyUpButton: FC = () => { const { showMode } = useUserEditingStore() const { cliVersion } = useCliVersion() const handleClick = useCallback(() => { - toolbarActionLogEvent({ - element: 'tidyUp', - showMode, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + toolbarActionLogEvent({ + element: 'tidyUp', + showMode, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) handleLayout(getNodes(), getEdges()) - }, [ - handleLayout, - showMode, - getNodes, - getEdges, - cliVersion.version, - cliVersion.envName, - ]) + }, [handleLayout, showMode, getNodes, getEdges, cliVersion]) return ( diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/ZoomControls/ZoomControls.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/ZoomControls/ZoomControls.tsx index 9453e6404..5659a071a 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/ZoomControls/ZoomControls.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Toolbar/ZoomControls/ZoomControls.tsx @@ -14,26 +14,28 @@ export const ZoomControls: FC = () => { const { cliVersion } = useCliVersion() const handleClickZoomOut = useCallback(() => { - toolbarActionLogEvent({ - element: 'zoom', - zoomLevel: zoomLevel.toFixed(2), - showMode, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + toolbarActionLogEvent({ + element: 'zoom', + zoomLevel: zoomLevel.toFixed(2), + showMode, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) zoomOut() - }, [zoomOut, zoomLevel, showMode, cliVersion.version, cliVersion.envName]) + }, [zoomOut, zoomLevel, showMode, cliVersion]) const handleClickZoomIn = useCallback(() => { - toolbarActionLogEvent({ - element: 'zoom', - zoomLevel: zoomLevel.toFixed(2), - showMode: showMode, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + toolbarActionLogEvent({ + element: 'zoom', + zoomLevel: zoomLevel.toFixed(2), + showMode: showMode, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) zoomIn() - }, [zoomIn, zoomLevel, showMode, cliVersion.version, cliVersion.envName]) + }, [zoomIn, zoomLevel, showMode, cliVersion]) return (
diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/ERDRenderer.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/ERDRenderer.tsx index a76403426..c06e71661 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/ERDRenderer.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/ERDRenderer.tsx @@ -35,14 +35,15 @@ export const ERDRenderer: FC = ({ defaultSidebarOpen = false }) => { const handleChangeOpen = useCallback( (open: boolean) => { setOpen(open) - toggleLogEvent({ - element: 'leftPane', - isShow: open, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + toggleLogEvent({ + element: 'leftPane', + isShow: open, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) }, - [cliVersion.version, cliVersion.envName], + [cliVersion], ) return ( diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/LeftPane/TableNameMenuButton/TableNameMenuButton.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/LeftPane/TableNameMenuButton/TableNameMenuButton.tsx index 8af89dd7b..0ac06d7c6 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/LeftPane/TableNameMenuButton/TableNameMenuButton.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/LeftPane/TableNameMenuButton/TableNameMenuButton.tsx @@ -20,12 +20,13 @@ export const TableNameMenuButton: FC = ({ node }) => { const { cliVersion } = useCliVersion() const handleClickMenuButton = (tableId: string) => () => { updateActiveTableName(tableId) - selectTableLogEvent({ - ref: 'leftPane', - tableId, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + selectTableLogEvent({ + ref: 'leftPane', + tableId, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) } return ( diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/LeftPane/TableNameMenuButton/VisibilityButton.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/LeftPane/TableNameMenuButton/VisibilityButton.tsx index 3ef1f9a8d..eefb56803 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/LeftPane/TableNameMenuButton/VisibilityButton.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/LeftPane/TableNameMenuButton/VisibilityButton.tsx @@ -16,15 +16,16 @@ export const VisibilityButton: FC = ({ tableName, hidden }) => { (event: MouseEvent) => { event.stopPropagation() toggleHiddenNodeId(tableName) - toggleLogEvent({ - element: 'tableNameMenuButton', - isShow: !!hidden, - tableId: tableName, - cliVer: cliVersion.version, - appEnv: cliVersion.envName, - }) + cliVersion.displayedOn === 'cli' && + toggleLogEvent({ + element: 'tableNameMenuButton', + isShow: !!hidden, + tableId: tableName, + cliVer: cliVersion.version, + appEnv: cliVersion.envName, + }) }, - [tableName, hidden, cliVersion.version, cliVersion.envName], + [tableName, hidden, cliVersion], ) return (