-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from openedx/aansari/INF-1375
feat: added info banner for ORA notifications
- Loading branch information
Showing
9 changed files
with
92 additions
and
0 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
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
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
11 changes: 11 additions & 0 deletions
11
src/containers/NotificationsBanner/NotificationsBanner.test.jsx
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
import { shallow } from '@edx/react-unit-test-utils'; | ||
|
||
import { NotificationsBanner } from '.'; | ||
|
||
describe('NotificationsBanner component', () => { | ||
test('snapshots', () => { | ||
const el = shallow(<NotificationsBanner hide />); | ||
expect(el.snapshot).toMatchSnapshot(); | ||
}); | ||
}); |
29 changes: 29 additions & 0 deletions
29
src/containers/NotificationsBanner/__snapshots__/NotificationsBanner.test.jsx.snap
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`NotificationsBanner component snapshots 1`] = ` | ||
<PageBanner | ||
variant="accentB" | ||
> | ||
<span> | ||
<FormattedMessage | ||
defaultMessage="You can now enable notifications for ORA assignments that require staff grading, from the " | ||
description="user info message that user can enable notifications for ORA assignments" | ||
id="ora-grading.NotificationsBanner.Message" | ||
/> | ||
<Hyperlink | ||
destination="http://localhost:1997/notifications" | ||
isInline={true} | ||
rel="noopener noreferrer" | ||
showLaunchIcon={false} | ||
target="_blank" | ||
variant="muted" | ||
> | ||
<FormattedMessage | ||
defaultMessage="preferences center." | ||
description="placeholder for the preferences center link" | ||
id="ora-grading.NotificationsBanner.linkMessage" | ||
/> | ||
</Hyperlink> | ||
</span> | ||
</PageBanner> | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
|
||
import { getConfig } from '@edx/frontend-platform'; | ||
import { FormattedMessage } from '@edx/frontend-platform/i18n'; | ||
import { PageBanner, Hyperlink } from '@openedx/paragon'; | ||
|
||
import messages from './messages'; | ||
|
||
export const NotificationsBanner = () => ( | ||
<PageBanner variant="accentB"> | ||
<span> | ||
<FormattedMessage {...messages.infoMessage} /> | ||
<Hyperlink | ||
isInline | ||
variant="muted" | ||
destination={`${getConfig().ACCOUNT_SETTINGS_URL}/notifications`} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
showLaunchIcon={false} | ||
> | ||
<FormattedMessage {...messages.notificationsBannerLinkMessage} /> | ||
</Hyperlink> | ||
</span> | ||
</PageBanner> | ||
); | ||
|
||
export default NotificationsBanner; |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* eslint-disable quotes */ | ||
import { defineMessages } from '@edx/frontend-platform/i18n'; | ||
import { StrictDict } from 'utils'; | ||
|
||
const messages = defineMessages({ | ||
infoMessage: { | ||
id: 'ora-grading.NotificationsBanner.Message', | ||
defaultMessage: 'You can now enable notifications for ORA assignments that require staff grading, from the ', | ||
description: 'user info message that user can enable notifications for ORA assignments', | ||
}, | ||
notificationsBannerLinkMessage: { | ||
id: 'ora-grading.NotificationsBanner.linkMessage', | ||
defaultMessage: 'preferences center.', | ||
description: 'placeholder for the preferences center link', | ||
}, | ||
}); | ||
|
||
export default StrictDict(messages); |