Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 40 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,51 @@
name: Release
name: Release CI
on:
push:
branches:
- main

permissions:
id-token: write # Required for OIDC
contents: write # For Semantic Release tagging

contents: read # for checkout
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install dependencies
run: npm ci
- name: Test
run: npm run test
- name: Build
run: npm run build
- name: Release
run: npx semantic-release@25
env:
GITHUB_TOKEN: ${{ secrets.OPENEDX_SEMANTIC_RELEASE_GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Nodejs Env
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: ${{ env.NODE_VER }}
- name: Install dependencies
run: npm ci
- name: Validate package-lock.json changes
run: make validate-no-uncommitted-package-lock-changes
- name: Lint
run: npm run lint
- name: Type check
run: npm run types
- name: Test
run: npm run test
- name: i18n_extract
run: npm run i18n_extract
- name: Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Build
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
run: npx semantic-release@25
6 changes: 3 additions & 3 deletions src/Notification/NotificationRowItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useNotification } from './data/hook';
import { notificationsContext } from './context/notificationsContext';

const NotificationRowItem = ({
id, type, contentUrl, content, courseName, createdAt, lastRead,
id, type = '', contentUrl, content, courseName, createdAt, lastRead = '',
}) => {
timeago.register('time-locale', timeLocale);
const intl = useIntl();
Expand Down Expand Up @@ -85,12 +85,12 @@ const NotificationRowItem = ({

NotificationRowItem.propTypes = {
id: PropTypes.number.isRequired,
type: PropTypes.string.isRequired,
type: PropTypes.string,
contentUrl: PropTypes.string.isRequired,
content: PropTypes.node.isRequired,
courseName: PropTypes.string.isRequired,
createdAt: PropTypes.string.isRequired,
lastRead: PropTypes.string.isRequired,
lastRead: PropTypes.string,
};

export default React.memo(NotificationRowItem);
3 changes: 2 additions & 1 deletion src/Notification/data/__factories__/notifications.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Factory.define('notificationsCount')
authoring: 5,
})
.attr('showNotificationsTray', true)
.attr('isNewNotificationViewEnabled', true);
.attr('isNewNotificationViewEnabled', true)
.attr('notification_expiry_days', 60);

Factory.define('notification')
.sequence('id')
Expand Down
3 changes: 2 additions & 1 deletion src/Notification/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const Notifications = ({ notificationAppData, margins }) => {
setNotificationData(prevData => ({
...prevData,
...notificationAppData,
notificationExpiryDays: notificationAppData.notificationExpiryDays ?? 0,
}));
}, [notificationAppData]);

Expand Down Expand Up @@ -220,7 +221,7 @@ Notifications.propTypes = {
).isRequired,
appsId: PropTypes.arrayOf(PropTypes.string).isRequired,
isNewNotificationViewEnabled: PropTypes.bool.isRequired,
notificationExpiryDays: PropTypes.number.isRequired,
notificationExpiryDays: PropTypes.number,
notificationStatus: PropTypes.string.isRequired,
showNotificationsTray: PropTypes.bool.isRequired,
tabsCount: PropTypes.shape({
Expand Down
Loading