1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-04-14 11:28:37 +02:00

GH-1489: Add Telemetry for Shared Boards (#1610)

* add telemetry for shared boards

* move where setting view out of Routes

* add for configuration setting

* fix spacing

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
Scott Bishel 2021-10-21 11:17:31 -06:00 committed by GitHub
parent d22fe7fbc0
commit d0083f6ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View File

@ -433,11 +433,12 @@ func initTelemetry(opts telemetryOptions) *telemetry.Service {
}) })
telemetryService.RegisterTracker("config", func() (telemetry.Tracker, error) { telemetryService.RegisterTracker("config", func() (telemetry.Tracker, error) {
return map[string]interface{}{ return map[string]interface{}{
"serverRoot": opts.cfg.ServerRoot == config.DefaultServerRoot, "serverRoot": opts.cfg.ServerRoot == config.DefaultServerRoot,
"port": opts.cfg.Port == config.DefaultPort, "port": opts.cfg.Port == config.DefaultPort,
"useSSL": opts.cfg.UseSSL, "useSSL": opts.cfg.UseSSL,
"dbType": opts.cfg.DBType, "dbType": opts.cfg.DBType,
"single_user": opts.singleUser, "single_user": opts.singleUser,
"allow_public_shared_boards": opts.cfg.EnablePublicSharedBoards,
}, nil }, nil
}) })
telemetryService.RegisterTracker("activity", func() (telemetry.Tracker, error) { telemetryService.RegisterTracker("activity", func() (telemetry.Tracker, error) {

View File

@ -14,6 +14,8 @@ import {sendFlashMessage} from '../components/flashMessages'
import Button from '../widgets/buttons/button' import Button from '../widgets/buttons/button'
import Switch from '../widgets/switch' import Switch from '../widgets/switch'
import TelemetryClient, {TelemetryActions, TelemetryCategory} from '../telemetry/telemetryClient'
import Modal from './modal' import Modal from './modal'
import './shareBoardComponent.scss' import './shareBoardComponent.scss'
@ -47,6 +49,7 @@ const ShareBoardComponent = React.memo((props: Props): JSX.Element => {
const newSharing: ISharing = sharing || createSharingInfo() const newSharing: ISharing = sharing || createSharingInfo()
newSharing.id = props.boardId newSharing.id = props.boardId
newSharing.enabled = isOn newSharing.enabled = isOn
TelemetryClient.trackEvent(TelemetryCategory, TelemetryActions.ShareBoard, {board: props.boardId, enabled: isOn})
await client.setSharing(newSharing) await client.setSharing(newSharing)
await loadData() await loadData()
} }

View File

@ -31,6 +31,7 @@ import {UserSettings} from '../userSettings'
import IconButton from '../widgets/buttons/iconButton' import IconButton from '../widgets/buttons/iconButton'
import CloseIcon from '../widgets/icons/close' import CloseIcon from '../widgets/icons/close'
import TelemetryClient, {TelemetryActions, TelemetryCategory} from '../telemetry/telemetryClient'
type Props = { type Props = {
readonly?: boolean readonly?: boolean
} }
@ -151,6 +152,7 @@ const BoardPage = (props: Props): JSX.Element => {
if (props.readonly) { if (props.readonly) {
loadAction = initialReadOnlyLoad loadAction = initialReadOnlyLoad
token = token || queryString.get('r') || '' token = token || queryString.get('r') || ''
TelemetryClient.trackEvent(TelemetryCategory, TelemetryActions.ViewSharedBoard, {board: board.id})
} }
dispatch(loadAction(match.params.boardId)) dispatch(loadAction(match.params.boardId))

View File

@ -12,8 +12,10 @@ export const TelemetryActions = {
CreateBoardViaTemplate: 'createBoardViaTemplate', CreateBoardViaTemplate: 'createBoardViaTemplate',
CreateBoardView: 'createBoardView', CreateBoardView: 'createBoardView',
EditCardProperty: 'editCardProperty', EditCardProperty: 'editCardProperty',
ShareBoard: 'shareBoard',
ViewBoard: 'viewBoard', ViewBoard: 'viewBoard',
ViewCard: 'viewCard', ViewCard: 'viewCard',
ViewSharedBoard: 'viewSharedBoard',
} }
class TelemetryClient { class TelemetryClient {