Skip to content
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

release versions/v1.13.12 #1304

Merged
merged 19 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6b9379b
HPC-10032: Fix import issue with regards to the coordination menu
berliner Jan 23, 2025
f3137e4
Merge pull request #1294 from UN-OCHA/berliner/HPC-10032
berliner Jan 23, 2025
a1faecf
Merge pull request #1296 from UN-OCHA/main
berliner Jan 23, 2025
a0902fd
HPC-10032: Style changes for the mega menus
berliner Jan 23, 2025
df52c5e
Merge pull request #1297 from UN-OCHA/berliner/HPC-10032
berliner Jan 23, 2025
1357df1
HPC-10037: Prevent fatal error when trying to edit data points withou…
berliner Jan 27, 2025
81ccfb1
HPC-10037: Prevent warning in edge cases for attachments that are mis…
berliner Jan 27, 2025
9e541e2
Merge pull request #1298 from UN-OCHA/berliner/HPC-10037
berliner Jan 27, 2025
04eb129
HPC-10036: Sync gho-story component styles from CM
berliner Jan 28, 2025
77ce459
HPC-10032: Use same bottom space for non-linked 3rd level mega menu i…
berliner Jan 28, 2025
91332fc
HPC-10032: Prevent errors in link caroussel
berliner Jan 28, 2025
9ee39b4
Merge pull request #1299 from UN-OCHA/berliner/HPC-10036
berliner Jan 28, 2025
c4949c8
Merge pull request #1300 from UN-OCHA/berliner/HPC-10032
berliner Jan 28, 2025
2017041
HPC-10015: Sync some gho components from CM
berliner Jan 29, 2025
be9ad2e
HPC-10022: Copy gho-separator component from CM
berliner Jan 29, 2025
afb9aec
Merge pull request #1301 from UN-OCHA/berliner/HPC-10015
berliner Jan 29, 2025
44aee24
Merge pull request #1302 from UN-OCHA/berliner/HPC-10022
berliner Jan 29, 2025
7d83e15
HPC-10015: Sync gho-top-figures component from CM
berliner Jan 30, 2025
0cd8953
Merge pull request #1303 from UN-OCHA/berliner/HPC-10015
berliner Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public function buildContent() {
}

$link = $item_type->getLink();
if (!$link) {
continue;
}
$attributes = $link->getUrl()->getOption('attributes');
$attributes['class'] = ['cd-button', 'read-more'];
$link->getUrl()->setOption('attributes', $attributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function getDefaultLabel() {
$attachment = $this->getAttachmentObject();
$data_point_conf = $this->get('data_point');
$data_point_index = $data_point_conf ? $data_point_conf['data_points'][0]['index'] : NULL;
if ($data_point_index === NULL) {
if (!$attachment || $data_point_index === NULL) {
return NULL;
}
return $attachment->getPrototype()->getDefaultFieldLabel($data_point_index, $attachment->getPlanLanguage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,19 @@ public static function validateElement(&$element, FormStateInterface $form_state

/**
* Get the tag line.
*
* @return string|null
* The tag line string or NULL.
*/
public function getTagLine() {
return $this->config['value']['tag_line'] ?? NULL;
}

/**
* Get the description.
*
* @return string
* The description string.
*/
public function getDescription() {
return $this->config['value']['description'];
Expand Down Expand Up @@ -118,8 +124,8 @@ public function getImageCaption() {
/**
* Get the link.
*
* @return \Drupal\Core\Link
* A link object.
* @return \Drupal\Core\Link|null
* A link object or NULL.
*/
public function getLink() {
$label = $this->getButtonLabel() ?? $this->t('Read more');
Expand All @@ -129,8 +135,8 @@ public function getLink() {
/**
* Get the url.
*
* @return \Drupal\Core\Url
* A url object.
* @return \Drupal\Core\Url|null
* A url object or NULL.
*/
public function getUrl() {
try {
Expand All @@ -145,8 +151,8 @@ public function getUrl() {
/**
* Get the url as a string.
*
* @return string
* The url as a string.
* @return string|null
* The url as a string or NULL.
*/
public function getUrlString() {
$url = $this->getUrl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public function getLinkFromConfiguration(array $conf, array $contexts) {
* @param string $label
* Optional label to use. If left empty, a default label will be build.
*
* @return \Drupal\Core\Link
* The link object.
* @return \Drupal\Core\Link|null
* The link object or NULL.
*/
protected function getLinkFromUri($uri, $label = NULL) {
$label = $label ?? NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ public function formatValue(array $conf) {

$data_point_index = $conf['data_points'][0]['index'];
$field = $this->getFieldByIndex($data_point_index);
if ($this->isCumulativeReachFieldType($field->type)) {
if ($field && $this->isCumulativeReachFieldType($field->type)) {
$period = $this->getLastNonEmptyReportingPeriod($data_point_index);
$build['#reporting_period'] = $period?->id ?? $build['#reporting_period'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ gho-related-articles:
css:
theme:
components/gho-related-articles/gho-related-articles.css: {}
gho-separator:
css:
theme:
components/gho-separator/gho-separator.css: {}
gho-story:
css:
theme:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Global Humanitarian Overview - Interactive Content Component
HPC Content Module - Interactive Content Component
============================================================

Styling of interactive content (ex: map, infographic etc.).
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
/**
* Support for 4-col interactive content.
*/
.layout--fourcol--interactive-content {
.layout--fourcol--interactive-content {
display: flex;
flex-wrap: wrap;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
HPC Content Module - Separator Component
==================================================

It's a horizontal rule. Half or Full width of the `reading-width`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.gho-separator {
margin: 2rem 0;
}
.gho-separator__separator {
width: 100%;
max-width: none;
height: 1px;
margin: 0;
border: none;
background: #d8d8d8;
}
.gho-separator__separator--half {
width: var(--reading-width);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
display: flex;
flex-direction: column;
}
.gho-story--teaser {
max-width: var(--reading-width);
}

.gho-story > * {
flex: 0 0 auto;
}
Expand All @@ -17,40 +15,6 @@
* the content on small screens. */
order: 0;
}
.gho-story--full .gho-story__header {
margin-bottom: 1rem;
}

.gho-story--full .gho-aside__pre-title {
display: block;
max-width: var(--reading-width);
margin-bottom: 1rem;
color: #707070;
font-size: 0.875rem;
}

@media (min-width: 1024px) {
.gho-story--full .gho-aside__pre-title {
margin-bottom: 1.25rem;
}
}
.gho-story--full .page-title {
max-width: var(--reading-width);
padding: 0;
color: #1f1f1f;
border: none;
font-size: 1.625rem;
font-weight: 700;
line-height: 1.75rem;
}

@media (min-width: 768px) {
.gho-story--full .page-title {
font-size: 2.25rem;
line-height: 2.5rem;
}
}

.gho-story .field--name-field-media {
margin-bottom: 1rem;
}
Expand All @@ -60,8 +24,7 @@
.gho-story .media-caption {
margin-bottom: 2rem;
padding: 0.5rem 0;
color: #fff;
border-bottom: 1px solid #fff;
border-bottom: 1px solid #d8d8d8;
font-size: 0.75rem;
}
@media (min-width: 768px) {
Expand Down Expand Up @@ -140,3 +103,36 @@
margin: 0;
}
}

.gho-story--embed,
.gho-story--full {
max-width: var(--reading-width);
}
.gho-story--embed .media-caption .credit {
color: #fff;
}

.gho-story--full .gho-aside__pre-title {
display: block;
max-width: var(--reading-width);
color: #707070;
font-size: 0.875rem;
}
.gho-story--full .gho-aside__title {
color: inherit;
}
.gho-story--full .page-title {
max-width: var(--reading-width);
padding: 0;
color: #1f1f1f;
border: none;
font-size: 1.625rem;
font-weight: 700;
line-height: 1.75rem;
}
@media (min-width: 768px) {
.gho-story--full .page-title {
font-size: 2.25rem;
line-height: 2.5rem;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Base field.
*/
.gho-top-figures--small {
.gho-top-figures--small {
margin-top: 2rem;
font-size: 0.875rem;
line-height: 1.25rem;
Expand All @@ -15,6 +15,7 @@
border-top: 1px solid #d8d8d8;
}
/* Hide the border when the figures follow another top figures paragraph. */
.gho-caption--article + .gho-top-figures--small::before,
.gho-top-figures + .gho-top-figures--small::before {
content: none;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.gho-top-figures .gho-figures {
padding-bottom: 2rem;
}
.gho-top-figures .gho-figures--large {
border-bottom: 1px solid #d8d8d8;
}
.gho-top-figures:not(.gho-top-figures--small) .gho-figures .gho-figure {
Expand Down Expand Up @@ -29,29 +31,49 @@
font-weight: bold;
}

@media (min-width: 768px) {
@media (min-width: 576px) {
.gho-top-figures .gho-figures--large {
border-bottom: 0;
}
.gho-top-figures .gho-figures--large::before,
.gho-top-figures .gho-figures--large::after {
display: block;
flex: unset;
content: "";
width: 100%;
border-top: 1px solid #d8d8d8;
border-bottom: 0;
margin-left: 1.5rem;
}
.gho-top-figures .gho-figures--large::after {
border-top: 0;
border-bottom: 1px solid #d8d8d8;
}
.gho-top-figures .gho-figures {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding-top: 2rem;
border-top: 1px solid #d8d8d8;
margin-left: -1.5rem;
padding-top: 0;
padding-bottom: 0;
}
/* hide border-top when NaR immediately follows a Hero image caption */
.gho-caption--article + .gho-top-figures .gho-figures {
/* hide border-top when top figures immediately follows a Hero image caption */
.gho-caption--article + .gho-top-figures .gho-figures,
.gho-caption--article + .gho-top-figures .gho-figures::before {
border-top: 0;
}
.gho-top-figures:not(.gho-top-figures--small) .gho-figures .gho-figure {
display: inline-block;
flex-grow: 1;
flex-shrink: 0;
margin-top: 2rem;
margin-bottom: 2rem;
padding: 0 1.5rem;
border-width: 0 0 0 1px;
}
[dir="ltr"]
.gho-top-figures:not(.gho-top-figures--small)
.gho-figures
.gho-figure:first-child {
padding-left: 0;
border-width: 0;
}
[dir="ltr"]
Expand All @@ -64,19 +86,6 @@
.gho-top-figures:not(.gho-top-figures--small)
.gho-figures
.gho-figure:first-child {
padding-right: 0;
border-width: 0 0 0 1px;
}
[dir="rtl"]
.gho-top-figures:not(.gho-top-figures--small)
.gho-figures
.gho-figure:last-child {
padding-left: 0;
}
[dir="rtl"]
.gho-top-figures:not(.gho-top-figures--small)
.gho-figures
.gho-figure:last-child {
border-width: 0;
}
.gho-top-figures .gho-figure__label {
Expand Down
2 changes: 1 addition & 1 deletion html/themes/custom/common_design_subtheme/css/styles.css

Large diffs are not rendered by default.

16 changes: 3 additions & 13 deletions html/themes/custom/common_design_subtheme/sass/ghi/_ghi-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,6 @@
span {
display: inline-block;
padding: 0;

// &:focus,
// &:hover {
// color: inherit;
// background: inherit;
// }
}

a:focus,
Expand Down Expand Up @@ -244,24 +238,20 @@
display: none;
}
}

span {
padding-bottom: 0.5rem;
}
}
}

&[role="navigation"] > ul > li,
details > ul > li {
font-weight: bold;

& > a {
& > a,
& > span {
margin-bottom: 0.5rem;
}

&.leaf {
padding-bottom: 2rem;
font-weight: normal;

a:hover,
a:focus,
Expand Down Expand Up @@ -305,7 +295,7 @@
}
}

&.mega-menu--gho-menu details.vertical-tabs__pane > ul > li {
details.vertical-tabs__pane > ul > li {
break-inside: avoid-column;
}
}
Expand Down
Loading