Skip to content

Commit

Permalink
Merge pull request #9038 from OpenMined/snwagh/notification-settings
Browse files Browse the repository at this point in the history
Added notification enabled text to domain settings
  • Loading branch information
snwagh committed Jul 11, 2024
2 parents c443ebe + bc30b5d commit 477fd1e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/syft/src/syft/service/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ class NodeSettings(SyftObject):
)

def _repr_html_(self) -> Any:
preferences = self._get_api().services.notifications.user_settings()
notifications = []
if preferences.email:
notifications.append("email")
if preferences.sms:
notifications.append("sms")
if preferences.slack:
notifications.append("slack")
if preferences.app:
notifications.append("app")

if notifications:
notifications_enabled = f"True via {', '.join(notifications)}"
else:
notifications_enabled = "False"

return f"""
<style>
.syft-settings {{color: {SURFACE[options.color_theme]};}}
Expand All @@ -124,6 +140,7 @@ def _repr_html_(self) -> Any:
<p><strong>Description: </strong>{self.description}</p>
<p><strong>Deployed on: </strong>{self.deployed_on}</p>
<p><strong>Signup enabled: </strong>{self.signup_enabled}</p>
<p><strong>Notifications enabled: </strong>{notifications_enabled}</p>
<p><strong>Admin email: </strong>{self.admin_email}</p>
</div>
Expand Down

0 comments on commit 477fd1e

Please sign in to comment.