moj_components 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/app/components/moj_component/alert_component.html.erb +11 -9
- data/app/components/moj_component/alert_component.rb +12 -1
- data/app/components/moj_component/header_component.html.erb +2 -1
- data/app/components/moj_component/header_component.rb +6 -3
- data/app/components/moj_component/interruption_card_component.html.erb +2 -2
- data/lib/moj_component/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: fe274ec755052a96ad36ae351924c74c66297719cb4cf62c40436c3cf03df80b
|
|
4
|
+
data.tar.gz: e190f092ee29b19fb40362a4fad40d433db14c082d1a56482092edb3ac1051bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 43846fd5d9105264ae60a2cc16f704907431ec22d96ffc20118338401919545b1e5281e6e854b5f3f336f17c26fe47f44b6a45fa9994caac50d4a8947c028f69
|
|
7
|
+
data.tar.gz: c429ad8105f87a5855308d2f27016e28aa4950346f80823365283e4959d0538a6e0b7d92a8a858c692a0a9a7481cbcfc5c1c4925a3d89dbd32d7a4538797f86c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.3.0] - 2026-09-30
|
|
4
|
+
|
|
5
|
+
- Add pod security context to deployment
|
|
6
|
+
- Add simplecov to flag low test coverage
|
|
7
|
+
- Update header to accept `service_name` and `service_url` to display the service name
|
|
8
|
+
- Update interruption card html to match moj-frontend documentation
|
|
9
|
+
- Fix bug so icons in alert are displaying correctly
|
|
10
|
+
- Allow alert to have no dismiss link
|
|
11
|
+
|
|
3
12
|
## [0.2.3] - 2026-08-05
|
|
4
13
|
|
|
5
14
|
- Fix release pipeline
|
data/README.md
CHANGED
|
@@ -38,7 +38,7 @@ You can render components directly in templates using helper methods provided by
|
|
|
38
38
|
) %>
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
More [information about each of the components is available here.](https://moj-components-
|
|
41
|
+
More [information about each of the components is available here.](https://moj-components-prod.apps.live.cloud-platform.service.justice.gov.uk/)
|
|
42
42
|
|
|
43
43
|
## Development
|
|
44
44
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div role="region" class="moj-alert <%= dynamic_class %> moj-alert--with-heading" aria-label="<%= type %>: <%= heading %>" data-module="moj-alert">
|
|
4
4
|
<div>
|
|
5
5
|
<svg class="moj-alert__icon" role="presentation" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" height="30" width="30">
|
|
6
|
-
|
|
6
|
+
<%= icon %>
|
|
7
7
|
</svg>
|
|
8
8
|
</div>
|
|
9
9
|
<div class="moj-alert__content">
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
<% end %>
|
|
13
13
|
<%= body %>
|
|
14
14
|
</div>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
<% if dismiss_text.present? %>
|
|
16
|
+
<div class="moj-alert__action">
|
|
17
|
+
<%= govuk_link_to(
|
|
18
|
+
dismiss_text,
|
|
19
|
+
dismiss_href,
|
|
20
|
+
method: dismiss_method,
|
|
21
|
+
class: "moj-alert__dismiss",
|
|
22
|
+
) %>
|
|
23
|
+
</div>
|
|
24
|
+
<% end %>
|
|
23
25
|
</div>
|
|
@@ -9,7 +9,7 @@ module MojComponent
|
|
|
9
9
|
:dismiss_text,
|
|
10
10
|
:dismiss_method
|
|
11
11
|
|
|
12
|
-
def initialize(type:, heading:, body:, dismiss_href
|
|
12
|
+
def initialize(type:, heading:, body:, dismiss_href: nil, dismiss_text: "Dismiss", dismiss_method: :post)
|
|
13
13
|
@type = check_type(type)
|
|
14
14
|
@heading = heading
|
|
15
15
|
@body = body
|
|
@@ -19,6 +19,13 @@ module MojComponent
|
|
|
19
19
|
super()
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
ICON_ATTRIBUTES = {
|
|
23
|
+
information: { "fill-rule" => "evenodd", "clip-rule" => "evenodd", "fill" => "currentColor", d: "M10.2165 3.45151C11.733 2.82332 13.3585 2.5 15 2.5C16.6415 2.5 18.267 2.82332 19.7835 3.45151C21.3001 4.07969 22.6781 5.00043 23.8388 6.16117C24.9996 7.3219 25.9203 8.69989 26.5485 10.2165C27.1767 11.733 27.5 13.3585 27.5 15C27.5 18.3152 26.183 21.4946 23.8388 23.8388C21.4946 26.183 18.3152 27.5 15 27.5C13.3585 27.5 11.733 27.1767 10.2165 26.5485C8.69989 25.9203 7.3219 24.9996 6.16117 23.8388C3.81696 21.4946 2.5 18.3152 2.5 15C2.5 11.6848 3.81696 8.50537 6.16117 6.16117C7.3219 5.00043 8.69989 4.07969 10.2165 3.45151ZM16.3574 22.4121H13.6621V12.95H16.3574V22.4121ZM13.3789 9.20898C13.3789 8.98763 13.4212 8.7793 13.5059 8.58398C13.5905 8.38216 13.7044 8.20964 13.8477 8.06641C13.9974 7.91667 14.1699 7.79948 14.3652 7.71484C14.5605 7.63021 14.7721 7.58789 15 7.58789C15.2214 7.58789 15.4297 7.63021 15.625 7.71484C15.8268 7.79948 15.9993 7.91667 16.1426 8.06641C16.2923 8.20964 16.4095 8.38216 16.4941 8.58398C16.5788 8.7793 16.6211 8.98763 16.6211 9.20898C16.6211 9.43685 16.5788 9.64844 16.4941 9.84375C16.4095 10.0391 16.2923 10.2116 16.1426 10.3613C15.9993 10.5046 15.8268 10.6185 15.625 10.7031C15.4297 10.7878 15.2214 10.8301 15 10.8301C14.7721 10.8301 14.5605 10.7878 14.3652 10.7031C14.1699 10.6185 13.9974 10.5046 13.8477 10.3613C13.7044 10.2116 13.5905 10.0391 13.5059 9.84375C13.4212 9.64844 13.3789 9.43685 13.3789 9.20898Z" },
|
|
24
|
+
success: { "fill" => "currentColor", d: "M11.2869 24.6726L2.00415 15.3899L4.62189 12.7722L11.2869 19.4186L25.3781 5.32739L27.9958 7.96369L11.2869 24.6726Z" },
|
|
25
|
+
warning: { "fill-rule" => "evenodd", "clip-rule" => "evenodd", "fill" => "currentColor", d: "M15 2.44922L28.75 26.1992H1.25L15 2.44922ZM13.5107 9.49579H16.4697L16.2431 17.7678H13.7461L13.5107 9.49579ZM13.1299 21.82C13.1299 21.5661 13.1787 21.3285 13.2764 21.1071C13.374 20.8793 13.5075 20.6807 13.6768 20.5114C13.8525 20.3421 14.0544 20.2087 14.2822 20.111C14.5101 20.0134 14.7542 19.9645 15.0146 19.9645C15.2686 19.9645 15.5062 20.0134 15.7275 20.111C15.9554 20.2087 16.154 20.3421 16.3232 20.5114C16.4925 20.6807 16.626 20.8793 16.7236 21.1071C16.8213 21.3285 16.8701 21.5661 16.8701 21.82C16.8701 22.0804 16.8213 22.3246 16.7236 22.5524C16.626 22.7803 16.4925 22.9789 16.3232 23.1481C16.154 23.3174 15.9554 23.4509 15.7275 23.5485C15.5062 23.6462 15.2686 23.695 15.0146 23.695C14.7542 23.695 14.5101 23.6462 14.2822 23.5485C14.0544 23.4509 13.8525 23.3174 13.6768 23.1481C13.5075 22.9789 13.374 22.7803 13.2764 22.5524C13.1787 22.3246 13.1299 22.0804 13.1299 21.82Z" },
|
|
26
|
+
error: { "fill-rule" => "evenodd", "clip-rule" => "evenodd", "fill" => "currentColor", d: "M20.1777 2.5H9.82233L2.5 9.82233V20.1777L9.82233 27.5H20.1777L27.5 20.1777V9.82233L20.1777 2.5ZM10.9155 8.87769L15.0001 12.9623L19.0847 8.87771L21.1224 10.9154L17.0378 15L21.1224 19.0846L19.0847 21.1222L15.0001 17.0376L10.9155 21.1223L8.87782 19.0846L12.9624 15L8.87783 10.9153L10.9155 8.87769Z" },
|
|
27
|
+
}.freeze
|
|
28
|
+
|
|
22
29
|
private
|
|
23
30
|
|
|
24
31
|
def check_type(type)
|
|
@@ -26,5 +33,9 @@ module MojComponent
|
|
|
26
33
|
|
|
27
34
|
type
|
|
28
35
|
end
|
|
36
|
+
|
|
37
|
+
def icon
|
|
38
|
+
tag.path(**ICON_ATTRIBUTES.fetch(type))
|
|
39
|
+
end
|
|
29
40
|
end
|
|
30
41
|
end
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
<path fill="#ffffff" fill-rule="evenodd" d="M15.0611 32.3472L15.2903 33.5459L15.025 33.5944L14.7885 32.4032C14.626 32.4331 14.534 32.4331 14.3119 32.5339L14.3047 32.265L15.4528 32.1119L15.5322 32.3378C15.4275 32.2986 15.0611 32.3472 15.0611 32.3472ZM14.2235 33.7512L13.4275 33.9398C13.4419 33.8166 13.1748 32.6627 13.1062 32.5582L13.9455 32.3584L13.8787 32.6496C13.7632 32.616 13.626 32.6179 13.4708 32.6515L13.5683 33.0697L14.0322 32.9596L14.108 33.1631C14.0159 33.1482 13.7361 33.2228 13.6098 33.2471L13.7109 33.684C13.9383 33.6299 14.1278 33.5496 14.2758 33.4432L14.2795 33.445L14.2235 33.7512ZM11.913 34.1788C11.3318 34.1937 11.2469 33.3349 11.1115 32.911L11.3931 32.8569C11.5285 33.2247 11.4906 34.0873 12.0881 33.9734C12.5213 33.7736 12.1711 33.0623 12.126 32.7206L12.404 32.6795C12.5087 33.249 12.7578 34.2367 11.913 34.1788ZM11.0953 34.3095L10.2975 34.4906C10.3137 34.3674 10.0574 33.2116 9.99059 33.1052L10.83 32.9129L10.7614 33.2042C10.6458 33.1706 10.5086 33.1706 10.3534 33.2023L10.4473 33.6205L10.9112 33.516L10.987 33.7195C10.8931 33.7046 10.6133 33.7755 10.487 33.7998L10.5845 34.2367C10.8119 34.1844 11.0014 34.106 11.1513 34.0014L11.1549 34.0033L11.0953 34.3095ZM9.6007 34.6437C9.62055 34.2348 9.48878 33.5944 9.31008 33.2284L9.69997 33.1426C9.68012 33.5515 9.81189 34.1937 9.99059 34.5578L9.6007 34.6437ZM9.20719 34.3954C9.04293 34.8024 8.54653 34.8958 8.16024 34.9667C8.17829 34.8398 7.94183 33.6616 7.86963 33.5552C8.53931 33.2583 9.49781 33.5459 9.20719 34.3954ZM15.6188 31.7833C12.5737 31.787 9.54113 33.1332 6.49416 33.1332C6.12953 33.1332 5.76491 33.1127 5.39847 33.0697C6.34253 33.8409 6.27574 35.3868 7.6476 35.3868C7.70717 35.3868 7.77035 35.3831 7.83533 35.3775C9.69997 35.1721 11.5538 34.6269 13.3896 34.3263C13.7054 34.2759 15.2253 33.8913 16.1152 33.8913C16.4365 33.8913 16.6748 33.9417 16.7452 34.0761C16.8427 34.2572 16.238 34.7837 16.2325 34.8043C16.2325 34.8099 16.2344 34.8136 16.2416 34.8136C16.3011 34.8136 16.6351 34.6138 16.886 34.4421C17.8788 33.7046 15.7975 31.7833 15.6188 31.7833ZM29.7255 33.1127C29.6623 33.3741 29.5612 33.8689 29.5288 34.1396C30.1262 34.2703 30.3122 33.234 29.7255 33.1127ZM32.0685 33.5328C31.6118 33.4152 31.462 34.3991 31.8429 34.5578C32.3086 34.6717 32.4494 33.6934 32.0685 33.5328ZM30.8735 33.3479L30.7345 33.8707C31.1226 33.9454 31.2905 33.4133 30.8735 33.3479ZM27.211 32.5992C26.7345 32.4648 26.5504 33.4842 26.9511 33.656C27.4367 33.7904 27.6136 32.7766 27.211 32.5992Z" />
|
|
29
29
|
<path fill="#ffffff" fill-rule="evenodd" d="M33.5541 33.895C33.5541 33.895 33.3772 34.9312 33.388 35.019L33.0866 34.963C33.0811 34.9705 33.2725 34.0537 33.3194 33.8558C33.2129 33.8315 33.0866 33.8427 32.9674 33.8894L32.9656 33.8857L33.0866 33.6261L33.9043 33.7774L33.962 34.0649C33.8916 33.9958 33.6714 33.9174 33.5541 33.895ZM32.8393 33.9529C32.8086 34.1919 32.7003 34.6792 32.7436 34.907L32.4403 34.8622C32.5739 34.5074 32.6642 33.9118 32.6425 33.5328L32.9458 33.5795C32.897 33.684 32.8609 33.8091 32.8393 33.9529ZM32.0324 34.7445C31.258 34.8939 31.258 33.5403 31.8808 33.3517C32.657 33.1836 32.6606 34.5578 32.0324 34.7445ZM31.3645 33.6766C31.3266 33.8297 31.2165 33.9342 31.0378 33.9921C31.1154 34.2572 31.1624 34.345 31.2941 34.6325L31.2923 34.64L31.0883 34.6064C31.045 34.5821 30.7887 34.2087 30.7111 34.007C30.666 34.1732 30.6208 34.3842 30.6389 34.5354L30.2923 34.4794C30.3555 34.3749 30.628 33.2733 30.6172 33.1575C30.9187 33.1967 31.4584 33.2527 31.3645 33.6766ZM29.8645 34.2964C29.6822 34.3636 29.4223 34.289 29.2327 34.2516L29.4872 32.9036C30.332 32.8457 30.684 33.9772 29.8645 34.2964ZM28.6641 34.1825C28.5703 34.162 28.0594 33.0884 28.0594 33.0884C28.0594 33.0884 27.9367 33.923 27.9042 33.9809L27.6731 33.9473L27.9367 32.6384L28.193 32.6739C28.1948 32.7075 28.5991 33.5925 28.5991 33.5925C28.5991 33.5925 28.7345 32.8756 28.7472 32.8121L28.9421 32.8681L28.6641 34.1825ZM27.6009 33.3367C27.3248 34.3039 26.2471 33.7755 26.5684 32.9129C26.841 31.9756 27.9204 32.4723 27.6009 33.3367ZM26.4746 32.2949C26.4294 32.3378 26.267 33.516 26.2778 33.6317L25.9709 33.5701C26.0269 33.4674 26.0991 32.6459 26.0991 32.6459L25.572 33.4917L25.2634 32.5376C25.2634 32.5376 25.1388 33.2228 25.1334 33.4432L24.8319 33.4002C24.9294 33.2397 25.1171 32.0279 25.1171 32.0279L25.4294 32.0876C25.4366 32.1511 25.6731 32.9745 25.6731 32.9745C25.6731 32.9745 26.0865 32.2557 26.1099 32.2183L26.4764 32.2893L26.4746 32.2949ZM34.0252 33.1276C33.6443 33.1276 33.2833 33.1202 33.1046 33.1052C31.0974 32.9036 29.11 32.3098 27.1081 31.9812C26.5305 31.886 26.0576 31.7982 25.6478 31.7982C24.7976 31.7982 24.2182 32.1791 23.5341 33.6896C23.2417 34.2628 24.22 34.8099 24.4348 34.8342C23.6316 34.1247 23.9114 33.9137 24.5449 33.9137C25.4222 33.9137 26.9746 34.3151 27.2778 34.3543C29.1136 34.6568 30.9692 35.2001 32.8339 35.4074C32.8988 35.413 32.962 35.4167 33.0216 35.4167C34.3934 35.4167 34.3267 33.8689 35.2707 33.0996C35.1028 33.1146 34.5469 33.1276 34.0252 33.1276Z" />
|
|
30
30
|
</svg>
|
|
31
|
-
<%= govuk_link_to organisation_name, url, new_tab:, class: "moj-header__link moj-header__link--organisation-name" %>
|
|
31
|
+
<%= govuk_link_to organisation_name, url, new_tab:, inverse: true, class: "moj-header__link moj-header__link--organisation-name" %>
|
|
32
|
+
<%= govuk_link_to service_name, service_url, new_tab:, inverse: true, class: "moj-header__link moj-header__link--service-name" if service_name %>
|
|
32
33
|
</div>
|
|
33
34
|
|
|
34
35
|
<% if navigation_items.any? %>
|
|
@@ -6,12 +6,15 @@ module MojComponent
|
|
|
6
6
|
|
|
7
7
|
attr_reader :organisation_name,
|
|
8
8
|
:url,
|
|
9
|
-
:
|
|
10
|
-
:
|
|
9
|
+
:service_name,
|
|
10
|
+
:service_url,
|
|
11
|
+
:new_tab
|
|
11
12
|
|
|
12
|
-
def initialize(organisation_name:, url:, new_tab: false)
|
|
13
|
+
def initialize(organisation_name:, url:, service_name: nil, service_url: nil, new_tab: false)
|
|
13
14
|
@organisation_name = organisation_name
|
|
14
15
|
@url = url
|
|
16
|
+
@service_name = service_name
|
|
17
|
+
@service_url = service_url
|
|
15
18
|
@new_tab = new_tab
|
|
16
19
|
super()
|
|
17
20
|
end
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
<div class="moj-interruption-card__content">
|
|
3
3
|
<div class="govuk-grid-row">
|
|
4
4
|
<div class="govuk-grid-column-two-thirds">
|
|
5
|
-
<h1 class="
|
|
5
|
+
<h1 class="moj-interruption-card__heading"><%= heading %></h1>
|
|
6
6
|
<% if body? %>
|
|
7
|
-
<div class="
|
|
7
|
+
<div class="moj-interruption-card__body">
|
|
8
8
|
<%= body %>
|
|
9
9
|
</div>
|
|
10
10
|
<% end %>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moj_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ministry of Justice
|
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
85
85
|
- !ruby/object:Gem::Version
|
|
86
86
|
version: '0'
|
|
87
87
|
requirements: []
|
|
88
|
-
rubygems_version: 4.0.
|
|
88
|
+
rubygems_version: 4.0.20
|
|
89
89
|
specification_version: 4
|
|
90
90
|
summary: MoJ Components library for Ruby on Rails
|
|
91
91
|
test_files: []
|