Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/babel/core-7.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eebbi committed Apr 3, 2024
2 parents da42bcb + 3f4e47a commit 157e9f1
Show file tree
Hide file tree
Showing 137 changed files with 4,664 additions and 24,696 deletions.
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Severa-ID: 2108
Severa-kuvaus:
Task: https://hiondigital.atlassian.net/browse/TMS-

<!--- Provide a general summary of your changes in the Title above -->

## Description
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpcs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.1
extensions: simplexml
coverage: xdebug
env:
Expand Down
152 changes: 152 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,158 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.54.7] - 2024-03-26

- TMS-914:
- Add new anchor-links block & functionalities
- Add anchor id-elements to blocks & components
- TMS-1013: Add entries fetching to Eventz event-integration
- TMS-968: Add recurring events to event-component
- TMS-1021: Fix image alignment in image-carousel modal

## [1.54.6] - 2024-03-18

- TMS-996: Change bold image-caption text to normal
- TMS-1009: Fix error when fetching Eventz response with languages other than fi & en
- TMS-1015: Header accessibility fixes
- TMS-1017: Add image alt-text to imported news
- TMS-1018: Remove external-link icons from imported news image links

## [1.54.5] - 2024-02-01

- TMS-977: Add 'clear form' button to event-search
- TMS-1010: Fix events-lift component sorting with recurring events

## [1.54.4] - 2024-01-15

- TMS-980: Add redipress_include_search to include component contents in search results

## [1.54.3] - 2023-12-04

- TMS-939:
- Search-page form accessibility fixes
- Header search accessibility fixes
- Added focus on input when opening header search
- TMS-940: Hide current language on mobile header if only 2 languages in use
- TMS-942:
- Check / uncheck search filter checkboxes depending on choices
- Trim contact phone number in href
- Increase fly-out-nav z-index to prevent chatbot from overlapping elements

## [1.54.2] - 2023-11-22

- TMS-974: Fix event formatting if only manual events are shown

## [1.54.1] - 2023-11-22

- TMS-974: Fix fatal error in EventzFormatter

## [1.54.0] - 2023-11-21

### Added

- TMS-974:
- Add recurring events to lists as single item.
- Add recurring events to events-component
- TMS-994: Add missing list-item block to use

### Fixed

- TMS-935: Archive filter accessibility fixes

## [1.53.0] - 2023-11-07

### Added

- TMS-950:
- Empty check for phone repeater.
- Place of business posts to block
- Contacts styles & accessibility

## [1.52.0] - 2023-10-23

### Added

- TMS-970: Add image caption text to call-to-action and content-columns blocks.

## [1.51.0] - 2023-10-12

### Fixed

- TMS-934: Add screen-reader info for article categories.
- TMS-936: Image carousel accessibility fixes
- TMS-933: Modaal accessibility fixes

## [1.50.0] - 2023-10-04

- TMS-978: Add has-line-height-normal class

## [1.49.0] - 2023-09-15

- TMS-962: Add Lunch Menus plugin caps to roles.

## [1.48.0] - 2023-09-13

- TMS-973: Fix manual event sorting


## [1.47.0] - 2023-09-04

- TMS-964-2: Update translation and format pricing.

## [1.46.0] - 2023-08-30

- TMS-964: Add new Eventz api and remove old one.

## [1.45.0] - 2023-07-31

### Modified

- PIEN-8943: Allowed ReCaptcha field in GravityForms

## [1.44.0] - 2023-06-22

### Modified

- TMS-956: Add Manual Events plugin caps to roles.

## [1.43.0] - 2023-06-21

### Modified

- TMS-956: Add event datetime objects to normalized event for easier sorting.
- TMS-956: Allow filtering displayed events in Events layout.

## [1.42.4] - 2023-05-24

### Fixed

- TMS-931: Change back-to-top button to focus main-content, Add screen-reader info for links that go to external sites
- TMS-931: Navigation accessibility fixes

## [1.42.3] - 2023-05-02

### Fixed

- PIEN-8394: Add API image to og:image tag #466

## [1.42.2] - 2023-04-28

### Fixed

- PIEN-8585: Check empty links #465

## [1.42.1] - 2023-04-27

### Fixed

- PIEN-8524: Display API images #464

## [1.42.0] - 2023-04-11

- PIEN-8157: PHP 8.1
- PIEN-8439: Add pageID meta tag #463

## [1.41.2] - 2022-02-11

### Fixed
Expand Down
9 changes: 5 additions & 4 deletions assets/scripts/admin-dynamic-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
*/
const filterFields = [
'text',
'location',
'keyword',
'publisher',
'area',
'category',
'target',
'tag',
];

let $el = '';
Expand Down Expand Up @@ -103,7 +104,7 @@
response.forEach( ( item ) => {
select.append(
$( '<option /> ' )
.attr( 'value', item.id )
.attr( 'value', item._id )
.text( item.select_name )
.prop( 'selected', item.selected )
);
Expand Down
34 changes: 34 additions & 0 deletions assets/scripts/anchor-links.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2024. Hion Digital
*/

// Use jQuery as $ within this file scope.
const $ = jQuery; // eslint-disable-line no-unused-vars

/**
* Class AnchorLinks
*/
export default class AnchorLinks {

/**
* Scroll to anchor element
*
* @param {Object} event The click event object.
*
* @return {void}
*/
scrollToDiv( event ) {
$( 'html, body' ).animate( {
scrollTop: $( $( event.target ).attr( 'href' ) ).offset().top,
}, 200 );
}

/**
* Run when the document is ready.
*
* @return {void}
*/
docReady() {
$( '.anchor-links__list a' ).on( 'click', this.scrollToDiv.bind( this ) );
}
}
5 changes: 5 additions & 0 deletions assets/scripts/back-to-top.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export default class BackToTop {
$( 'html, body' ).animate( {
scrollTop: 0,
}, 200 );

// Clear the current hash if the user has used 'skip to content' button
window.location.hash = '';
// Add main-content as the location hash
window.location.hash = '#main-content';
}

/**
Expand Down
25 changes: 18 additions & 7 deletions assets/scripts/external-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ export default class ExternalLinks {
const domain = window.location.hostname;
const icon = Common.makeIcon( 'external', 'icon--medium ml-1' );

// Translations are defined in models/strings.php,
// and loaded to windows.s in lib/Assets.php.
const translations = window.s.common || {
target_blank: 'Opens in a new window',
external_link: 'The link takes you to an external website',
};

// Links in regular context
$( '#main-content a[href*="//"]:not(.button, .logo-wall__link, .link-list a, [href*="' + domain + '"])' ).append( icon ); // eslint-disable-line
$( '#main-content a[href*="//"]:not(.figure__link, .button, .logo-wall__link, .link-list a, [href*="' + domain + '"])' ).append( icon ); // eslint-disable-line

// Links with icons (replace current icon with "opens in new window" -icon)
$( '#main-content a[href*="//"]:has(.icon):not(.link-list a, [href*="' + domain + '"])' ).each( function() {
Expand All @@ -46,13 +53,17 @@ export default class ExternalLinks {
$( this ).children( '.icon' ).attr( 'aria-hidden', 'true' );
} );

// Translations are defined in models/strings.php,
// and loaded to windows.s in lib/Assets.php.
const translations = window.s.common || {
target_blank: 'Opens in a new window',
};
// Add screen reader text that informs if the link is an external website
$( '#main-content a[href*="//"]:not([href*="' + domain + '"])' ).append( `<span class="is-sr-only external-info">(${ translations.external_link })</span>` ); // eslint-disable-line

// Add instructional text for screen readers on links which open a new window/tab
$( 'a[target="_blank"]' ).append( `<span class="is-sr-only">(${ translations.target_blank })</span>` );
if ( $( 'a[target="_blank"]' ).children( '.external-info' ).length > 0 ) {
// Append the info with external link info
$( 'a[target="_blank"] .external-info' ).append( `(${ translations.target_blank })</span>` );
}
else {
// Append info to the link as its own element
$( 'a[target="_blank"]' ).append( `<span class="is-sr-only">(${ translations.target_blank })</span>` );
}
}
}
33 changes: 33 additions & 0 deletions assets/scripts/focus-on-search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2023. Hion Digital
*/

// Use jQuery as $ within this file scope.
const $ = jQuery; // eslint-disable-line no-unused-vars

/**
* Export the class reference.
*/
export default class FocusOnSearch {

/**
* Focus on search input when button is clicked
*/
FocusOnSearch() {
const $searchContainer = $( '#js-search-toggle-target' );
const $searchInput = $searchContainer.find( 'input[type=search]' );

if ( $( '#js-search-toggle' ).hasClass( 'is-active' ) ) {
$searchInput.trigger( 'focus' );
}
}

/**
* Run when the document is ready.
*
* @return {void}
*/
docReady() {
$( '#js-search-toggle' ).on( 'click', this.FocusOnSearch.bind( this ) );
}
}
4 changes: 3 additions & 1 deletion assets/scripts/image-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class ImageCarousel {
asNavFor: '#' + modalCarousel.attr( 'data-slider-for' ),
prevArrow: buttons.prevArrow,
nextArrow: buttons.nextArrow,
regionLabel: translations.modal_carousel,
regionLabel: translations.browsing_images,
arrowsPlacement: 'afterSlides',
} );

Expand Down Expand Up @@ -125,7 +125,9 @@ export default class ImageCarousel {
// Make the centered image selectable, rest disabled.
// This way user can't open the "wrong" image and get confused of the results.
$( slick.$slider ).find( '.slick-slide button' ).removeAttr( 'disabled' );
$( slick.$slider ).find( '.slick-slide button' ).removeAttr( 'aria-hidden' );
$( slick.$slider ).find( '.slick-slide:not(.slick-current) button' ).attr( 'disabled', '' );
$( slick.$slider ).find( '.slick-slide:not(.slick-current) button' ).attr( 'aria-hidden', 'true' );

// Transalate Slick Slider stuff
this.translateCarousels( translations );
Expand Down
4 changes: 2 additions & 2 deletions assets/scripts/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default class Image {
type: 'image',
background_scroll: false,
after_open: this.disableBackgroundItemFocusing,
accessible_title: window.s.modaal.accessible_title || 'Dialog Window - Close (Press escape to close)',
close_aria_label: window.s.modaal.close || 'Close (Press escape to close)',
accessible_title: window.s.modaal.accessible_title || 'Enlarged image',
close_aria_label: window.s.modaal.close || 'Close',
} );
}

Expand Down
47 changes: 47 additions & 0 deletions assets/scripts/search-filters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (c) 2023. Hion Digital
*/

// Use jQuery as $ within this file scope.
const $ = jQuery; // eslint-disable-line no-unused-vars

/**
* Export the class reference.
*/
export default class SearchFilters {

/**
* Check or uncheck checkboxes depending on selections
*
* @param {Object} event Change event
*/
SearchFilters( event ) {
const $checkBoxContainer = $( '.search-filters' );
const $checkBoxes = $checkBoxContainer.find( 'input[type=checkbox]' );
const $clickedCheckbox = event.target;

if ( $( $clickedCheckbox ).is( ':checked' ) ) {
// Uncheck "All"-checkbox when others are checked
if ( $( $clickedCheckbox ).prop( 'id' ) !== 'cpt-all' ) {
$( '#cpt-all' ).prop( 'checked', false );
}
// Uncheck other checkboxes when "All" is selected
else {
$checkBoxes.each( function() {
if ( $( this ).prop( 'id' ) !== 'cpt-all' ) {
$( this ).prop( 'checked', false );
}
} );
}
}
}

/**
* Run when the document is ready.
*
* @return {void}
*/
docReady() {
$( '.search-filters input[type=checkbox]' ).on( 'change', this.SearchFilters.bind( this ) );
}
}
Loading

0 comments on commit 157e9f1

Please sign in to comment.