territories-dashboard-lib 0.1.5__py3-none-any.whl → 0.1.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of territories-dashboard-lib might be problematic. Click here for more details.

@@ -1,4 +1,5 @@
1
1
  import base64
2
+ import datetime
2
3
  import gzip
3
4
  import json
4
5
  from typing import Optional
@@ -32,6 +33,17 @@ class GeoFeaturesParams(BaseModel):
32
33
  feature: str
33
34
 
34
35
 
36
+ class DateTimeEncoder(json.JSONEncoder):
37
+ def default(self, obj):
38
+ if isinstance(obj, (datetime.date, datetime.datetime)):
39
+ return (
40
+ obj.date().isoformat()
41
+ if isinstance(obj, datetime.datetime)
42
+ else obj.isoformat()
43
+ )
44
+ return super().default(obj)
45
+
46
+
35
47
  @require_GET
36
48
  @cache_control(max_age=3600)
37
49
  def geo_features_view(request):
@@ -96,7 +108,7 @@ def geo_features_view(request):
96
108
 
97
109
  last_queried_order_id = results[-1]["order_id"] if results else None
98
110
 
99
- compressed_data = gzip.compress(json.dumps(data).encode())
111
+ compressed_data = gzip.compress(json.dumps(data, cls=DateTimeEncoder).encode())
100
112
  compressed_base64 = base64.b64encode(compressed_data).decode()
101
113
 
102
114
  return JsonResponse({"data": compressed_base64, "last": last_queried_order_id})
@@ -882,8 +882,8 @@ footer .fr-follow {
882
882
  font-size: 0.9rem;
883
883
  }
884
884
 
885
- .table-geo-filters details:last-child:open {
886
- padding-bottom: 500px;
885
+ .table-geo-filters:has(details[open]) {
886
+ padding-bottom: 300px;
887
887
  }
888
888
 
889
889
  .table-geo-filters input,
@@ -975,3 +975,33 @@ footer .fr-follow {
975
975
  .fr-footer__bottom-link {
976
976
  white-space: nowrap;
977
977
  }
978
+
979
+ .react-datepicker__input-container input {
980
+ border-color: hsl(0, 0%, 80%);
981
+ border-radius: 4px;
982
+ border-style: solid;
983
+ border-width: 1px;
984
+ width: 95px;
985
+ }
986
+
987
+ .date-pickers-range {
988
+ display: flex;
989
+ flex-direction: row;
990
+ gap: 32px;
991
+ }
992
+
993
+ .react-datepicker__header {
994
+ background-color: #ececfe !important;
995
+ }
996
+
997
+ .react-datepicker__header h2 {
998
+ padding: 0px !important;
999
+ }
1000
+
1001
+ .react-datepicker__header__dropdown {
1002
+ padding-bottom: 16px !important;
1003
+ }
1004
+
1005
+ .react-datepicker__close-icon:hover {
1006
+ background-color: inherit !important;
1007
+ }