Open mazurp03 opened 1 year ago
Hi @mazurp03, I tested it with the following data. Are you getting this issue with the latest 0.1.4 release? I'm asking because I am not getting any warnings about duplicate shifts in different shift groups.
{
"static": {
"shifts": [
{
"group": "Group 1 eg. Summer",
"group_uuid": "uuid_1",
"uuid": "shift_uuid_11",
"label": "Morning Custom",
"startTime": "06:01:00",
"endTime": "14:00:00",
"order": 1
},
{
"group": "Group 1 eg. Summer",
"group_uuid": "uuid_1",
"uuid": "shift_uuid_12",
"label": "Afternoon Custom",
"startTime": "14:01:00",
"endTime": "19:37:00",
"order": 2
},
{
"group": "Group 1 eg. Summer",
"group_uuid": "uuid_1",
"uuid": "shift_uuid_13",
"label": "Night Custom",
"startTime": "19:38:00",
"endTime": "06:00:00",
"order": 3
},
{
"group": "Group 2 eg. Winter",
"group_uuid": "uuid_2",
"uuid": "shift_uuid_21",
"label": "Morning Custom",
"startTime": "06:01:00",
"endTime": "14:00:00",
"order": 1
},
{
"group": "Group 2 eg. Winter",
"group_uuid": "uuid_2",
"uuid": "shift_uuid_22",
"label": "Afternoon Custom",
"startTime": "14:01:00",
"endTime": "19:37:00",
"order": 2
},
{
"group": "Group 2 eg. Winter",
"group_uuid": "uuid_2",
"uuid": "shift_uuid_23",
"label": "Night Custom",
"startTime": "19:38:00",
"endTime": "06:00:00",
"order": 3
}
]
}
}
Hi @isaozler ,
To jump on this, got the same warning. Using the Filter setup. When a line is selected the actual data returns a unique dataset. But without it there is indeed multiple values with the same name.
The validation appears to not take the filter into account correctly?
Hi @isaozler ,
To jump on this, got the same warning. Using the Filter setup. When a line is selected the actual data returns a unique dataset. But without it there is indeed multiple values with the same name.
The validation appears to not take the filter into account correctly?
I see, will check this 👍
@isaozler Found something already?
@mazurp03 Could you check this branch to see if this fixes your issue?
https://github.com/isaozler/grafana-shift-selector/tree/fix/v10
With the release of 0.1.6, you can retrieve all shifts without being filtered by Grafana.
Firstly, you should concatenate the shift labels with the shift group. https://github.com/isaozler/grafana-shift-selector/assets/1378630/5c4204a3-ef6c-40d5-b5a3-73eba997d5b5
Secondly, the trim feature should be enabled in the data mapper props panel. https://github.com/isaozler/grafana-shift-selector/assets/1378630/ebfeeeee-91a5-4245-97a5-107abc865aa3
Hi Isa, I've tested your solution and for more than one shift group it works fine, but in case of extracting one shift group from all available ones, the problem still occurs. Before extraction: Query: And SS settings:
After extraction: Query (added "where" clause to extract one uuid that I'm interested in): And SS settings are exactly the same as before extraction.
Thanks, @mazurp03. I will have a look at it. These settings will be much easier to configure in the new major update.
Hi, One of the warnings in the latest Shift Selector version seems to be too sensitive. Here is the code fragment that I'm talking about:
Let's focus on the first "if" condition. In case of more than one shift group configured in the database, this warning triggers all the time. For example, I have more than one instance of Grafana with completely different shiftGroupUUID's. For each shiftGroupUUID I have 3 shifts configured with the name e.g. "morning", "afternoon", "night". Of course, there should be something that will secure us from duplicating shift names in the same shiftGroupUUID (that's important), but for me there is a big discrepancy between the description of this warning and the condition that must be met.
There should be some function/effect that will check whether shift names are unique in the same shiftGroupUUID. For now, this "if" condition checks if there is more than one shiftGroupUUID (if I understand this code fragment correctly) and then if it meets the condition in which there is more than one - warning is triggered with a description, which for me doesn't indicate the checked condition.