Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add email link? #2297

Closed
ceevee830 opened this issue May 31, 2019 · 3 comments · Fixed by #2308
Closed

How to add email link? #2297

ceevee830 opened this issue May 31, 2019 · 3 comments · Fixed by #2308

Comments

@ceevee830
Copy link

TB version 1.13

Goal: Would like to add an a href link in the TensorBoard GUI that when clicked, allows user to send us an email.

I grepped through the entire code base and did not find any hooks or links or tests that supports any references to any email system.

I'm looking for something like this:

<div id="sendEmail">
  We would like to hear from you.  Please contact us at: 
  <a href="mailto:[email protected]">[email protected]</a>
</div>

When I include a link to an email address in the TensorBoard HTML file, then compile, I get the following bazel compiler error message:

ERROR: file.html: Referenced mailto:[email protected] (/path/mailto:[email protected]) without depending on a web_library() rule providing it

@wchargin
Copy link
Contributor

wchargin commented May 31, 2019

Hi @ceevee830—thanks for the report. The error message is due to
rules_closure. Specifically, the shouldIgnoreUri function should
have a case for mailto: URLs:

https://github.com/bazelbuild/rules_closure/blob/21081338d795d2894c59175930a338cda2262260/java/io/bazel/rules/closure/webfiles/WebfilesValidator.java#L212-L223

I’d suggest sending a PR there. EDIT: I went ahead and sent one:
bazelbuild/rules_closure#383

In the meantime, you could work around this by using something like:

<a href="[[_mailtoUrl(_email)]]">[[_email]]</a>

where _mailtoUrl is defined on the Polymer element and _email is a
constant readonly property with string value [email protected].

wchargin added a commit to wchargin/rules_closure that referenced this issue Jun 3, 2019
Summary:
This patch teaches `WebfilesValidator` that `mailto:` URLs don’t express
webfiles dependency relationships, and so do not need to be accompanied
by a `web_library` provider. See:
<tensorflow/tensorboard#2297>

Test Plan:
Unit test added; it fails before this change and passes after it.

wchargin-branch: whitelist-mailto
gkdn pushed a commit to bazelbuild/rules_closure that referenced this issue Jun 5, 2019
This patch teaches `WebfilesValidator` that `mailto:` URLs don’t express
webfiles dependency relationships, and so do not need to be accompanied
by a `web_library` provider. See:
<tensorflow/tensorboard#2297>

Test Plan:
Unit test added; it fails before this change and passes after it.
@ceevee830
Copy link
Author

Thanks! This is on my current sprint so I'll try it out soon.

wchargin added a commit that referenced this issue Jun 5, 2019
Summary:
This pulls in bazelbuild/rules_closure#383 to fix #2297, and integrates
the same fix into our own `Vulcanize.java` for consistency.

This diff includes a jscompiler upgrade from `v20190325` to `v20190528`.

Test Plan:
The `//tensorboard` target still builds and appears to run fine, with
cursory inspection.

Changing the `href` attribute of the help button in `tf-tensorboard` to
`mailto:[email protected]` now builds and works properly; prior to this
commit, that failed to build, as described in #2297.

wchargin-branch: rules-closure-mailto-fix
@wchargin
Copy link
Contributor

wchargin commented Jun 5, 2019

@ceevee830: Sounds good. You can cherry-pick #2308 to upgrade the
TensorBoard workspace. Let us know how it goes.

wchargin added a commit that referenced this issue Jun 5, 2019
Summary:
This pulls in bazelbuild/rules_closure#383 to fix #2297, and integrates
the same fix into our own `Vulcanize.java` for consistency.

This diff includes a jscompiler upgrade from `v20190325` to `v20190528`.

Test Plan:
The `//tensorboard` target still builds and appears to run fine, with
cursory inspection.

Changing the `href` attribute of the help button in `tf-tensorboard` to
`mailto:[email protected]` now builds and works properly; prior to this
commit, that failed to build, as described in #2297.

wchargin-branch: rules-closure-mailto-fix
ptmphuong pushed a commit to ptmphuong/rules_closure that referenced this issue Dec 9, 2022
This patch teaches `WebfilesValidator` that `mailto:` URLs don’t express
webfiles dependency relationships, and so do not need to be accompanied
by a `web_library` provider. See:
<tensorflow/tensorboard#2297>

Test Plan:
Unit test added; it fails before this change and passes after it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants