1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-04-11 11:19:56 +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) {
return map[string]interface{}{
"serverRoot": opts.cfg.ServerRoot == config.DefaultServerRoot,
"port": opts.cfg.Port == config.DefaultPort,
"useSSL": opts.cfg.UseSSL,
"dbType": opts.cfg.DBType,
"single_user": opts.singleUser,
"serverRoot": opts.cfg.ServerRoot == config.DefaultServerRoot,
"port": opts.cfg.Port == config.DefaultPort,
"useSSL": opts.cfg.UseSSL,
"dbType": opts.cfg.DBType,
"single_user": opts.singleUser,
"allow_public_shared_boards": opts.cfg.EnablePublicSharedBoards,
}, nil
})
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 Switch from '../widgets/switch'
import TelemetryClient, {TelemetryActions, TelemetryCategory} from '../telemetry/telemetryClient'
import Modal from './modal'
import './shareBoardComponent.scss'
@ -47,6 +49,7 @@ const ShareBoardComponent = React.memo((props: Props): JSX.Element => {
const newSharing: ISharing = sharing || createSharingInfo()
newSharing.id = props.boardId
newSharing.enabled = isOn
TelemetryClient.trackEvent(TelemetryCategory, TelemetryActions.ShareBoard, {board: props.boardId, enabled: isOn})
await client.setSharing(newSharing)
await loadData()
}

View File

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

View File

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