Skip to content

Commit

Permalink
Finish ESY-5740_Cookie_consent
Browse files Browse the repository at this point in the history
- Cookie consent in Prod only
- Clarity cookie in Prod if consent is given
  • Loading branch information
m-lilja committed Jan 23, 2024
1 parent f1da9bc commit d1bb198
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 28 deletions.
39 changes: 12 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,31 @@ like to host it locally on your computer, you have two options, manual install
or [Docker][docker].
The Docker installation is the one we recommend to use for its simplicity.

After either a Docker or manual installation Jekyll should be fired up with this theme. You can now add pages, documents,
data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, the site will regenerate and you should see
the changes in the browser after a refresh, just like normal.

When the theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled. To add a custom directory to your
theme-gem, please edit the regexp in `swedbankpay.gemspec` accordingly.


### Docker
### Docker (recommended)

Check warning on line 31 in README.md

View workflow job for this annotation

GitHub Actions / remark-lint

[remark-lint] README.md#L31

Remove 1 line before node no-consecutive-blank-lines remark-lint
Raw output
         31:1  warning  Remove 1 line before node       no-consecutive-blank-lines  remark-lint

1. [Clone this repository][clone].
2. [Install Docker Personal][docker]. Select default settings when prompted.
3. Open a console window at the root of the repository and run `docker-compose up`. This will create and run a docker container.
Everything specified in the repository `gemfile` will be installed and run in the container.
5. Run Visual Studio Code (VSC) and open the repository.

Check warning on line 37 in README.md

View workflow job for this annotation

GitHub Actions / remark-lint

[remark-lint] README.md#L37

Marker should be `4`, was `5` ordered-list-marker-value remark-lint
Raw output
   37:1-37:58  warning  Marker should be `4`, was `5`   ordered-list-marker-value   remark-lint
6. Verify that Git is installed by running `git status` in VSC terminal. If not installed, [download Git][git] and install.
6. Verify that Git is installed by running `git status` in VSC terminal.
If Git is not properly installed, you will see an error message like the one below. Just [download Git][git] and install.
![Alt text](image.png)

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / remark-lint

[remark-lint] README.md#L40

Marker should be `5`, was `6` ordered-list-marker-value remark-lint
Raw output
   38:1-40:26  warning  Marker should be `5`, was `6`   ordered-list-marker-value   remark-lint
7. Once Docker and Git are installed, run `bundle install` in VSC terminal.

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / remark-lint

[remark-lint] README.md#L41

Marker should be `6`, was `7` ordered-list-marker-value remark-lint
Raw output
   41:1-41:77  warning  Marker should be `6`, was `7`   ordered-list-marker-value   remark-lint
8. If needed, run `bundle update`.

Check warning on line 42 in README.md

View workflow job for this annotation

GitHub Actions / remark-lint

[remark-lint] README.md#L42

Marker should be `7`, was `8` ordered-list-marker-value remark-lint
Raw output
   42:1-42:36  warning  Marker should be `7`, was `8`   ordered-list-marker-value   remark-lint
9. Run `bundle exec jekyll serve` to start the website.

Check warning on line 43 in README.md

View workflow job for this annotation

GitHub Actions / remark-lint

[remark-lint] README.md#L43

Marker should be `8`, was `9` ordered-list-marker-value remark-lint
Raw output
   43:1-43:57  warning  Marker should be `8`, was `9`   ordered-list-marker-value   remark-lint
10. Open `http://localhost:4000` in a browser.

Check warning on line 44 in README.md

View workflow job for this annotation

GitHub Actions / remark-lint

[remark-lint] README.md#L44

Marker should be `9`, was `10` ordered-list-marker-value remark-lint
Raw output
   44:1-44:47  warning  Marker should be `9`, was `10`  ordered-list-marker-value   remark-lint


### Manual install (instructions last updated 2021)
### Manual install

1. [Clone this repository][clone].
2. Jekyll is written in [Ruby][ruby], so you'll need to download and install
Expand All @@ -48,30 +57,6 @@ The Docker installation is the one we recommend to use for its simplicity.
6. Run `bundle exec jekyll serve` to start the website.
7. Open `http://localhost:4000` in a browser.

### Required Visual Studio Code plugins

* `shd101wyy.markdown-preview-enhanced`, to render Markdown to HTML in a
preview window.
* `bpruitt-goddard.mermaid-markdown-syntax-highlighting`, to give syntax
highlighting to Mermaid diagrams in Markdown files.
* `yzhang.markdown-all-in-one`, to enable a plethora of Markdown features,
most importantly formatting of Markdown tables with VS Code's built-in
format functionality.
* `stkb.rewrap`, to make line-breaking text at 80 characters easier.
* `supperchong.pretty-json` to format selected JSON snippets in code
examples.
* `sissel.shopify-liquid` for syntax highlighting of [Liquid][liquid].
* [Set up a ruler at 80 characters][vsc-ruler] by
adding `"editor.rulers": [80]` to its configuration.

Jekyll should now be fired up with this theme. You can now add pages, documents,
data, etc. like normal to test your theme's contents. As you make modifications
to your theme and to your content, the site will regenerate and you should see
the changes in the browser after a refresh, just like normal.

When the theme is released, only the files in `_layouts`, `_includes`, `_sass`
and `assets` tracked with Git will be bundled. To add a custom directory to your
theme-gem, please edit the regexp in `swedbankpay.gemspec` accordingly.

## Contributing

Check warning on line 61 in README.md

View workflow job for this annotation

GitHub Actions / remark-lint

[remark-lint] README.md#L61

Remove 1 line before node no-consecutive-blank-lines remark-lint
Raw output
         61:1  warning  Remove 1 line before node       no-consecutive-blank-lines  remark-lint

Expand Down
1 change: 0 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
<script src="{{ "/assets/tipuesearch/tipuesearch_set.js" | relative_url }}"></script>
<script src="{{ "/assets/tipuesearch/tipuesearch.min.js" | relative_url }}"></script>
{%- endif %}
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="77c777e5-115a-4e3d-81ec-cc857a4ac846"></script>
</head>

<body>
Expand Down
15 changes: 15 additions & 0 deletions assets/js/cookie-consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ function inactivateClarityCookies() {
deleteCookie("_clsk");
}

window.addEventListener("DOMContentLoaded", (event) => {
if (location.host === "developer.swedbankpay.com") {
var script = document.createElement('script');
script.src = 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js';
script.type = "text/javascript";
script.charset = "UTF-8";
script.setAttribute("data-domain-script", "77c777e5-115a-4e3d-81ec-cc857a4ac846");
document.body.appendChild(script);
}
else {
document.cookie = "_clck=;domain=.swedbankpay.com;expires=Thu, 01 Jan 1970 00:00:01 GMT";
document.cookie = "_clsk=;domain=.swedbankpay.com;expires=Thu, 01 Jan 1970 00:00:01 GMT";
}
});

window.addEventListener("OneTrustGroupsUpdated", (event) => {
if (event.detail.indexOf("C0002") !== -1) {
activateClarity();
Expand Down
Binary file added image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d1bb198

Please sign in to comment.