Skip to content

Commit

Permalink
visualizer framework fix (#2014)
Browse files Browse the repository at this point in the history
* visualizer framework fix

* fix test

* fix

* fix
  • Loading branch information
drosetti committed Dec 7, 2023
1 parent e96f180 commit 4bdc711
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api_app/classes.py
Expand Up @@ -267,4 +267,4 @@ def health_check(self, user: User = None) -> bool:
return False

Check warning on line 267 in api_app/classes.py

View check run for this annotation

Codecov / codecov/patch

api_app/classes.py#L267

Added line #L267 was not covered by tests
else:
return True

Check warning on line 269 in api_app/classes.py

View check run for this annotation

Codecov / codecov/patch

api_app/classes.py#L269

Added line #L269 was not covered by tests
raise NotImplementedError("No healthcheck implemented")
raise NotImplementedError()
2 changes: 1 addition & 1 deletion api_app/views.py
Expand Up @@ -877,7 +877,7 @@ def health_check(self, request, pk=None):
health_status = python_obj.health_check(request.user)
except NotImplementedError as e:
logger.info(f"NotImplementedError {e}, user {request.user}, name {pk}")
raise ValidationError({"detail": "Not implemented"})
raise ValidationError({"detail": "No healthcheck implemented"})
except Exception as e:
logger.exception(e)
raise ValidationError(

Check warning on line 883 in api_app/views.py

View check run for this annotation

Codecov / codecov/patch

api_app/views.py#L881-L883

Added lines #L881 - L883 were not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion api_app/visualizers_manager/classes.py
Expand Up @@ -115,7 +115,7 @@ class VisualizableTitle(VisualizableObject):
def __init__(
self,
title: VisualizableBase,
value: VisualizableBase,
value: VisualizableObject,
alignment: VisualizableAlignment = VisualizableAlignment.CENTER,
size: VisualizableSize = VisualizableSize.S_AUTO,
disable: bool = True,
Expand Down
Expand Up @@ -41,7 +41,7 @@ export function BaseVisualizer({
<div
className={`${size} ${
isChild ? "small" : ""
} p-1 d-flex align-items-center text-${alignment} justify-content-${alignment} ${
} p-0 m-1 d-flex align-items-center text-${alignment} justify-content-${alignment} ${
disable ? "opacity-25" : ""
} ${color}`}
id={id}
Expand Down
Expand Up @@ -35,7 +35,7 @@ describe("BaseVisualizer component", () => {
// check size and alignment
const outerPartComponent = innerPartComponent.closest("div");
expect(outerPartComponent.className).toBe(
"col-1 p-1 d-flex align-items-center text-center justify-content-center ",
"col-1 p-0 m-1 d-flex align-items-center text-center justify-content-center ",
);
// check tooltip
const user = userEvent.setup();
Expand Down Expand Up @@ -84,7 +84,7 @@ describe("BaseVisualizer component", () => {
);
// check optional elements (like bold, italic...)
expect(idElement.className).toBe(
"col-2 small p-1 d-flex align-items-center text-start justify-content-start success",
"col-2 small p-0 m-1 d-flex align-items-center text-start justify-content-start success",
);
// check tooltip
const user = userEvent.setup();
Expand Down Expand Up @@ -133,7 +133,7 @@ describe("BaseVisualizer component", () => {
// check optional elements (like bold, italic...)
const outerPartComponent = innerPartComponent.closest("div");
expect(outerPartComponent.className).toBe(
"col-2 p-1 d-flex align-items-center text-start justify-content-start opacity-25 success",
"col-2 p-0 m-1 d-flex align-items-center text-start justify-content-start opacity-25 success",
);
});
});

0 comments on commit 4bdc711

Please sign in to comment.