Skip to content

Commit

Permalink
Merge branch 'main' into fix/delete-many-fail-silently
Browse files Browse the repository at this point in the history
  • Loading branch information
Donnype authored Nov 8, 2024
2 parents 54a0072 + 518ff8f commit 23c5292
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 11 deletions.
8 changes: 0 additions & 8 deletions rocky/assets/css/components/pre.scss

This file was deleted.

1 change: 0 additions & 1 deletion rocky/assets/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
@import "components/ooi-summary";
@import "components/page-meta";
@import "components/plugins";
@import "components/pre";
@import "components/qr-code";
@import "components/report";
@import "components/report-name-table";
Expand Down
1 change: 1 addition & 0 deletions rocky/assets/css/manon-components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
@use "@minvws/manon/breadcrumb-bar";
@use "@minvws/manon/breadcrumb-bar-content-block";
@use "@minvws/manon/code-base";
@use "@minvws/manon/code-block";
@use "@minvws/manon/description-list";
@use "@minvws/manon/filter";
@use "@minvws/manon/language-selector-list";
Expand Down
10 changes: 10 additions & 0 deletions rocky/assets/css/themes/soft/manon/code-base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* code base */

:root {
--code-base-background-color: var(--colors-purrple-100);
}

code {
padding: 0.125rem 0.5rem;
white-space: nowrap;
}
6 changes: 6 additions & 0 deletions rocky/assets/css/themes/soft/manon/code-block.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* code base */

:root {
--code-block-background-color: var(--colors-purrple-100);
--code-block-code-padding: 0;
}
2 changes: 2 additions & 0 deletions rocky/assets/css/themes/soft/soft.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
@import "manon/button-ghost";
@import "manon/checkbox";
@import "manon/collapsible";
@import "manon/code-base";
@import "manon/code-block";
@import "manon/de-emphasized";
@import "manon/emphasized";
@import "manon/expando-rows";
Expand Down
9 changes: 7 additions & 2 deletions rocky/reports/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,18 @@ def get_ooi_pks(self) -> list[str]:
def get_total_oois(self):
return len(self.selected_oois)

def get_ooi_types(self):
def get_report_ooi_types(self):
if self.report_type == AggregateOrganisationReport:
return get_ooi_types_from_aggregate_report(AggregateOrganisationReport)
if self.report_type == MultiOrganizationReport:
return MultiOrganizationReport.input_ooi_types
return get_ooi_types_with_report()

def get_ooi_types(self):
if self.filtered_ooi_types:
return super().get_ooi_types()
return self.get_report_ooi_types()

def get_oois(self) -> list[OOI]:
if self.all_oois_selected():
return self.octopoes_api_connector.list_objects(
Expand All @@ -205,7 +210,7 @@ def get_oois(self) -> list[OOI]:
def get_ooi_filter_forms(self) -> dict[str, Form]:
return {
"ooi_type_form": OOITypeMultiCheckboxForReportForm(
sorted([ooi_class.get_ooi_type() for ooi_class in self.ooi_types]), self.request.GET
sorted([ooi_class.get_ooi_type() for ooi_class in self.get_report_ooi_types()]), self.request.GET
)
}

Expand Down
4 changes: 4 additions & 0 deletions rocky/rocky/views/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def __init__(

@cached_property
def count(self) -> int:
if not self.ooi_types:
return 0
return self.octopoes_connector.list_objects(
self.ooi_types,
valid_time=self.valid_time,
Expand All @@ -218,6 +220,8 @@ def __len__(self):
return self.count

def __getitem__(self, key: int | slice) -> list[OOI]:
if not self.ooi_types:
return []
if isinstance(key, slice):
offset = key.start or 0
limit = OOIList.HARD_LIMIT
Expand Down

0 comments on commit 23c5292

Please sign in to comment.