slimmer 15.4.0 → 15.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/slimmer/processors/accounts_shower.rb +18 -0
- data/lib/slimmer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9198a64c1829a19f7f0a89e3b0e7ae4b504b728cac13f935398343e962e1d63c
|
4
|
+
data.tar.gz: 6baeb15e0d17b8f3b3f9bd51b8ebe3a324a7c7511372d37d0f8713ef4785c518
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11ec9e71961fd062c4a7b3378134fc090f9e574ea487093d81b4eb8a3b0a6a31e38633c93cedd9efdde3848971cc429aea0666bb01048edcac1d6587a54689b5
|
7
|
+
data.tar.gz: e412a52f54e6d1eee23769a6aa0d6b9a3a3bec0b6147f349cde5f448886c70fb283db165d5794d4dae8068ec4aff84c086d0474c511a54bef1a8fff730df57ca
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,14 @@ module Slimmer::Processors
|
|
6
6
|
|
7
7
|
def filter(_src, dest)
|
8
8
|
header_value = @headers[Slimmer::Headers::SHOW_ACCOUNTS_HEADER]
|
9
|
+
layout_header = dest.at_css(".gem-c-layout-header")
|
10
|
+
static_header = dest.at_css("#global-header")
|
11
|
+
if header_value && layout_header
|
12
|
+
static_header.remove if static_header
|
13
|
+
elsif !header_value
|
14
|
+
layout_header.remove if layout_header
|
15
|
+
end
|
16
|
+
|
9
17
|
if header_value == "signed-in"
|
10
18
|
remove_signed_out(dest)
|
11
19
|
elsif header_value == "signed-out"
|
@@ -18,12 +26,22 @@ module Slimmer::Processors
|
|
18
26
|
|
19
27
|
def remove_signed_out(dest)
|
20
28
|
signed_out = dest.at_css("#global-header #accounts-signed-out")
|
29
|
+
signed_out_link = dest.css(".gem-c-layout-header [data-link-for='accounts-signed-out']")
|
30
|
+
|
21
31
|
signed_out.remove if signed_out
|
32
|
+
signed_out_link.each do |link|
|
33
|
+
link.parent.remove
|
34
|
+
end
|
22
35
|
end
|
23
36
|
|
24
37
|
def remove_signed_in(dest)
|
25
38
|
signed_in = dest.at_css("#global-header #accounts-signed-in")
|
39
|
+
signed_in_link = dest.css(".gem-c-layout-header [data-link-for='accounts-signed-in']")
|
40
|
+
|
26
41
|
signed_in.remove if signed_in
|
42
|
+
signed_in_link.each do |link|
|
43
|
+
link.parent.remove
|
44
|
+
end
|
27
45
|
end
|
28
46
|
end
|
29
47
|
end
|
data/lib/slimmer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slimmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 15.4.
|
4
|
+
version: 15.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|