Skip to content

Commit

Permalink
feat: add accessibility url
Browse files Browse the repository at this point in the history
  • Loading branch information
asadali145 committed Jan 26, 2024
1 parent cb9eb69 commit 61384a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ TERMS_OF_SERVICE_URL=null
PRIVACY_POLICY_URL=null
SUPPORT_EMAIL=null
STUDIO_BASE_URL=http://localhost:18010
SHOW_ACCESSIBILITY_PAGE=false
ORDER_HISTORY_URL=localhost:1996/orders
REFRESH_ACCESS_TOKEN_ENDPOINT=http://localhost:18000/login_refresh
SEGMENT_KEY=null
Expand All @@ -22,6 +21,7 @@ LOGO_URL=https://edx-cdn.org/v3/default/logo.svg
LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
ACCESSIBILITY_URL=
ABOUT_US_URL=
HONOR_CODE_URL=
CONTACT_URL=
Expand Down
9 changes: 3 additions & 6 deletions src/components/studio-footer/StudioFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ensureConfig([
'SUPPORT_EMAIL',
'SITE_NAME',
'STUDIO_BASE_URL',
'SHOW_ACCESSIBILITY_PAGE',
'ACCESSIBILITY_URL',
], 'Studio Footer component');

const StudioFooter = ({
Expand Down Expand Up @@ -105,11 +105,8 @@ const StudioFooter = ({
{intl.formatMessage(messages.privacyPolicyLinkLabel)}
</Hyperlink>
)}
{config.SHOW_ACCESSIBILITY_PAGE === 'true' && (
<Hyperlink
destination={`${config.STUDIO_BASE_URL}/accessibility`}
data-testid="accessibilityRequest"
>
{!_.isEmpty(config.ACCESSIBILITY_URL) && (
<Hyperlink destination={config.ACCESSIBILITY_URL} data-testid="accessibilityRequest">
{intl.formatMessage(messages.accessibilityRequestLinkLabel)}
</Hyperlink>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/studio-footer/StudioFooter.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config = {
SUPPORT_EMAIL: null,
SITE_NAME: process.env.SITE_NAME,
STUDIO_BASE_URL: process.env.STUDIO_BASE_URL,
SHOW_ACCESSIBILITY_PAGE: process.env.SHOW_ACCESSIBILITY_PAGE,
ACCESSIBILITY_URL: null,
};

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

0 comments on commit 61384a0

Please sign in to comment.