Skip to content

Commit

Permalink
[CST-15593] fix orejime cookie name, a11y issues and package-lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Barbasso committed Oct 31, 2024
1 parent 9eaaab5 commit 0ab4d90
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ before(() => {

// Runs once before the first test in each "block"
beforeEach(() => {
// Pre-agree to all Orejime cookies by setting the orejime-anonymous cookie
// Pre-agree to all Orejime cookies by setting the orejime cookie
// This just ensures it doesn't get in the way of matching other objects in the page.
cy.setCookie('orejime-anonymous', '{%22authentication%22:true%2C%22preferences%22:true%2C%22acknowledgement%22:true%2C%22google-analytics%22:true%2C%22google-recaptcha%22:true}');
cy.setCookie('orejime', '{%22authentication%22:true%2C%22preferences%22:true%2C%22acknowledgement%22:true%2C%22google-analytics%22:true%2C%22google-recaptcha%22:true}');

// Remove any CSRF cookies saved from prior tests
cy.clearCookie(DSPACE_XSRF_COOKIE);
Expand Down
19 changes: 18 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/core/google-recaptcha/google-recaptcha.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class GoogleRecaptchaService {
tap(([recaptchaVersionRD, recaptchaModeRD, recaptchaKeyRD]) => {

if (
this.cookieService.get('orejime-anonymous') && this.cookieService.get('orejime-anonymous')[CAPTCHA_NAME] &&
this.cookieService.get('orejime') && this.cookieService.get('orejime')[CAPTCHA_NAME] &&
recaptchaKeyRD.hasSucceeded && recaptchaVersionRD.hasSucceeded &&
isNotEmpty(recaptchaVersionRD.payload?.values) && isNotEmpty(recaptchaKeyRD.payload?.values)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export class RegisterEmailFormComponent implements OnDestroy, OnInit {
* Return true if the user has accepted the required cookies for reCaptcha
*/
isRecaptchaCookieAccepted(): boolean {
const orejimeAnonymousCookie = this.cookieService.get('orejime-anonymous');
const orejimeAnonymousCookie = this.cookieService.get('orejime');
return isNotEmpty(orejimeAnonymousCookie) ? orejimeAnonymousCookie[CAPTCHA_NAME] : false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/cookies/orejime-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NativeWindowRef } from '../../core/services/window.service';
*/
export const HAS_AGREED_END_USER = 'dsHasAgreedEndUser';

export const ANONYMOUS_STORAGE_NAME_OREJIME = 'orejime-anonymous';
export const ANONYMOUS_STORAGE_NAME_OREJIME = 'orejime';

export const GOOGLE_ANALYTICS_OREJIME_KEY = 'google-analytics';

Expand Down
2 changes: 1 addition & 1 deletion src/styles/_custom_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@
--ds-process-overview-table-info-column-width: 250px;
--ds-process-overview-table-actions-column-width: 80px;

--green1: #1FB300; // This variable represents the success color for the Orejime cookie banner
--green1: #1c710a; // This variable represents the success color for the Orejime cookie banner
--button-text-color-cookie: #fff; // This variable represents the text color for buttons in the Orejime cookie banner
}
2 changes: 1 addition & 1 deletion src/styles/_global-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ body {
}

a {
color: var(--green1);
color: var(--bs-white);
}
}

Expand Down

0 comments on commit 0ab4d90

Please sign in to comment.