Skip to content

Commit

Permalink
Merge pull request #341 from ishitatsuyuki/chartjs4
Browse files Browse the repository at this point in the history
Co-authored-by: Erik Bjäreholt <erik@bjareho.lt>
  • Loading branch information
ErikBjare committed Jun 8, 2022
2 parents 0770b2f + 6f5278a commit faf68e1
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 177 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.json
@@ -1,14 +1,15 @@
{
"plugins": ["prettier", "vue", "jest", "@typescript-eslint"],
"extends": [
"prettier",
"plugin:vue/essential",
"eslint:recommended",
"plugin:vue/recommended",
"@vue/typescript",
"plugin:jest/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended"
"plugin:@typescript-eslint/eslint-recommended",
"prettier",
"prettier/vue"
],
"rules": {
"prettier/prettier": "warn",
Expand Down
84 changes: 17 additions & 67 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -32,7 +32,7 @@
"aw-client": "^0.3.2",
"bootstrap": "^4.6.1",
"bootstrap-vue": "^2.15.0",
"chart.js": "^2.9.3",
"chart.js": "^3.8.0",
"color": "^3.0.0",
"component-emitter": "^1.3.0",
"core-js": "^3.19.3",
Expand All @@ -58,7 +58,7 @@
"vis-timeline": "^7.5.0",
"vis-util": "^5.0.2",
"vue-awesome": "^3.5.1",
"vue-chartjs": "^3.5.0",
"vue-chartjs": "^4.1.0",
"vue-color": "^2.8.1",
"vue-d3-sunburst": "^1.9.0",
"vue-datetime": "^1.0.0-beta.13",
Expand Down
9 changes: 8 additions & 1 deletion src/components/SelectableVisualization.vue
Expand Up @@ -239,10 +239,17 @@ export default {
}
},
datasets: function () {
return buildBarchartDataset(
// Return empty array if not loaded
if (!this.activityStore.category.by_period) return [];
const datasets = buildBarchartDataset(
this.activityStore.category.by_period,
this.categoryStore.classes
);
// Return dataset if data found, else return null (indicating no data)
if (datasets.length > 1) return datasets;
else return null;
},
date: function () {
let date = this.activityStore.query_options.date;
Expand Down
4 changes: 2 additions & 2 deletions src/stores/activity.ts
Expand Up @@ -184,7 +184,7 @@ export const useActivityStore = defineStore('activity', {

if (this.window.available) {
// Perform this last, as it takes the longest
await this.query_category_time_by_period(query_options);
await this.query_category_time_by_period({ ...query_options, dontQueryInactive: true });
}
} else {
console.warn(
Expand Down Expand Up @@ -305,7 +305,7 @@ export const useActivityStore = defineStore('activity', {
filterCategories,
filterAFK,
dontQueryInactive,
}: QueryOptions & { dontQueryInactive: string }) {
}: QueryOptions & { dontQueryInactive: boolean }) {
// TODO: Needs to be adapted for Android
let periods: string[];
if (timeperiod.length[1].startsWith('day')) {
Expand Down

1 comment on commit faf68e1

@github-actions
Copy link

Choose a reason for hiding this comment

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

Here are screenshots of this commit:

Screenshots using aw-server v0.11.0 (click to expand)

Screenshots using aw-server-rust master (click to expand)

Screenshots using aw-server-rust v0.11.0 (click to expand)

CML watermark

Please sign in to comment.