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

LGA-1082 quick escape button #933

Merged
merged 19 commits into from
Apr 7, 2020
Merged

LGA-1082 quick escape button #933

merged 19 commits into from
Apr 7, 2020

Conversation

MalcolmVonMoJ
Copy link
Contributor

What does this pull request do?

Adds a quick escape button to the service for certain routes:

  • Javascript only
  • When displayed, always visible
  • Fires of a GA function
  • Replaces current tab with google and opens BBC weather in a new tab

Any other changes that would benefit highlighting?

Intentionally left blank.

Checklist

  • Provided JIRA ticket number in the title, e.g. "LGA-152: Sample title"

@MalcolmVonMoJ MalcolmVonMoJ requested a review from a team as a code owner April 6, 2020 11:30

function flee() {
$("body").hide();
{#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these comments get rendered on the page?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the commented out code then if it's not being used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -84,6 +118,36 @@

{% block javascripts %}
<script>

var currentLocation = window.location.href;
if (currentLocation.indexOf("n43n3") > 0 || currentLocation.indexOf("n43n14/n97") > 0 || currentLocation.indexOf("n88") > 0 || currentLocation.indexOf("n149") > 0 || currentLocation.indexOf("n86") > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this matching paths in the domestic abuse category? If so you should be able to read the current category with something like session.stored.category (Add the current category as class on the main content wrapper)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used the session.checker.diagnosis_previous_choices check elsewhere on the page for this reason. Is that enough?
Should I use session.stored.category instead of session.checker.diagnosis_previous_choices?

      {#
        The below are all other possibilities but not necessarily the best approach.

        var histLength = history.length;
        window.history.go(-histLength);
        history.pushState({page: 1}, "Cookies", "/cookies")
        history.pushState({page: 2}, "Bank Holidays in the UK", "/bank-holidays")
      #}
Copy link
Contributor

@said-moj said-moj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@MalcolmVonMoJ MalcolmVonMoJ merged commit 0181749 into master Apr 7, 2020
@MalcolmVonMoJ MalcolmVonMoJ deleted the feature/LGA-1082-flee branch April 7, 2020 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants