-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* CDPT-1939: Splash page - Redirect users to a simplified version of the agency switcher when they don't have a cookie set. - Allow users access to the accessibility and privacy policy pages before setting a cookie, but use the simplified header * CDPT-1939: Splash page - Redirect users to a simplified version of the agency switcher when they don't have a cookie set. - Allow users access to the accessibility and privacy policy pages before setting a cookie, but use the simplified header * CDPT-1939: Splash page - Redirect users to a simplified version of the agency switcher when they don't have a cookie set. - Allow users access to the accessibility and privacy policy pages before setting a cookie, but use the simplified header * CDPT-1939: Splash page - Refine agency-switcher function and separate internal and external agencies - Add param to redirect users once they've selected an agency - Update the agency list to reflect hardcoded agency-switcher values - Wrap agency switcher list in <nav> * CDPT-1939: Splash page - Add ima to agency switcher * CDPT-1939: Splash page - Validate send_back url - Move comments to docblock * CDPT-1939: Splash page - Remove HTTP_REFERER as it doesn't appear to do anything * CDPT-1939: Splash page - Reverse if condition
- Loading branch information
1 parent
b04afa5
commit d0c8941
Showing
8 changed files
with
196 additions
and
101 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,15 +1,30 @@ | ||
<?php | ||
|
||
use MOJ\Intranet\Agency; | ||
|
||
/* | ||
* Agency switcher | ||
*/ | ||
get_header(); | ||
?> | ||
|
||
<main id="maincontent" class="u-wrapper l-main t-agency-switcher" role="main"> | ||
<h1 class="o-title o-title--page">Choose your agency or body</h1> | ||
<p>Other agencies and bodies have their own specific intranet content available to view by visiting the links below. HMPPS and YJB links are external intranet websites not managed by this central MoJ intranet.</p> | ||
<?php get_template_part('src/components/c-intranet-switcher/view'); ?> | ||
</main> | ||
$oAgency = new Agency(); | ||
$simpleHeader = !$oAgency->hasAgencyCookie(); | ||
|
||
$heading = 'Choose the version of the intranet you want to see'; | ||
$body = null; | ||
// If we're using the simple header, assume a new user and change the intro text to reflect this | ||
if ($simpleHeader) { | ||
$heading = 'Welcome to the Ministry of Justice intranet'; | ||
$body = '<p>Choose the version you want to see.</p><p>You can change this at any time using the "Switch to other | ||
intranet" link at the top of any page.</p>'; | ||
} | ||
?> | ||
<main id="maincontent" class="u-wrapper l-main t-agency-switcher" role="main"> | ||
<h1 class="o-title o-title--page"> | ||
<?= $heading ?> | ||
</h1> | ||
<?= $body ? "<p>$body</p>" : '' ?> | ||
<?php get_template_part('src/components/c-intranet-switcher/view'); ?> | ||
</main> | ||
<?php | ||
get_footer(); |
This file contains 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 |
---|---|---|
|
@@ -36,6 +36,7 @@ public function getList() | |
* - label (string) - Text label for the link | ||
* - classes (string) (optional) - Classes for the HTML element | ||
* - is_external (boolean) - Is this a link to an external site? | ||
* - main (boolean) - Should this link be used for the agency switcher? | ||
* - has_archive (boolean) (optional) - is the intranet archive available for this agency? | ||
*/ | ||
|
||
|
@@ -72,8 +73,9 @@ public function getList() | |
'is_integrated' => false, | ||
'links' => [ | ||
[ | ||
'url' => 'https://intranet.noms.gsi.gov.uk/', | ||
'url' => 'https://justiceuk.sharepoint.com/sites/HMPPSIntranet', | ||
'label' => 'HM Prison & Probation Service intranet', | ||
'main' => true, | ||
'is_external' => true | ||
] | ||
] | ||
|
@@ -90,14 +92,8 @@ public function getList() | |
'shortcode' => 'law-commission', | ||
'label' => 'Law Commission', | ||
'abbreviation' => 'LawCom', | ||
'is_integrated' => false, | ||
'links' => [ | ||
[ | ||
'url' => 'http://lawcommission.intranet.service.justice.gov.uk/', | ||
'label' => 'Law Commission intranet', | ||
'is_external' => true | ||
] | ||
] | ||
'is_integrated' => true, | ||
'links' => [] | ||
], | ||
'laa' => [ | ||
'shortcode' => 'laa', | ||
|
@@ -155,6 +151,36 @@ public function getList() | |
'is_integrated' => true, | ||
'contact_email_address' => '[email protected]', | ||
'links' => [] | ||
], | ||
'ima' => [ | ||
'shortcode' => 'ima', | ||
'label' => 'Independent Monitoring Authority', | ||
'abbreviation' => 'IMA', | ||
'is_integrated' => false, | ||
'contact_email_address' => '', | ||
'links' => [ | ||
[ | ||
'url' => 'https://myima.ima-citizensrights.org.uk', | ||
'label' => 'Independent Monitoring Authority intranet', | ||
'main' => true, | ||
'is_external' => true | ||
] | ||
] | ||
], | ||
'yjbrh' => [ | ||
'shortcode' => 'yjbrh', | ||
'label' => 'Youth Justice Board Resource Hub', | ||
'abbreviation' => 'YJBRH', | ||
'is_integrated' => false, | ||
'contact_email_address' => '', | ||
'links' => [ | ||
[ | ||
'url' => 'https://yjresourcehub.uk/', | ||
'label' => 'Youth Justice Board Resource Hub intranet', | ||
'main' => true, | ||
'is_external' => true | ||
] | ||
] | ||
] | ||
]; | ||
|
||
|
@@ -169,6 +195,14 @@ public function getList() | |
return $agencies_array; | ||
} | ||
|
||
/* | ||
* Check if the agency cookie is set | ||
*/ | ||
public function hasAgencyCookie(): bool | ||
{ | ||
return !empty($_COOKIE['dw_agency']); | ||
} | ||
|
||
/*** | ||
* Get the agency from cookie, and make sure it's in | ||
* the list, otherwise default to HQ | ||
|
This file contains 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 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
22 changes: 18 additions & 4 deletions
22
public/app/themes/clarity/src/components/c-header-container/view.php
This file contains 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 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.