VolkovLabs / business-calendar

Display events and set time range for @grafana
https://docs.volkovlabs.io
Apache License 2.0
44 stars 3 forks source link

Changing a filter modifies the calendar display dates #153

Closed bryan20002024 closed 7 months ago

bryan20002024 commented 7 months ago

I am using the BigCalendar view of the Calendar plugin version 2.3.1. I have several variables that customize my query data that loads the calendar. When I modify the variables in the dashboard, the date view changes within the Calendar display. This appears to happen every other time that I change the filter. See attached images showing the initial view, the change of the filter, and then the second change of the filter updating the dates. I believe the same dates should be show no matter how many times I change the filter.

start status filter changed status filter changes date

asimonok commented 7 months ago

@bryan20002024 thanks for opening the issue. I didn't manage to reproduce the problem. Please provide more details related the issue, ideally your dashboard json.

bryan20002024 commented 7 months ago

Here is the JSON, does that help?

{ "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "description": "Shows engagements from Jira on a calendar", "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": 60, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "influxdb", "uid": "LBlRvy0Vz" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "#63666a", "mode": "fixed" }, "links": [ { "targetBlank": true, "title": "Open in Jira", "url": https://jiraserver.com/browse/${__value.raw} } ], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 21, "w": 24, "x": 0, "y": 0 }, "id": 1, "options": { "annotations": false, "annotationsLimit": 100, "annotationsType": "", "autoScroll": false, "calendarType": "bigCalendar", "colors": "frame", "defaultView": "year", "descriptionField": "Text", "displayTime": false, "endTimeField": "End time", "locationField": "Text", "quickLinks": true, "scrollToTime": { "hours": 0, "minutes": 0 }, "textField": "Key", "timeField": "Start time", "views": [ "day", "week", "month", "work_week", "year" ] }, "pluginVersion": "10.0.3", "targets": [ { "datasource": { "type": "influxdb", "uid": "LBlRvy0Vz" }, "query": "import \"influxdata/influxdb/schema\"\r\nfrom(bucket: \"cc_metrics\")\r\n |> range(start: -12h)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"engagements\")\r\n |> filter(fn: (r) => r[\"business_unit\"] =~ /^${BusinessUnit:regex}$/)\r\n |> filter(fn: (r) => r[\"status\"] =~ /^${Status:regex}$/)\r\n |> filter(fn: (r) => r[\"engagement_type\"] =~ /^${EngagementType:regex}$/) \r\n |> filter(fn: (r) => r[\"project\"] =~ /^${Project:regex}$/)\r\n |> schema.fieldsAsCols()\r\n |> filter(fn: (r) => (r.labels !~ /2022/ and r.labels !~ /2023/) or not exists r.labels)\r\n |> group()\r\n |> sort(columns: [\"_time\"], desc: true)\r\n |> unique(column: \"jira_key\")\r\n |> map(fn: (r) => ({r with uid: if exists r.id then r.id else r.jira_key}))\r\n |> map(fn: (r) => ({r with end_date: if exists r.end_date then r.end_date else r.start_date}))\r\n |> unique(column: \"uid\")\r\n |> map(fn: (r) => ({\"01\": r.jira_key, \"02\": r.summary, \"11\": r.start_date, \"12\": r.end_date}))\r\n |> rename(fn: (column) => { \r\n columnName = if column == \"01\" then \"Key\" \r\n else if column == \"02\" then \"Text\"\r\n else if column == \"11\" then \"Start time\"\r\n else if column == \"12\" then \"End time\"\r\n else column\r\n return columnName\r\n })", "refId": "A" } ], "title": "Engagements Calendar", "type": "marcusolsson-calendar-panel" } ], "refresh": "", "schemaVersion": 38, "style": "dark", "tags": [], "templating": { "list": [ { "current": { "selected": true, "text": [ "All" ], "value": [ "$all" ] }, "datasource": { "type": "influxdb", "uid": "LBlRvy0Vz" }, "definition": "from(bucket: \"cc_metrics\")\r\n |> range(start: -12h)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"engagements\")\r\n |> keyValues(keyColumns: [\"project\"])\r\n |> group()\r\n |> keep(columns: [\"project\"])\r\n |> distinct(column: \"project\")", "hide": 0, "includeAll": true, "label": "Project", "multi": true, "name": "Project", "options": [], "query": "from(bucket: \"cc_metrics\")\r\n |> range(start: -12h)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"engagements\")\r\n |> keyValues(keyColumns: [\"project\"])\r\n |> group()\r\n |> keep(columns: [\"project\"])\r\n |> distinct(column: \"project\")", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { "selected": true, "text": [ "All" ], "value": [ "$all" ] }, "datasource": { "type": "influxdb", "uid": "LBlRvy0Vz" }, "definition": "from(bucket: \"cc_metrics\")\r\n |> range(start: -12h)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"engagements\")\r\n |> keyValues(keyColumns: [\"business_unit\"])\r\n |> group()\r\n |> keep(columns: [\"business_unit\"])\r\n |> distinct(column: \"business_unit\")", "hide": 0, "includeAll": true, "label": "BusinessUnit", "multi": true, "name": "BusinessUnit", "options": [], "query": "from(bucket: \"cc_metrics\")\r\n |> range(start: -12h)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"engagements\")\r\n |> keyValues(keyColumns: [\"business_unit\"])\r\n |> group()\r\n |> keep(columns: [\"business_unit\"])\r\n |> distinct(column: \"business_unit\")", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { "selected": true, "text": [ "All" ], "value": [ "$all" ] }, "datasource": { "type": "influxdb", "uid": "LBlRvy0Vz" }, "definition": "from(bucket: \"cc_metrics\")\r\n |> range(start: -12h)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"engagements\")\r\n |> keyValues(keyColumns: [\"status\"])\r\n |> group()\r\n |> keep(columns: [\"status\"])\r\n |> distinct(column: \"status\")", "hide": 0, "includeAll": true, "label": "Status", "multi": true, "name": "Status", "options": [], "query": "from(bucket: \"cc_metrics\")\r\n |> range(start: -12h)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"engagements\")\r\n |> keyValues(keyColumns: [\"status\"])\r\n |> group()\r\n |> keep(columns: [\"status\"])\r\n |> distinct(column: \"status\")", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { "selected": true, "text": [ "All" ], "value": [ "$all" ] }, "datasource": { "type": "influxdb", "uid": "LBlRvy0Vz" }, "definition": "from(bucket: \"cc_metrics\")\r\n |> range(start: -12h)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"engagements\")\r\n |> keyValues(keyColumns: [\"engagement_type\"])\r\n |> group()\r\n |> keep(columns: [\"engagement_type\"])\r\n |> distinct(column: \"engagement_type\")", "hide": 0, "includeAll": true, "label": "EngagementType", "multi": true, "name": "EngagementType", "options": [], "query": "from(bucket: \"cc_metrics\")\r\n |> range(start: -12h)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"engagements\")\r\n |> keyValues(keyColumns: [\"engagement_type\"])\r\n |> group()\r\n |> keep(columns: [\"engagement_type\"])\r\n |> distinct(column: \"engagement_type\")", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "type": "query" } ] }, "time": { "from": "now/y", "to": "now/y" }, "timepicker": {}, "timezone": "", "title": "Engagements Calendar", "uid": "cb8e8449-89b6-4edb-94b9-f2ed43a9c2c0", "version": 18, "weekStart": "" }