Compare commits

...

3 Commits

Author SHA1 Message Date
SundasNoreen
4e80ca73a0 fix: fixed height issue 2023-07-18 13:27:13 +05:00
Awais Ansari
27228f093d Merge pull request #370 from openedx/Ayesha/INF-951
fix: clicking on notification redirecting to correct URL
2023-07-14 13:04:49 +05:00
ayeshoali
e153aefc13 fix: clicking on notification redirecting to correct URL 2023-07-13 15:48:35 +05:00
3 changed files with 12 additions and 6 deletions

View File

@@ -3,7 +3,6 @@ import { useDispatch } from 'react-redux';
import { useIntl } from '@edx/frontend-platform/i18n'; import { useIntl } from '@edx/frontend-platform/i18n';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Icon } from '@edx/paragon'; import { Icon } from '@edx/paragon';
import { Link } from 'react-router-dom';
import * as timeago from 'timeago.js'; import * as timeago from 'timeago.js';
import { getIconByType } from './utils'; import { getIconByType } from './utils';
import { markNotificationsAsRead } from './data/thunks'; import { markNotificationsAsRead } from './data/thunks';
@@ -24,12 +23,13 @@ const NotificationRowItem = ({
const { icon: iconComponent, class: iconClass } = getIconByType(type); const { icon: iconComponent, class: iconClass } = getIconByType(type);
return ( return (
<Link <a
target="_blank" target="_blank"
className="d-flex mb-2 align-items-center text-decoration-none" className="d-flex mb-2 align-items-center text-decoration-none"
to={contentUrl} href={contentUrl}
onClick={handleMarkAsRead} onClick={handleMarkAsRead}
data-testid={`notification-${id}`} data-testid={`notification-${id}`}
rel="noopener noreferrer"
> >
<Icon <Icon
src={iconComponent} src={iconComponent}
@@ -62,7 +62,7 @@ const NotificationRowItem = ({
)} )}
</div> </div>
</div> </div>
</Link> </a>
); );
}; };

View File

@@ -44,6 +44,13 @@ const Notifications = () => {
}; };
}, []); }, []);
const viewPortHeight = window.innerHeight;
const headerHeight = document.getElementsByClassName('learning-header');
let notificationBarHeight = 0;
if (headerHeight.length > 0) {
notificationBarHeight = viewPortHeight - headerHeight[0].clientHeight;
}
return ( return (
<OverlayTrigger <OverlayTrigger
trigger="click" trigger="click"
@@ -54,6 +61,7 @@ const Notifications = () => {
overlay={( overlay={(
<Popover <Popover
id="notificationTray" id="notificationTray"
style={{ height: `${notificationBarHeight}px` }}
data-testid="notification-tray" data-testid="notification-tray"
className={classNames('overflow-auto rounded-0 border-0', { className={classNames('overflow-auto rounded-0 border-0', {
'w-100': !isOnMediumScreen && !isOnLargeScreen, 'w-100': !isOnMediumScreen && !isOnLargeScreen,

View File

@@ -190,8 +190,6 @@ $white: #fff;
} }
.popover { .popover {
max-height: calc(100% - 68px);
min-height: 1220px;
filter: none; filter: none;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15), 0px 2px 8px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15), 0px 2px 8px rgba(0, 0, 0, 0.15);