Skip to content

See host even if only editor buckets exist#186

Merged
johan-bjareholt merged 2 commits intomasterfrom
dev/make-queries-less-dependent
Apr 21, 2020
Merged

See host even if only editor buckets exist#186
johan-bjareholt merged 2 commits intomasterfrom
dev/make-queries-less-dependent

Conversation

@johan-bjareholt
Copy link
Copy Markdown
Member

Fixes #184


// getters
const getters = {
afkBuckets(state) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread src/store/modules/activity_daily.ts Outdated
return [start, end].join('/');
}

function get_buckets_by_type(buckets, type) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, but duplicated code (also in modules/buckets.js).

Move all of it there?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the plan, hence the comment below

// TODO: re-use modules/buckets.js instead of doing a second getBuckets call

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, could still have done an import for this particular helper function in the meantime, but whatever if you're going to fix it before merging.

@johan-bjareholt johan-bjareholt force-pushed the dev/make-queries-less-dependent branch from 55c7482 to 31aec5f Compare April 19, 2020 07:46
@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com Bot commented Apr 19, 2020

This pull request introduces 2 alerts when merging 31aec5f into 3451196 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

icon(name="arrow-right")
div.p-1
b-select(:value="periodLength", :options="['day', 'week', 'month']",
b-select(:value="periodLength", :options="['day', 'week', 'month', 'year']",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooof, going to get some HTTP timeouts until aw-server-rust becomes the default.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, commited by mistake.

Comment thread src/components/Header.vue

_.each(types_by_host, (types, hostname) => {
if (types.afk && types.window) {
if (hostname != 'unknown') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this makes the _.each over types unnecessary?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure due to the android related code, don't want to break it by mistake.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Android view is getting merged with the normal view in #183 anyway, so feel free to remove that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'll be easier if you fix it in that change instead.

@johan-bjareholt johan-bjareholt force-pushed the dev/make-queries-less-dependent branch from 31aec5f to 0402013 Compare April 19, 2020 17:14
@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com Bot commented Apr 19, 2020

This pull request introduces 2 alerts when merging 0402013 into 3451196 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@johan-bjareholt johan-bjareholt force-pushed the dev/make-queries-less-dependent branch 2 times, most recently from 82c9817 to 1dfa250 Compare April 19, 2020 17:28
@johan-bjareholt johan-bjareholt changed the title WIP: See host even if only editor buckets exist See host even if only editor buckets exist Apr 19, 2020
@johan-bjareholt
Copy link
Copy Markdown
Member Author

@ErikBjare Seems to work fine now and fixed some minor oddities, do you have any more comments or should I merge?

Comment thread src/store/modules/activity_daily.ts Outdated
commit('query_window_completed', data[0]);
async query_window({ state, commit }, { host, timeperiod, filterAFK, filterCategories }: QueryOptions) {
if (state.buckets.afk_buckets.length > 0 &&
state.buckets.window_buckets.length > 0) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a fan of this check being here. Bucket-requirements should imo be checked in ensure_loaded and the start_loading thing should be called in the individual queries instead of one-fits-all.

Not a blocker for this PR, but would be nice if you could add that as a TODO comment in the code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a fan of this check being here. Bucket-requirements should imo be checked in ensure_loaded

Done

the start_loading thing should be called in the individual queries instead of one-fits-all.

Not sure what you mean by this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant exactly what you changed it to, nice!

@johan-bjareholt johan-bjareholt force-pushed the dev/make-queries-less-dependent branch from fd08f96 to f167565 Compare April 21, 2020 06:31
@johan-bjareholt johan-bjareholt merged commit 6379134 into master Apr 21, 2020
@johan-bjareholt johan-bjareholt deleted the dev/make-queries-less-dependent branch April 21, 2020 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Why do I need an AFK and window watcher to get an activity report

2 participants