-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reports data structure and frontend V1 (#135)
Co-authored-by: Alex Cabrera <[email protected]>
- Loading branch information
1 parent
4f5a28b
commit fb8c73e
Showing
52 changed files
with
2,741 additions
and
581 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
"""Types for Zeno reports.""" | ||
from enum import Enum | ||
|
||
from zeno_backend.classes.base import CamelModel | ||
|
||
|
||
class ReportElementType(Enum): | ||
"""Enumeration of possible report types in Zeno. | ||
Attributes: | ||
CHART: Chart element for a report. | ||
TEXT: Text element for a report. | ||
""" | ||
|
||
CHART = "CHART" | ||
TEXT = "TEXT" | ||
|
||
|
||
class Report(CamelModel): | ||
"""Representation of a report in Zeno. | ||
Attributes: | ||
id (int): ID of the report. | ||
name (str): name of the report. | ||
owner_name (str): name of the creater of the report | ||
linked_projects (list[str]): all projects that can be used with the report. | ||
editor (bool): whether the current user can edit the report. | ||
public (bool): whether the report is publically visible. | ||
""" | ||
|
||
id: int | ||
name: str | ||
owner_name: str | ||
linked_projects: list[str] | ||
editor: bool | ||
public: bool = False | ||
|
||
|
||
class ReportElement(CamelModel): | ||
"""Representation of an element of a Zeno report. | ||
Attributes: | ||
type (ReportElementType): what type of element this represents. | ||
data (str | None): any data that the element holds. | ||
chart_id (int | None): id of the chart this element is linked to. | ||
""" | ||
|
||
id: int | None = None | ||
type: ReportElementType | ||
position: int | ||
data: str | None = None | ||
chart_id: int | None = None | ||
|
||
|
||
class ReportResponse(CamelModel): | ||
"""Response for a report in Zeno. | ||
Attributes: | ||
report (Report): the report itself. | ||
report_elements (list[ReportElement]): all elements of the report. | ||
""" | ||
|
||
report: Report | ||
report_elements: list[ReportElement] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.