-
Notifications
You must be signed in to change notification settings - Fork 9
PDS lookup timeline #4462
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
Merged
Merged
PDS lookup timeline #4462
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,5 @@ | |
@forward "summary-list"; | ||
@forward "tables"; | ||
@forward "tag"; | ||
@forward "timeline"; | ||
@forward "vaccine-method"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
@use "../vendor/nhsuk-frontend" as *; | ||
|
||
$_badge-size-mobile: 16px; | ||
$_badge-small-size-mobile: 12px; | ||
$_timeline-border-width: 2px; | ||
|
||
@function _dot-size($size) { | ||
@if $size == "default" { | ||
@return $_badge-size-mobile; | ||
} @else if $size == "small" { | ||
@return $_badge-small-size-mobile; | ||
} | ||
} | ||
|
||
@function _dot-ml($size) { | ||
@return - calc(($size / 2) + ($_timeline-border-width / 2)); | ||
} | ||
|
||
@function _dot-mt-tablet($margin) { | ||
@return $margin - 1px; | ||
} | ||
|
||
@mixin _badge($size) { | ||
$mt: 4px; | ||
$mt-small: 6px; | ||
|
||
height: _dot-size($size); | ||
margin-left: _dot-ml(_dot-size($size)); | ||
margin-right: if( | ||
$size == "default", | ||
nhsuk-spacing(4), | ||
nhsuk-spacing(4) + 2px | ||
); | ||
margin-top: if($size == "default", $mt, $mt-small); | ||
width: _dot-size($size); | ||
|
||
@include nhsuk-media-query($from: tablet) { | ||
$tablet: _dot-size($size) + 4px; | ||
|
||
height: $tablet; | ||
margin-left: _dot-ml($tablet); | ||
margin-top: if( | ||
$size == "default", | ||
_dot-mt-tablet($mt), | ||
_dot-mt-tablet($mt-small) | ||
); | ||
width: $tablet; | ||
} | ||
} | ||
|
||
.app-timeline { | ||
list-style: none; | ||
padding: 0; | ||
|
||
@include nhsuk-responsive-margin(5, "bottom"); | ||
@include nhsuk-responsive-padding(2, "top"); | ||
|
||
&__item { | ||
display: flex; | ||
margin-bottom: 0; | ||
margin-left: 12px; | ||
margin-top: -6px; | ||
position: relative; | ||
|
||
@include nhsuk-responsive-padding(5, "bottom"); | ||
|
||
&:last-child { | ||
padding: 0; | ||
|
||
&::before { | ||
border: none; | ||
} | ||
} | ||
|
||
&::before { | ||
border-left: $_timeline-border-width solid $color_nhsuk-grey-3; | ||
bottom: 0; | ||
content: ""; | ||
display: block; | ||
left: -$_timeline-border-width; | ||
position: absolute; | ||
top: nhsuk-spacing(2); | ||
width: $_timeline-border-width; | ||
} | ||
|
||
&--past::before { | ||
border-color: $color_nhsuk-blue; | ||
} | ||
} | ||
|
||
&__badge { | ||
flex-shrink: 0; | ||
z-index: 1; | ||
|
||
@include _badge("default"); | ||
|
||
&--small { | ||
@include _badge("small"); | ||
} | ||
} | ||
|
||
&__header { | ||
font-weight: normal; | ||
margin-bottom: 0; | ||
|
||
@include nhsuk-font-size(19); | ||
|
||
&.nhsuk-u-font-weight-bold .app-u-monospace { | ||
font-weight: inherit; | ||
} | ||
} | ||
|
||
&__content { | ||
:last-child { | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
&__description { | ||
color: $nhsuk-secondary-text-color; | ||
padding-top: 0; | ||
|
||
@include nhsuk-responsive-margin(2, "bottom"); | ||
@include nhsuk-font-size(16); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# frozen_string_literal: true | ||
|
||
class AppTimelineComponent < ViewComponent::Base | ||
erb_template <<-ERB | ||
<ul class="app-timeline"> | ||
<% @items.each do |item| %> | ||
<% next if item.blank? %> | ||
|
||
<li class="app-timeline__item <%= 'app-timeline__item--past' if item[:is_past_item] %>"> | ||
<% if item[:active] || item[:is_past_item] %> | ||
<svg class="app-timeline__badge" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"> | ||
<circle cx="14" cy="14" r="13" fill="#005EB8"/> | ||
</svg> | ||
<% else %> | ||
<svg class="app-timeline__badge app-timeline__badge--small" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14"> | ||
<circle cx="7" cy="7" r="6" fill="white" stroke="#AEB7BD" stroke-width="2"/> | ||
</svg> | ||
<% end %> | ||
|
||
<div class="app-timeline__content"> | ||
<h3 class="app-timeline__header <%= 'nhsuk-u-font-weight-bold' if item[:active] %>"> | ||
<%= item[:heading_text].html_safe %> | ||
</h3> | ||
|
||
<% if item[:description].present? %> | ||
<p class="app-timeline__description"><%= item[:description].html_safe %></p> | ||
<% end %> | ||
</div> | ||
</li> | ||
<% end %> | ||
</ul> | ||
ERB | ||
|
||
def initialize(items) | ||
@items = items | ||
end | ||
|
||
def render? | ||
@items.present? | ||
end | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<% content_for :before_main do %> | ||
<%= render AppBreadcrumbComponent.new(items: [ | ||
{ text: t("dashboard.index.title"), href: dashboard_path }, | ||
{ text: t("patients.index.title"), href: patients_path }, | ||
{ text: @patient.full_name, href: patient_path(@patient) }, | ||
]) %> | ||
<% end %> | ||
|
||
<% page_title = "NHS number lookup history" %> | ||
<%= h1 page_title: do %> | ||
<span class="nhsuk-caption-l"><%= @patient.full_name %></span> | ||
<%= page_title %> | ||
<% end %> | ||
|
||
<p class="nhsuk-u-reading-width">The following timeline shows how this child's NHS number was found by searching the NHS Patient Demographics Service (PDS)</p> | ||
|
||
<%= render AppTimelineComponent.new(@timeline_items) %> | ||
|
||
<h2 class="nhsuk-heading-m">Terms used in this lookup</h2> | ||
|
||
<p class="nhsuk-u-reading-width">A fuzzy search finds text that matches a term closely as well as exactly. | ||
For example, a fuzzy search can identify Jon Smith even if the term entered was John Smith.</p> | ||
|
||
<p class="nhsuk-u-reading-width">A wildcard searches for unknown parts of text. For example, if you only | ||
have part of a postcode: CV1, you can use a wildcard to search all records with a postcode | ||
that includes CV1.</p> | ||
|
||
<p class="nhsuk-u-reading-width">History refers to the child’s history, for example if they have changed | ||
their name or address.</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.