Skip to content

Commit

Permalink
Update summary.html.heex (#2390)
Browse files Browse the repository at this point in the history
* Update summary.html.heex

Create a link on the summary page to link to Not a Tesla App release notes page per discussion request #2367 

Full disclosure - not proficient in Elixir, but understand HTML and capable of digging through other code and comparing. Just not sure how the `@summary.version` is going to be treated in the link text.

* Fix string interpolation

* Update tests

Co-authored-by: Adrian Kumpf <[email protected]>
  • Loading branch information
cwanja and adriankumpf committed Jan 28, 2022
1 parent 253f630 commit 2370527
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/teslamate_web/live/car_live/summary.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
<%= unless is_nil(@summary.version) do %>
<tr>
<td class="has-text-weight-medium"><%= gettext "Version" %></td>
<td><%= @summary.version %></td>
<td><%= link @summary.version, to: "https://www.notateslaapp.com/software-updates/version/#{@summary.version}/release-notes", target: "_blank", rel: "noopener noreferrer" %></td>
</tr>
<% end %>
</tbody>
Expand Down
13 changes: 12 additions & 1 deletion test/teslamate_web/controllers/car_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,18 @@ defmodule TeslaMateWeb.CarControllerTest do
assert table_row(html, "Outside Temperature", "24 °C")
assert table_row(html, "Inside Temperature", "23.2 °C")
assert table_row(html, "Mileage", "42000 km")
assert table_row(html, "Version", "2019.40.50.7")

assert table_row(
html,
"Version",
{"a",
[
{"href",
"https://www.notateslaapp.com/software-updates/version/2019.40.50.7/release-notes"},
{"rel", "noopener noreferrer"},
{"target", "_blank"}
], ["2019.40.50.7"]}
)
end

@tag :signed_in
Expand Down

0 comments on commit 2370527

Please sign in to comment.