summarylogtreecommitdiffstats
path: root/remove-analytics.patch
blob: 495bfa18cb467a01c7ec6584660471b71f7b49bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
diff -ura a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js
--- a/browser/main/Detail/MarkdownNoteDetail.js	2018-02-03 15:50:49.000000000 +0100
+++ b/browser/main/Detail/MarkdownNoteDetail.js	2018-02-03 20:09:12.234732983 +0100
@@ -15,7 +15,6 @@
 import StatusBar from '../StatusBar'
 import _ from 'lodash'
 import { findNoteTitle } from 'browser/lib/findNoteTitle'
-import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
 import ConfigManager from 'browser/main/lib/ConfigManager'
 import TrashButton from './TrashButton'
 import FullscreenButton from './FullscreenButton'
@@ -114,7 +113,6 @@
           type: 'UPDATE_NOTE',
           note: note
         })
-        AwsMobileAnalyticsConfig.recordDynamicCustomEvent('EDIT_NOTE')
       })
   }
 
@@ -153,7 +151,6 @@
 
   handleStarButtonClick (e) {
     const { note } = this.state
-    if (!note.isStarred) AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_STAR')
 
     note.isStarred = !note.isStarred
 
diff -ura a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js
--- a/browser/main/Detail/SnippetNoteDetail.js	2018-02-03 15:50:49.000000000 +0100
+++ b/browser/main/Detail/SnippetNoteDetail.js	2018-02-03 20:09:42.484969287 +0100
@@ -18,7 +18,6 @@
 import ConfigManager from 'browser/main/lib/ConfigManager'
 import _ from 'lodash'
 import { findNoteTitle } from 'browser/lib/findNoteTitle'
-import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
 import TrashButton from './TrashButton'
 import PermanentDeleteButton from './PermanentDeleteButton'
 import InfoButton from './InfoButton'
@@ -119,7 +118,6 @@
           type: 'UPDATE_NOTE',
           note: note
         })
-        AwsMobileAnalyticsConfig.recordDynamicCustomEvent('EDIT_NOTE')
       })
   }
 
@@ -158,7 +156,6 @@
 
   handleStarButtonClick (e) {
     const { note } = this.state
-    if (!note.isStarred) AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_STAR')
 
     note.isStarred = !note.isStarred
 
@@ -295,9 +292,6 @@
     const mode = syntax != null ? syntax.name : null
     if (mode != null) {
       snippets[index].mode = mode
-      AwsMobileAnalyticsConfig.recordDynamicCustomEvent('SNIPPET_LANG', {
-        name: mode
-      })
     }
     this.setState({note: Object.assign(this.state.note, {snippets: snippets})})
 
@@ -319,10 +313,6 @@
       }, () => {
         this.save()
       })
-
-      AwsMobileAnalyticsConfig.recordDynamicCustomEvent('SELECT_LANG', {
-        name
-      })
     }
   }
 
diff -ura a/browser/main/Detail/TagSelect.js b/browser/main/Detail/TagSelect.js
--- a/browser/main/Detail/TagSelect.js	2018-02-03 15:50:49.000000000 +0100
+++ b/browser/main/Detail/TagSelect.js	2018-02-03 20:09:55.258402188 +0100
@@ -3,7 +3,6 @@
 import CSSModules from 'browser/lib/CSSModules'
 import styles from './TagSelect.styl'
 import _ from 'lodash'
-import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
 
 class TagSelect extends React.Component {
   constructor (props) {
@@ -62,7 +61,6 @@
   }
 
   submitTag () {
-    AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_TAG')
     let { value } = this.props
     let newTag = this.refs.newTag.value.trim().replace(/ +/g, '_')
     newTag = newTag.charAt(0) === '#' ? newTag.substring(1) : newTag
diff -ura a/browser/main/Main.js b/browser/main/Main.js
--- a/browser/main/Main.js	2018-02-03 15:50:49.000000000 +0100
+++ b/browser/main/Main.js	2018-02-03 20:10:06.555156814 +0100
@@ -10,7 +10,6 @@
 import dataApi from 'browser/main/lib/dataApi'
 import _ from 'lodash'
 import ConfigManager from 'browser/main/lib/ConfigManager'
-import mobileAnalytics from 'browser/main/lib/AwsMobileAnalyticsConfig'
 import eventEmitter from 'browser/main/lib/eventEmitter'
 import { hashHistory } from 'react-router'
 import store from 'browser/main/store'
@@ -23,10 +22,6 @@
   constructor (props) {
     super(props)
 
-    if (process.env.NODE_ENV === 'production') {
-      mobileAnalytics.initAwsMobileAnalytics()
-    }
-
     const { config } = props
 
     this.state = {
diff -ura a/browser/main/modals/CreateFolderModal.js b/browser/main/modals/CreateFolderModal.js
--- a/browser/main/modals/CreateFolderModal.js	2018-02-03 15:50:49.000000000 +0100
+++ b/browser/main/modals/CreateFolderModal.js	2018-02-03 20:10:18.531916639 +0100
@@ -6,7 +6,6 @@
 import store from 'browser/main/store'
 import consts from 'browser/lib/consts'
 import ModalEscButton from 'browser/components/ModalEscButton'
-import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
 
 class CreateFolderModal extends React.Component {
   constructor (props) {
@@ -50,7 +49,6 @@
   }
 
   confirm () {
-    AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_FOLDER')
     if (this.state.name.trim().length > 0) {
       const { storage } = this.props
       const input = {
diff -ura a/browser/main/modals/NewNoteModal.js b/browser/main/modals/NewNoteModal.js
--- a/browser/main/modals/NewNoteModal.js	2018-02-03 15:50:49.000000000 +0100
+++ b/browser/main/modals/NewNoteModal.js	2018-02-03 20:10:36.618723812 +0100
@@ -5,7 +5,6 @@
 import { hashHistory } from 'react-router'
 import ee from 'browser/main/lib/eventEmitter'
 import ModalEscButton from 'browser/components/ModalEscButton'
-import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
 
 class NewNoteModal extends React.Component {
   constructor (props) {
@@ -24,8 +23,6 @@
   }
 
   handleMarkdownNoteButtonClick (e) {
-    AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_MARKDOWN')
-    AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE')
     const { storage, folder, dispatch, location } = this.props
     dataApi
       .createNote(storage, {
@@ -56,8 +53,6 @@
   }
 
   handleSnippetNoteButtonClick (e) {
-    AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_SNIPPET')
-    AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE')
     const { storage, folder, dispatch, location } = this.props
 
     dataApi
diff -ura a/browser/main/modals/PreferencesModal/InfoTab.js b/browser/main/modals/PreferencesModal/InfoTab.js
--- a/browser/main/modals/PreferencesModal/InfoTab.js	2018-02-03 15:50:49.000000000 +0100
+++ b/browser/main/modals/PreferencesModal/InfoTab.js	2018-02-03 20:11:18.522381924 +0100
@@ -3,7 +3,6 @@
 import styles from './InfoTab.styl'
 import ConfigManager from 'browser/main/lib/ConfigManager'
 import store from 'browser/main/store'
-import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
 import _ from 'lodash'
 
 const electron = require('electron')
@@ -24,47 +23,6 @@
     e.preventDefault()
   }
 
-  handleConfigChange (e) {
-    const newConfig = { amaEnabled: this.refs.amaEnabled.checked }
-
-    this.setState({ config: newConfig })
-  }
-
-  handleSaveButtonClick (e) {
-    const newConfig = {
-      amaEnabled: this.state.config.amaEnabled
-    }
-
-    if (!newConfig.amaEnabled) {
-      AwsMobileAnalyticsConfig.recordDynamicCustomEvent('DISABLE_AMA')
-      this.setState({
-        amaMessage: 'We hope we will gain your trust'
-      })
-    } else {
-      this.setState({
-        amaMessage: 'Thank\'s for trust us'
-      })
-    }
-
-    _.debounce(() => {
-      this.setState({
-        amaMessage: ''
-      })
-    }, 3000)()
-
-    ConfigManager.set(newConfig)
-
-    store.dispatch({
-      type: 'SET_CONFIG',
-      config: newConfig
-    })
-  }
-
-  infoMessage () {
-    const { amaMessage } = this.state
-    return amaMessage ? <p styleName='policy-confirm'>{amaMessage}</p> : null
-  }
-
   render () {
     return (
       <div styleName='root'>
@@ -134,23 +92,6 @@
             License: GPL v3
           </li>
         </ul>
-
-        <hr styleName='separate-line' />
-
-        <div styleName='policy'>Analytics</div>
-        <div>Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.</div>
-        <div>You can see how it works on <a href='https://github.com/BoostIO/Boostnote' onClick={(e) => this.handleLinkClick(e)}>GitHub</a>.</div>
-        <br />
-        <div>You can choose to enable or disable this option.</div>
-        <input onChange={(e) => this.handleConfigChange(e)}
-          checked={this.state.config.amaEnabled}
-          ref='amaEnabled'
-          type='checkbox'
-        />
-        Enable analytics to help improve Boostnote<br />
-        <button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>Save</button>
-        <br />
-        {this.infoMessage()}
       </div>
     )
   }
diff -ura a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js
--- a/browser/main/NoteList/index.js	2018-02-03 15:50:49.000000000 +0100
+++ b/browser/main/NoteList/index.js	2018-02-03 20:11:51.695971715 +0100
@@ -13,7 +13,6 @@
 import fs from 'fs'
 import path from 'path'
 import { hashHistory } from 'react-router'
-import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
 
 const { remote } = require('electron')
 const { Menu, MenuItem, dialog } = remote
@@ -536,7 +535,6 @@
             note: newNote
           })
         })
-        AwsMobileAnalyticsConfig.recordDynamicCustomEvent('EDIT_NOTE')
         console.log('Notes went to trash')
       })
       .catch((err) => {
@@ -555,8 +553,6 @@
     const firstNote = selectedNotes[0]
     const eventName = firstNote.type === 'MARKDOWN_NOTE' ? 'ADD_MARKDOWN' : 'ADD_SNIPPET'
 
-    AwsMobileAnalyticsConfig.recordDynamicCustomEvent(eventName)
-    AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE')
     dataApi
       .createNote(storage.key, {
         type: firstNote.type,
diff -ura a/package.json b/package.json
--- a/package.json	2018-02-03 15:50:49.000000000 +0100
+++ b/package.json	2018-02-03 20:12:05.236076244 +0100
@@ -50,8 +50,6 @@
   "dependencies": {
     "@rokt33r/markdown-it-math": "^4.0.1",
     "@rokt33r/season": "^5.3.0",
-    "aws-sdk": "^2.48.0",
-    "aws-sdk-mobile-analytics": "^0.9.2",
     "codemirror": "^5.19.0",
     "codemirror-mode-elixir": "^1.1.1",
     "electron-config": "^0.2.1",