Compare commits

...

4 Commits

Author SHA1 Message Date
sundasnoreen12
e8e1d10bd6 refactor: fixed comment sort dropdown issue 2023-04-20 16:40:29 +05:00
sundasnoreen12
b0be519e13 fix: action dropdown UI issues 2023-04-20 16:40:16 +05:00
sundasnoreen12
f1a9922d29 fix: added role for editedby and closedby user (#498)
* fix: changed the title of new edx provider

* fix: added role for editedby and closedby user

* refactor: added left margin for endorsed time

* refactor: added AlertBar component to avoid duplicate code

---------

Co-authored-by: sundasnoreen12 <sundasnoreen12@ggmail.com>
2023-04-19 15:58:10 +05:00
sundasnoreen12
009417bb57 fix: fixed feedback widget position issue (#499)
Co-authored-by: sundasnoreen12 <sundasnoreen12@ggmail.com>
2023-04-17 13:04:21 +05:00
3 changed files with 92 additions and 35 deletions

View File

@@ -8,13 +8,14 @@ import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { Alert } from '@edx/paragon';
import { Report } from '@edx/paragon/icons';
import { AvatarOutlineAndLabelColors } from '../../data/constants';
import {
selectModerationSettings, selectUserHasModerationPrivileges, selectUserIsGroupTa, selectUserIsStaff,
} from '../data/selectors';
import { commentShape } from '../post-comments/comments/comment/proptypes';
import messages from '../post-comments/messages';
import { postShape } from '../posts/post/proptypes';
import AuthorLabel from './AuthorLabel';
import AlertBar from './AlertBar';
function AlertBanner({
intl,
@@ -29,6 +30,8 @@ function AlertBanner({
const canSeeLastEditOrClosedAlert = (userHasModerationPrivileges || userIsGroupTa
|| userIsGlobalStaff || userIsContentAuthor
);
const editByLabelColor = AvatarOutlineAndLabelColors[content.editByLabel];
const closedByLabelColor = AvatarOutlineAndLabelColors[content.closedByLabel];
return (
<>
@@ -40,40 +43,22 @@ function AlertBanner({
{reasonCodesEnabled && canSeeLastEditOrClosedAlert && (
<>
{content.lastEdit?.reason && (
<Alert variant="info" className="px-3 shadow-none mb-1 py-10px bg-light-200">
<div className="d-flex align-items-center flex-wrap text-gray-700 font-style">
{intl.formatMessage(messages.editedBy)}
<span className="ml-1 mr-3">
<AuthorLabel author={content.lastEdit.editorUsername} linkToProfile postOrComment />
</span>
<span
className="mx-1.5 font-size-8 font-style text-light-700"
style={{ lineHeight: '15px' }}
>
{intl.formatMessage(messages.fullStop)}
</span>
{intl.formatMessage(messages.reason)}:&nbsp;{content.lastEdit.reason}
</div>
</Alert>
<AlertBar
message={messages.editedBy}
author={content.lastEdit.editorUsername}
authorLabel={content.editByLabel}
labelColor={editByLabelColor && `text-${editByLabelColor}`}
reason={content.lastEdit.reason}
/>
)}
{content.closed && (
<Alert variant="info" className="px-3 shadow-none mb-1 py-10px bg-light-200">
<div className="d-flex align-items-center flex-wrap text-gray-700 font-style">
{intl.formatMessage(messages.closedBy)}
<span className="ml-1 ">
<AuthorLabel author={content.closedBy} linkToProfile postOrComment />
</span>
<span
className="mx-1.5 font-size-8 font-style text-light-700"
style={{ lineHeight: '15px' }}
>
{intl.formatMessage(messages.fullStop)}
</span>
{content.closeReason && (`${intl.formatMessage(messages.reason)}: ${content.closeReason}`)}
</div>
</Alert>
<AlertBar
message={messages.closedBy}
author={content.closedBy}
authorLabel={content.closedByLabel}
labelColor={closedByLabelColor && `text-${closedByLabelColor}`}
reason={content.closeReason}
/>
)}
</>
)}

View File

@@ -0,0 +1,60 @@
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { Alert } from '@edx/paragon';
import messages from '../post-comments/messages';
import AuthorLabel from './AuthorLabel';
function AlertBar({
intl,
message,
author,
authorLabel,
labelColor,
reason,
}) {
return (
<Alert variant="info" className="px-3 shadow-none mb-1 py-10px bg-light-200">
<div className="d-flex align-items-center flex-wrap text-gray-700 font-style">
{intl.formatMessage(message)}
<span className="ml-1">
<AuthorLabel
author={author}
authorLabel={authorLabel}
labelColor={labelColor}
linkToProfile
postOrComment
/>
</span>
<span
className="mr-1.5 font-size-8 font-style text-light-700"
style={{ lineHeight: '15px' }}
>
{intl.formatMessage(messages.fullStop)}
</span>
{reason && (`${intl.formatMessage(messages.reason)}: ${reason}`)}
</div>
</Alert>
);
}
AlertBar.propTypes = {
intl: intlShape.isRequired,
message: PropTypes.string,
author: PropTypes.string,
authorLabel: PropTypes.string,
labelColor: PropTypes.string,
reason: PropTypes.string,
};
AlertBar.defaultProps = {
message: '',
author: '',
authorLabel: '',
labelColor: '',
reason: '',
};
export default injectIntl(AlertBar);

View File

@@ -315,6 +315,8 @@ header {
#courseTabsNavigation {
font-size: 18px;
font-family: Inter, Helvetica Neue, Arial, sans-serif;
z-index: 3;
background-color: #fff;
.container-xl {
padding-left: 31px;
@@ -336,7 +338,7 @@ header {
.header-action-bar {
background-color: #fff;
z-index: 2;
z-index: 3;
box-shadow: 0px 2px 4px rgb(0 0 0 / 15%), 0px 2px 8px rgb(0 0 0 / 15%);
position: sticky;
top: 0;
@@ -414,7 +416,7 @@ header {
max-width: fit-content;
margin-left: auto;
margin-top: -2.063rem;
z-index: 1;
z-index: 2;
right: 32px;
}
@@ -518,3 +520,13 @@ header {
font-size: 18px;
line-height: 28px;
}
.usabilla_live_button_container{
right: 0px !important;
}
.learning-header{
z-index: 4;
position: relative;
background-color: #fff;
}