Skip to content

Commit 70120bb

Browse files
author
Daniel Bate
authored
Merge pull request wildfish#30 from wildfish/chore/bump-plotly-js
Chore/bump plotly js
2 parents 1159820 + 8cd60ab commit 70120bb

File tree

14 files changed

+32
-107
lines changed

14 files changed

+32
-107
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ For an overview of what has changed between versions, see the :ref:`changelog`.
77

88
.. _changelog:
99

10+
0.1.8 2024-10-08
11+
-----------------
12+
13+
- Replaces vulnerable `plotly.min.js` `v2.12.1` with `v2.35.2` (https://github.com/wildfish/django-dashboards/issues/29)
14+
- Fixed failing mypy checks
15+
1016
0.1.7 2023-12-14
1117
-----------------
1218

dashboards/static/dashboards/vendor/js/plotly.min.js

Lines changed: 4 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/dashboard/demo/kitchensink/charts.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ class ScatterChartSerializer(ChartSerializer):
1414
color: Optional[str] = None
1515
mode: Optional[str] = "markers"
1616

17-
def get_x(self, df) -> str:
17+
def get_x(self, df) -> str | None:
1818
return self.x
1919

20-
def get_y(self, df) -> str:
20+
def get_y(self, df) -> str | None:
2121
return self.y
2222

23-
def get_size(self, df) -> str:
23+
def get_size(self, df) -> str | None:
2424
return self.size
2525

2626
def to_fig(self, df) -> go.Figure:
@@ -42,10 +42,10 @@ class BarChartSerializer(ChartSerializer):
4242
color: Optional[str] = None
4343
barmode: Optional[str] = "group"
4444

45-
def get_x(self, df) -> str:
45+
def get_x(self, df) -> str | None:
4646
return self.x
4747

48-
def get_y(self, df) -> str:
48+
def get_y(self, df) -> str | None:
4949
return self.y
5050

5151
def to_fig(self, df) -> go.Figure:

demos/dashboard/demo/kitchensink/dashboards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class DemoDashboard(Dashboard):
104104
grid_css_classes=Grid.TWO.value,
105105
)
106106
stat_two = Stat(
107-
value=StatData(text="88%", sub_text="decrease", change_by="12%"),
107+
value=StatData(text="88%", sub_text="decrease", change_by_text="12%"),
108108
icon="<i data-feather='users'></i>",
109109
grid_css_classes=Grid.TWO.value,
110110
)

demos/dashboard/demo/kitchensink/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def as_view(cls, **initkwargs):
6666
Needed prior to 4.1 for CBV
6767
"""
6868
view = super().as_view(**initkwargs)
69-
view._is_coroutine = asyncio.coroutines._is_coroutine
69+
view._is_coroutine = asyncio.coroutines._is_coroutine # type: ignore
7070
return view
7171

7272
async def get(self, request: HttpRequest, *args, **kwargs):

demos/dashboard/demo/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def CACHES(self):
267267
"default": {
268268
"BACKEND": "django_redis.cache.RedisCache",
269269
"LOCATION": f"redis://{self.REDIS_HOST}:{self.REDIS_PORT}/1",
270-
"KEY_PREFIX": f"{self.PROJECT_ENVIRONMENT_SLUG}_",
270+
"KEY_PREFIX": f"{self.PROJECT_ENVIRONMENT_SLUG}_", # type: ignore
271271
"OPTIONS": {
272272
"CLIENT_CLASS": "django_redis.client.DefaultClient",
273273
"PARSER_CLASS": "redis.connection.HiredisParser",

demos/dashboard/demo/vehicle/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def fetch_service_count(request, **kwargs):
7474

7575
@staticmethod
7676
def fetch_vehicle_details(*args, **kwargs):
77-
vehicle = kwargs.get("object")
77+
vehicle: Vehicle = kwargs.get("object") # type: ignore
7878
return StatData(
7979
text=dict_to_table(
8080
{
@@ -92,7 +92,7 @@ def fetch_vehicle_details(*args, **kwargs):
9292

9393
@staticmethod
9494
def fetch_last_route(*args, **kwargs):
95-
vehicle = kwargs.get("object")
95+
vehicle: Vehicle = kwargs.get("object") # type: ignore
9696
locations = vehicle.get_locations_for_last_job()
9797
lat_coords = [location.lat for location in locations]
9898
lon_coords = [location.lon for location in locations]

demos/dashboard/demo/vehicle/management/commands/sample_vehicle_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class Command(BaseCommand):
1111
def handle(self, *args, **options):
1212
if Data.objects.count() == 0:
13-
vehicles = baker.make("Vehicle", _quantity=5, _bulk_create=True)
13+
vehicles = baker.make("Vehicle", _quantity=5, _bulk_create=True) # type: ignore
1414
location_param, _ = Parameter.objects.get_or_create(
1515
name="Current Location", cast_type=Parameter.CastType.COORDINATE
1616
)

demos/dashboard/demo/vehicle/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ def convert(self):
115115
Coord = namedtuple("Coord", ["lon", "lat"])
116116
return Coord(lon=lon, lat=lat)
117117
elif self.parameter.cast_type == "datetime":
118-
return datetime.strptime(self.value, self.DT_FORMAT)
118+
return datetime.strptime(self.value, self.DT_FORMAT) # type: ignore

demos/dashboard/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ django-cors-headers==4.3.1
3737
# via
3838
# -r requirements.in
3939
# django-dashboards
40-
django-dashboards==0.1.7
40+
django-dashboards==0.1.8
4141
# via -r requirements.in
4242
django-eventstream==4.5.1
4343
# via -r requirements.in

0 commit comments

Comments
 (0)