Skip to content

Commit 61384a0

Browse files
committed
feat: add accessibility url
1 parent cb9eb69 commit 61384a0

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ TERMS_OF_SERVICE_URL=null
1212
PRIVACY_POLICY_URL=null
1313
SUPPORT_EMAIL=null
1414
STUDIO_BASE_URL=http://localhost:18010
15-
SHOW_ACCESSIBILITY_PAGE=false
1615
ORDER_HISTORY_URL=localhost:1996/orders
1716
REFRESH_ACCESS_TOKEN_ENDPOINT=http://localhost:18000/login_refresh
1817
SEGMENT_KEY=null
@@ -22,6 +21,7 @@ LOGO_URL=https://edx-cdn.org/v3/default/logo.svg
2221
LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
2322
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
2423
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
24+
ACCESSIBILITY_URL=
2525
ABOUT_US_URL=
2626
HONOR_CODE_URL=
2727
CONTACT_URL=

src/components/studio-footer/StudioFooter.jsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ensureConfig([
2222
'SUPPORT_EMAIL',
2323
'SITE_NAME',
2424
'STUDIO_BASE_URL',
25-
'SHOW_ACCESSIBILITY_PAGE',
25+
'ACCESSIBILITY_URL',
2626
], 'Studio Footer component');
2727

2828
const StudioFooter = ({
@@ -105,11 +105,8 @@ const StudioFooter = ({
105105
{intl.formatMessage(messages.privacyPolicyLinkLabel)}
106106
</Hyperlink>
107107
)}
108-
{config.SHOW_ACCESSIBILITY_PAGE === 'true' && (
109-
<Hyperlink
110-
destination={`${config.STUDIO_BASE_URL}/accessibility`}
111-
data-testid="accessibilityRequest"
112-
>
108+
{!_.isEmpty(config.ACCESSIBILITY_URL) && (
109+
<Hyperlink destination={config.ACCESSIBILITY_URL} data-testid="accessibilityRequest">
113110
{intl.formatMessage(messages.accessibilityRequestLinkLabel)}
114111
</Hyperlink>
115112
)}

src/components/studio-footer/StudioFooter.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const config = {
1515
SUPPORT_EMAIL: null,
1616
SITE_NAME: process.env.SITE_NAME,
1717
STUDIO_BASE_URL: process.env.STUDIO_BASE_URL,
18-
SHOW_ACCESSIBILITY_PAGE: process.env.SHOW_ACCESSIBILITY_PAGE,
18+
ACCESSIBILITY_URL: null,
1919
};
2020

2121
let currentConfig = config;
@@ -111,7 +111,7 @@ describe('Footer', () => {
111111
expect(screen.queryByTestId('accessibilityRequest')).toBeNull();
112112
});
113113
it('should show accessibilty request link', () => {
114-
render(<Component updateVariable={['SHOW_ACCESSIBILITY_PAGE', 'true']} />);
114+
render(<Component updateVariable={['ACCESSIBILITY_URL', process.env.ACCESSIBILITY_URL]} />);
115115
expect(screen.getByText('LMS')).toBeVisible();
116116
expect(screen.queryByTestId('termsOfService')).toBeNull();
117117
expect(screen.queryByTestId('privacyPolicy')).toBeNull();

0 commit comments

Comments
 (0)