Skip to content

Commit

Permalink
whatsapp settings links
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderGi committed Mar 5, 2024
1 parent e813dcd commit deb7aaf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion daras_ai_v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def _render_header(self):
and MenuTabs.integrations != self.tab
):
st.write(published_run.notes)
elif is_root_example:
elif is_root_example and MenuTabs.integrations != self.tab:
st.write(self.preview_description(current_run.to_dict()))

def can_user_edit_run(self, current_run: SavedRun | None = None) -> bool:
Expand Down
3 changes: 3 additions & 0 deletions gooey_ui/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,15 @@ def anchor(
type: typing.Literal["primary", "secondary", "tertiary", "link"] = "secondary",
disabled: bool = False,
unsafe_allow_html: bool = False,
new_tab: bool = False,
**props,
):
className = f"btn btn-theme btn-{type} " + props.pop("className", "")
style = props.pop("style", {})
if disabled:
style["pointerEvents"] = "none"
if new_tab:
props["target"] = "_blank"
with tag("a", href=href, className=className, style=style, **props):
markdown(dedent(label), unsafe_allow_html=unsafe_allow_html)

Expand Down
26 changes: 25 additions & 1 deletion recipes/VideoBots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ def integration_connect_screen(
<a href="{wa_connect_url(on_connect)}" {LINKSTYLE} aria-label="Connect your Whatsapp number">
<img src="{WHATSAPP_IMG}" {IMGSTYLE} alt="Whatsapp">
</a>
<div {DESCRIPTIONSTYLE}>Bring your own WhatsApp number to connect. Need a new one? Email <a href="mailto:[email protected]">[email protected]</a>.</div>
<div {DESCRIPTIONSTYLE}>Bring your own <a href="https://business.facebook.com/wa/manage/phone-numbers">WhatsApp number</a> to connect. Need a new one? Email <a href="mailto:[email protected]">[email protected]</a>.</div>
</div>
<div {ROWSTYLE}>
<a href="{slack_connect_url(on_connect)}" {LINKSTYLE} aria-label="Connect your Slack Workspace">
Expand Down Expand Up @@ -1322,6 +1322,30 @@ def integration_test_config_screen(
):
raise RedirectException(add_integration)

if bi.platform == Platform.WHATSAPP and bi.wa_business_waba_id:
col1, col2 = st.columns(2, style={"align-items": "center"})
with col1:
st.write("###### Whatsapp Business Management")
st.caption(
f"Only touch if you know what you're doing. Changing phonenumber(s) will break the Gooey integration."
)
with col2:
st.anchor(
"Business Settings",
f"https://business.facebook.com/settings/whatsapp-business-accounts/{bi.wa_business_waba_id}",
new_tab=True,
)
st.anchor(
"WhatsApp Manager",
f"https://business.facebook.com/wa/manage/home/?waba_id={bi.wa_business_waba_id}",
new_tab=True,
)
st.anchor(
"Phone Numbers",
"https://business.facebook.com/wa/manage/phone-numbers",
new_tab=True,
)


def chat_list_view():
# render a reversed list view
Expand Down

0 comments on commit deb7aaf

Please sign in to comment.