Skip to content

Commit

Permalink
fix: remove cookie policy banner from authn (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
attiyaIshaque authored May 4, 2023
1 parent 86f875e commit 54319c6
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 487 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ LOGIN_ISSUE_SUPPORT_LINK=''
AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK=null
# ***** Features flags *****
DISABLE_ENTERPRISE_LOGIN=''
ENABLE_COOKIE_POLICY_BANNER=''
ENABLE_DYNAMIC_REGISTRATION_FIELDS=''
ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN=''
ENABLE_PERSONALIZED_RECOMMENDATIONS=''
Expand Down
1 change: 0 additions & 1 deletion .env.private.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copy these to the .env.private to enable edX specific functionality on local system
ENABLE_COOKIE_POLICY_BANNER='true'
ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN='true'
MARKETING_EMAILS_OPT_IN='true'
SHOW_CONFIGURABLE_EDX_FIELDS='true'
3 changes: 0 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ The authentication micro-frontend also requires the following additional variabl
- Name of MFE, this will be used by the API to get runtime configurations for the specific micro frontend. For a frontend repo `frontend-app-appName`, use `appName` as APP_ID.
- ``authn`` | ``''``

* - ``ENABLE_COOKIE_POLICY_BANNER``
- Enables support for displaying the cookies acceptance banner.
- ``true`` | ``''`` (empty strings are falsy)

edX-specific Environment Variables
**********************************
Expand Down
515 changes: 64 additions & 451 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
},
"dependencies": {
"@edx/brand": "npm:@edx/brand-openedx@1.2.0",
"@edx/frontend-component-cookie-policy-banner": "2.2.2",
"@edx/frontend-platform": "4.2.0",
"@edx/paragon": "20.33.0",
"@fortawesome/fontawesome-svg-core": "6.4.0",
Expand Down
4 changes: 0 additions & 4 deletions src/base-component/BaseComponent.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React from 'react';

import CookiePolicyBanner from '@edx/frontend-component-cookie-policy-banner';
import { getConfig } from '@edx/frontend-platform';
import { getAuthenticatedUser } from '@edx/frontend-platform/auth';
import { getLocale } from '@edx/frontend-platform/i18n';
import { breakpoints } from '@edx/paragon';
import classNames from 'classnames';
import PropTypes from 'prop-types';
Expand All @@ -22,7 +19,6 @@ const BaseComponent = ({ children, showWelcomeBanner }) => {

return (
<>
{getConfig().ENABLE_COOKIE_POLICY_BANNER ? <CookiePolicyBanner languageCode={getLocale()} /> : null}
<div className="col-md-12 extra-large-screen-top-stripe" />
<div className="layout">
<MediaQuery maxWidth={breakpoints.small.maxWidth - 1}>
Expand Down
1 change: 0 additions & 1 deletion src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const configuration = {
USER_SURVEY_COOKIE_NAME: process.env.USER_SURVEY_COOKIE_NAME || null,
// Features
DISABLE_ENTERPRISE_LOGIN: process.env.DISABLE_ENTERPRISE_LOGIN || '',
ENABLE_COOKIE_POLICY_BANNER: process.env.ENABLE_COOKIE_POLICY_BANNER || false,
ENABLE_DYNAMIC_REGISTRATION_FIELDS: process.env.ENABLE_DYNAMIC_REGISTRATION_FIELDS || false,
ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN: process.env.ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN || false,
ENABLE_PERSONALIZED_RECOMMENDATIONS: process.env.ENABLE_PERSONALIZED_RECOMMENDATIONS || false,
Expand Down
6 changes: 0 additions & 6 deletions src/forgot-password/tests/ForgotPasswordPage.test.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { Provider } from 'react-redux';

import CookiePolicyBanner from '@edx/frontend-component-cookie-policy-banner';
import { mergeConfig } from '@edx/frontend-platform';
import { configure, injectIntl, IntlProvider } from '@edx/frontend-platform/i18n';
import { mount } from 'enzyme';
Expand Down Expand Up @@ -195,11 +194,6 @@ describe('ForgotPasswordPage', () => {
expect(forgotPasswordPage.find('#email-invalid-feedback').exists()).toEqual(false);
});

it('check cookie rendered', () => {
const forgotPage = mount(reduxWrapper(<IntlForgotPasswordPage {...props} />));
expect(forgotPage.find(<CookiePolicyBanner />)).toBeTruthy();
});

it('should display success message after email is sent', () => {
store = mockStore({
...initialState,
Expand Down
1 change: 0 additions & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
@import "~@edx/paragon/scss/core/core";
@import "~@edx/brand/paragon/overrides";

@import "@edx/frontend-component-cookie-policy-banner/build/_cookie-policy-banner";
@import "sass/style";
6 changes: 0 additions & 6 deletions src/login/tests/LoginPage.test.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { Provider } from 'react-redux';

import CookiePolicyBanner from '@edx/frontend-component-cookie-policy-banner';
import { getConfig, mergeConfig } from '@edx/frontend-platform';
import { sendPageEvent } from '@edx/frontend-platform/analytics';
import { injectIntl, IntlProvider } from '@edx/frontend-platform/i18n';
Expand Down Expand Up @@ -675,11 +674,6 @@ describe('LoginPage', () => {

// ******** miscellaneous tests ********

it('should render cookie banner', () => {
const loginPage = mount(reduxWrapper(<IntlLoginPage {...props} />));
expect(loginPage.find(<CookiePolicyBanner />)).toBeTruthy();
});

it('should send page event when login page is rendered', () => {
mount(reduxWrapper(<IntlLoginPage {...props} />));
expect(sendPageEvent).toHaveBeenCalledWith('login_and_registration', 'login');
Expand Down
6 changes: 0 additions & 6 deletions src/register/tests/RegistrationPage.test.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { Provider } from 'react-redux';

import CookiePolicyBanner from '@edx/frontend-component-cookie-policy-banner';
import { getConfig, mergeConfig } from '@edx/frontend-platform';
import { sendPageEvent } from '@edx/frontend-platform/analytics';
import {
Expand Down Expand Up @@ -947,11 +946,6 @@ describe('RegistrationPage', () => {
expect(store.dispatch).toHaveBeenCalledWith(backupRegistrationFormBegin({ ...registrationFormData }));
});

it('should render cookie banner', () => {
const registrationPage = mount(reduxWrapper(<IntlRegistrationPage {...props} />));
expect(registrationPage.find(<CookiePolicyBanner />)).toBeTruthy();
});

it('should send page event when register page is rendered', () => {
mount(reduxWrapper(<IntlRegistrationPage {...props} />));
expect(sendPageEvent).toHaveBeenCalledWith('login_and_registration', 'register');
Expand Down
6 changes: 0 additions & 6 deletions src/reset-password/tests/ResetPasswordPage.test.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { Provider } from 'react-redux';

import CookiePolicyBanner from '@edx/frontend-component-cookie-policy-banner';
import { configure, injectIntl, IntlProvider } from '@edx/frontend-platform/i18n';
import { mount } from 'enzyme';
import { createMemoryHistory } from 'history';
Expand Down Expand Up @@ -218,11 +217,6 @@ describe('ResetPasswordPage', () => {
expect(history.location.pathname).toEqual('/login');
});

it('check cookie rendered', () => {
const resetPasswordPage = mount(reduxWrapper(<IntlResetPasswordPage {...props} />));
expect(resetPasswordPage.find(<CookiePolicyBanner />)).toBeTruthy();
});

it('show spinner during token validation', () => {
const resetPasswordPage = mount(reduxWrapper(<IntlResetPasswordPage {...props} />));
expect(resetPasswordPage.find('div.spinner-header')).toBeTruthy();
Expand Down

0 comments on commit 54319c6

Please sign in to comment.