Skip to content

Commit

Permalink
Merge pull request #932 from hmrc/SDT-813_messages-pattern
Browse files Browse the repository at this point in the history
Documentation for the messages pattern
  • Loading branch information
mikeash82 authored May 17, 2018
2 parents 751d25f + 75a5601 commit cbaf161
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 3 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Run tests in desktop viewport instead of phantom's default 400 [#927](https://github.com/hmrc/assets-frontend/pull/927)
- Fixed broken link on "errors and validation" styles page [#937](https://github.com/hmrc/assets-frontend/pull/937)

### Added
- Documentation for page title [#928](https://github.com/hmrc/assets-frontend/pull/928)
- Documentation for open links in a new window or tab component [#926](https://github.com/hmrc/assets-frontend/pull/926)
- Documentation for messages pattern [#932](https://github.com/hmrc/assets-frontend/pull/932)

### Updated
- Documentation and examples for page not found, service unavailable and there is a problem with the service [#936](https://github.com/hmrc/assets-frontend/pull/936)
- Updated notification badge CSS, code and examples [#934](https://github.com/hmrc/assets-frontend/pull/934)
Expand Down Expand Up @@ -289,13 +294,11 @@ This entire version is covered by a single pull request. [#867](https://github.c
- Changes to nginx error pages not being build and deployed [#734]

[Unreleased]: https://github.com/hmrc/assets-frontend/compare/release/4.2.0...master
[4.2.4]: https://github.com/hmrc/assets-frontend/compare/release/4.2.3...release/4.2.4
[4.2.3]: https://github.com/hmrc/assets-frontend/compare/release/4.2.2...release/4.2.3
[4.2.2]: https://github.com/hmrc/assets-frontend/compare/release/4.2.1...release/4.2.2
[4.2.1]: https://github.com/hmrc/assets-frontend/compare/release/4.2.0...release/4.2.1
[4.2.0]: https://github.com/hmrc/assets-frontend/compare/release/4.1.0...release/4.2.0
[4.1.0]: https://github.com/hmrc/assets-frontend/compare/release/3.0.2...release/4.1.0
[3.2.4]: https://github.com/hmrc/assets-frontend/compare/release/3.2.4...release/3.2.4
[3.2.3]: https://github.com/hmrc/assets-frontend/compare/release/3.2.2...release/3.2.3
[3.2.2]: https://github.com/hmrc/assets-frontend/compare/release/3.2.1...release/3.2.2
[3.2.1]: https://github.com/hmrc/assets-frontend/compare/release/3.2.0...release/3.2.1
Expand Down
3 changes: 2 additions & 1 deletion assets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ $path: "../images/";
@import "scss/backward-compatibility";

// HMRC Design System
@import "components/all-components"
@import "components/all-components";
@import "patterns/all-patterns";
2 changes: 2 additions & 0 deletions assets/patterns/_all-patterns.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// HMRC Design System - patterns
@import "messages/messages";
50 changes: 50 additions & 0 deletions assets/patterns/messages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Messages

This pattern is used to display messages sent to a user from an HMRC service.

## When to use this pattern

Use this pattern when a service needs to send messages to users. The messages are not deleted and can be referred back to at any time.

### When not to use this pattern

Do not use this as the only way of sharing important or time-sensitive information with a user. Only display messages when users are signed in to a service.

## How it works

This patterns has 2 views:

* message list
* message details

### Message list

Display a summary of messages the user has received. The list has:

- subject of the message
- date the message was sent
- a link to the full message
- a read and unread state

#### Unread messages

{{ example("messages-unread.html") }}
{{ markup("messages-unread.html") }}

#### Read messages

{{ example("messages-read.html") }}
{{ markup("messages-read.html") }}

### Message details

Display a complete message. Include:

- subject of the message
- date the message was sent
- message content
- back link that takes you to the message list

## Research on this pattern

{{ research(44) }}
25 changes: 25 additions & 0 deletions assets/patterns/messages/_messages.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.message-inbox__list {
display: table;
width: 100%;
border-top: 1px solid #a1acb2;

.message-inbox__list-item {
font-weight: bold;
a:link{
text-decoration: none;
}
&.message-inbox__list-item--read {
background-color: #f8f8f8;
font-weight: normal;
}
}

.message-inbox__block {
display: table-cell;
padding: 20px 10px;
border-bottom: 1px solid #a1acb2;
&.no-wrap {
white-space: nowrap;
}
}
}
17 changes: 17 additions & 0 deletions assets/patterns/messages/messages-read.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="message-inbox">
<h2 class="heading-medium">Messages</h2>
<div class="message-inbox__list" role="list">
<div class="message-inbox__list-item message-inbox__list-item--read" role="listitem"><span
class="visually-hidden">read</span> <a class="message-inbox__block" href="/">Pub Moon under the water 5 - 7a Temple Place, Brighton BN3 7JB - Client: Mr A Client</a>
<span class="message-inbox__block no-wrap">29 March 2018</span>
</div>
<div class="message-inbox__list-item message-inbox__list-item--read" role="listitem"><span
class="visually-hidden">read</span> <a class="message-inbox__block" href="/">Pub Moon under the water 5 - 7a Temple Place, Brighton BN3 7JB - Client: Mr A Client</a>
<span class="message-inbox__block no-wrap">24 February 2018</span>
</div>
<div class="message-inbox__list-item message-inbox__list-item--read" role="listitem"><span
class="visually-hidden">read</span> <a class="message-inbox__block" href="/">Pub Moon under the water 5 - 7a Temple Place, Brighton BN3 7JB - Client: Mr A Client</a>
<span class="message-inbox__block no-wrap">04 Janurary 2018</span>
</div>
</div>
</div>
17 changes: 17 additions & 0 deletions assets/patterns/messages/messages-unread.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="message-inbox">
<h2 class="heading-medium">Messages</h2>
<div class="message-inbox__list" role="list">
<div class="message-inbox__list-item" role="listitem"><span
class="visually-hidden">unread</span> <a class="message-inbox__block" href="/">Pub Moon under the water 5 - 7a Temple Place, Brighton BN3 7JB - Client: Mr A Client</a>
<span class="message-inbox__block no-wrap">29 March 2018</span>
</div>
<div class="message-inbox__list-item" role="listitem"><span
class="visually-hidden">unread</span> <a class="message-inbox__block" href="/">Pub Moon under the water 5 - 7a Temple Place, Brighton BN3 7JB - Client: Mr A Client</a>
<span class="message-inbox__block no-wrap">24 February 2018</span>
</div>
<div class="message-inbox__list-item" role="listitem"><span
class="visually-hidden">unread</span> <a class="message-inbox__block" href="/">Pub Moon under the water 5 - 7a Temple Place, Brighton BN3 7JB - Client: Mr A Client</a>
<span class="message-inbox__block no-wrap">04 Janurary 2018</span>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions component-library-template
Submodule component-library-template added at e359f0

0 comments on commit cbaf161

Please sign in to comment.