diff --git a/packages/syft/src/syft/client/api.py b/packages/syft/src/syft/client/api.py index 1a69fce69aa..703684e9e11 100644 --- a/packages/syft/src/syft/client/api.py +++ b/packages/syft/src/syft/client/api.py @@ -357,10 +357,7 @@ def __getitem__(self, key: Union[str, int]) -> Any: def _repr_html_(self) -> Any: if not hasattr(self, "get_all"): return NotImplementedError - if hasattr(self, "get_all_unread"): - results = self.get_all_unread() - else: - results = self.get_all() + results = self.get_all() return results._repr_html_() diff --git a/packages/syft/src/syft/service/notification/notifications.py b/packages/syft/src/syft/service/notification/notifications.py index c2e5b9ea53f..90a77df0319 100644 --- a/packages/syft/src/syft/service/notification/notifications.py +++ b/packages/syft/src/syft/service/notification/notifications.py @@ -17,6 +17,8 @@ from ...types.transforms import generate_id from ...types.transforms import transform from ...types.uid import UID +from ...util import options +from ...util.colors import SURFACE @serializable() @@ -67,6 +69,22 @@ class Notification(SyftObject): ] __repr_attrs__ = ["subject", "status", "created_at", "linked_obj"] + def _repr_html_(self) -> str: + return f""" + +
+

Notification

+

ID: {self.id}

+

Subject: {self.subject}

+

Status: {self.status.name}

+

Created at: {self.created_at}

+

Linked object: {self.linked_obj}

+

+

+ """ + @property def link(self) -> Optional[SyftObject]: if self.linked_obj: diff --git a/packages/syft/src/syft/store/linked_obj.py b/packages/syft/src/syft/store/linked_obj.py index 20a1e3dffde..8ac219a3936 100644 --- a/packages/syft/src/syft/store/linked_obj.py +++ b/packages/syft/src/syft/store/linked_obj.py @@ -30,7 +30,10 @@ class LinkedObject(SyftObject): object_uid: UID def __str__(self) -> str: - return f"<{self.object_type}: {self.object_uid}@" + resolved_obj_type = ( + type(self.resolve) if self.object_type is None else self.object_type + ) + return f"{resolved_obj_type.__name__}: {self.object_uid} @ Node {self.node_uid}" @property def resolve(self) -> SyftObject: