Skip to content

Commit

Permalink
change: sort items of search & way to track event
Browse files Browse the repository at this point in the history
  • Loading branch information
cnwangjie committed Sep 29, 2018
1 parent 8635b37 commit 07dbb54
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### v1.3.9 9/29/2018

- feat: add an option to allow open tabs at the ending
- change: sort items of search

### v1.3.8 9/21/2018

- fix: popup simple list is too short
Expand Down
6 changes: 4 additions & 2 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const setupContextMenus = async ({pageContext, allContext}) => {
window.contextMenusClickedHandler = info => {
console.log('context menu clicked', info.menuItemId)
_.get(menus, info.menuItemId)()
if (PRODUCTION) ga('send', 'event', 'Menu clicked', info.menuItemId)
}
console.groupCollapsed('create context menu', contexts)
await createMenus(menus)
Expand Down Expand Up @@ -133,7 +134,7 @@ const commandHandler = async command => {
return storage.setLists(lists)
} else if (command === 'open-lists') tabs.openTabLists()
else return true
if (PRODUCTION) ga('send', 'event', 'Command', 'used', command)
if (PRODUCTION) ga('send', 'event', 'Command used', command)
}

const init = async () => {
Expand All @@ -152,7 +153,7 @@ const init = async () => {
if (changes.browserAction) updateBrowserAction(changes.browserAction)
if (('pageContext' in changes) || ('allContext' in changes)) await setupContextMenus(changes)
await browser.runtime.sendMessage({optionsChangeHandledStatus: 'success'})
if (PRODUCTION) Object.keys(changes).map(key => ga('send', 'event', 'Options', key + ':' + changes[key]))
if (PRODUCTION) Object.keys(changes).map(key => ga('send', 'event', 'Options changed', key, changes[key]))
}
if (msg.restoreList) {
const {restoreList} = msg
Expand All @@ -167,6 +168,7 @@ const init = async () => {
lists.splice(listIndex, 1)
storage.setLists(lists)
}
if (PRODUCTION) ga('send', 'event', 'Popup item clicked')
}
if (msg.uploadImmediate) {
boss.uploadImmediate().catch(() => {
Expand Down
2 changes: 2 additions & 0 deletions src/component/ImportExportPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export default {
this.snackbar = true
this.processing = false
}
if (PRODUCTION) ga('send', 'event', 'IES', 'export', comp)
},
async imp(comp) {
if (this.processing) {
Expand Down Expand Up @@ -121,6 +122,7 @@ export default {
this.snackbar = true
this.processing = false
}
if (PRODUCTION) ga('send', 'event', 'IES', 'import', comp)
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/page/DetailList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
single-line
hide-details
></v-text-field>
<strong class="list-title" v-else>{{ list.title }}</strong>
<strong class="list-title" v-else :class="list.color ? list.color + '--text' : ''">{{ list.title }}</strong>
</v-flex>
<v-flex xs2 class="text-xs-right">
<v-btn :title="__('ui_title_down_btn')" @click.stop="moveListDown(listIndex)" flat icon class="icon-in-title" :disabled="listIndex === lists.length - 1">
Expand Down Expand Up @@ -189,7 +189,7 @@ export default {
value: {listIndex},
color: list.color || '',
}))
return _.flatten(tabs).concat(lists)
return _.sortBy(_.flatten(tabs).concat(lists), 'title')
},
},
created() {
Expand Down
5 changes: 5 additions & 0 deletions src/page/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export default {
async nightmode(newValue) {
const window = await browser.runtime.getBackgroundPage()
window.nightmode = newValue
if (PRODUCTION) ga('send', 'event', 'Nightmode switch', newValue)
},
},
created() {
Expand Down Expand Up @@ -169,6 +170,10 @@ export default {
browser.runtime.sendMessage({uploadImmediate: true})
this.syncing = true
}
if (PRODUCTION) {
if (this.conflict) ga('send', 'event', 'Sync btn clicked', 'conflict')
else ga('send', 'event', 'Sync btn clicked', 'upload')
}
},
async switchNightMode() {
const window = await browser.runtime.getBackgroundPage()
Expand Down

0 comments on commit 07dbb54

Please sign in to comment.