Skip to content

Commit

Permalink
feat: link to gitlab logs on visualisation page
Browse files Browse the repository at this point in the history
  • Loading branch information
JosefSmith committed Jul 4, 2023
1 parent 63617c2 commit 51c8d44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dataworkspace/dataworkspace/apps/applications/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ def visualisation_branch_html_GET(request, gitlab_project, branch_name):
current_branch = matching_branches[0]
latest_commit = current_branch["commit"]
latest_commit_link = f'{gitlab_project["web_url"]}/commit/{latest_commit["id"]}'
latest_build_logs_link = f'{gitlab_project["web_url"]}/-/jobs'
latest_commit_preview_link = (
f'{request.scheme}://{application_template.host_basename}--{latest_commit["short_id"]}'
f".{settings.APPLICATION_ROOT_DOMAIN}/"
Expand Down Expand Up @@ -523,6 +524,7 @@ def visualisation_branch_html_GET(request, gitlab_project, branch_name):
"current_branch": current_branch,
"latest_commit": latest_commit,
"latest_commit_link": latest_commit_link,
"latest_build_logs_link": latest_build_logs_link,
"latest_commit_preview_link": latest_commit_preview_link,
"latest_commit_date": latest_commit_date,
"can_release_latest_commit": can_release_latest_commit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ <h2 class="commit-left govuk-heading-m">Latest commit: {{ latest_commit.short_id
View<span class="govuk-visually-hidden"> latest</span> commit<span class="govuk-visually-hidden">{{ latest_commit.short_id }}</span> in GitLab
</a>
</li>
<li class="govuk-!-margin-bottom-0">
<a class="govuk-link govuk-link--no-visited-state" href="{{ latest_build_logs_link }}">
View GitLab build logs
</a>
</li>
<li{% if not can_download_logs %} class="govuk-!-margin-bottom-0"{% endif %}>
<a class="govuk-link govuk-link--no-visited-state" href="{{ latest_commit_preview_link }}">
Preview visualisation<span class="govuk-visually-hidden"> at<span class="govuk-visually-hidden"> latest</span> commit {{ latest_commit.short_id }}</span>
Expand Down

0 comments on commit 51c8d44

Please sign in to comment.