Compare commits

...

4 Commits

Author SHA1 Message Date
Ihor Romaniuk
87dc89ec73 fix: block overflow when editing comment (#705) 2024-10-09 17:59:17 +05:00
Stanislav
b5c4cbd369 fix: Discussions UI fixes on mobile resolutions (#690) 2024-04-04 17:46:22 +05:00
Eugene Dyudyunov
efa0c1c9b7 fix: fixed redirection to learners tab in inContext view (#680)
* fix: redirection to learners tab in inContext view

* fix: changed username to simple text for incontext view

* test: username is not clickable in incontext view

---------

Co-authored-by: ayesha waris <73840786+ayesha-waris@users.noreply.github.com>
Co-authored-by: sohailfatima <23100065@lums.edu.pk>
Co-authored-by: Fatima Sohail <68312464+sohailfatima@users.noreply.github.com>
Co-authored-by: Awais Ansari <79941147+awais-ansari@users.noreply.github.com>
2024-03-21 15:55:32 +05:00
Stanislav
5ca0042802 fix: fixed post card border color issue (#640) (#677)
Co-authored-by: Awais Ansari <79941147+awais-ansari@users.noreply.github.com>
2024-03-08 14:50:00 +05:00
6 changed files with 39 additions and 17 deletions

View File

@@ -28,7 +28,7 @@ const AuthorLabel = ({
}) => {
timeago.register('time-locale', timeLocale);
const intl = useIntl();
const { courseId } = useContext(DiscussionContext);
const { courseId, enableInContextSidebar } = useContext(DiscussionContext);
let icon = null;
let authorLabelMessage = null;
@@ -47,7 +47,7 @@ const AuthorLabel = ({
const className = classNames('d-flex align-items-center', { 'mb-0.5': !postOrComment }, labelColor);
const showUserNameAsLink = useShowLearnersTab()
&& linkToProfile && author && author !== intl.formatMessage(messages.anonymous);
&& linkToProfile && author && author !== intl.formatMessage(messages.anonymous) && !enableInContextSidebar;
const authorName = useMemo(() => (
<span
@@ -114,7 +114,7 @@ const AuthorLabel = ({
return showUserNameAsLink
? (
<div className={className}>
<div className={`${className} flex-wrap`}>
<Link
data-testid="learner-posts-link"
id="learner-posts-link"
@@ -127,7 +127,7 @@ const AuthorLabel = ({
{labelContents}
</div>
)
: <div className={className}>{authorName}{labelContents}</div>;
: <div className={`${className} flex-wrap`}>{authorName}{labelContents}</div>;
};
AuthorLabel.propTypes = {

View File

@@ -21,11 +21,11 @@ let store;
let axiosMock;
let container;
function renderComponent(author, authorLabel, linkToProfile, labelColor) {
function renderComponent(author, authorLabel, linkToProfile, labelColor, enableInContextSidebar) {
const wrapper = render(
<IntlProvider locale="en">
<AppProvider store={store}>
<DiscussionContext.Provider value={{ courseId }}>
<DiscussionContext.Provider value={{ courseId, enableInContextSidebar }}>
<AuthorLabel
author={author}
authorLabel={authorLabel}
@@ -79,9 +79,9 @@ describe('Author label', () => {
);
it(
`it is "${!linkToProfile && 'not'}" clickable when linkToProfile is ${!!linkToProfile}`,
`it is "${(!linkToProfile) && 'not'}" clickable when linkToProfile is ${!!linkToProfile} and enableInContextSidebar is false`,
async () => {
renderComponent(author, authorLabel, linkToProfile, labelColor);
renderComponent(author, authorLabel, linkToProfile, labelColor, false);
if (linkToProfile) {
expect(screen.queryByTestId('learner-posts-link')).toBeInTheDocument();
@@ -91,6 +91,15 @@ describe('Author label', () => {
},
);
it(
'it is not clickable when enableInContextSidebar is true',
async () => {
renderComponent(author, authorLabel, linkToProfile, labelColor, true);
expect(screen.queryByTestId('learner-posts-link')).not.toBeInTheDocument();
},
);
it(
`it has "${!linkToProfile && 'not'}" label text and label color when linkToProfile is ${!!linkToProfile}`,
async () => {

View File

@@ -55,7 +55,7 @@ const DiscussionSidebar = ({ displaySidebar, postActionBarRef }) => {
'd-none': !displaySidebar,
'd-flex overflow-auto box-shadow-centered-1': displaySidebar,
'w-100': !isOnDesktop,
'sidebar-desktop-width': isOnDesktop && !isOnXLDesktop,
'w-25 sidebar-desktop-width': isOnDesktop && !isOnXLDesktop,
'w-25 sidebar-XL-width': isOnXLDesktop,
'min-content-height': !enableInContextSidebar,
})}

View File

@@ -129,9 +129,9 @@ const Reply = ({ responseId }) => {
</div>
<div
className="bg-light-300 pl-4 pt-2.5 pr-2.5 pb-10px flex-fill"
style={{ borderRadius: '0rem 0.375rem 0.375rem' }}
style={{ borderRadius: '0rem 0.375rem 0.375rem', maxWidth: 'calc(100% - 50px)' }}
>
<div className="d-flex flex-row justify-content-between" style={{ height: '24px' }}>
<div className="d-flex flex-row justify-content-between">
<AuthorLabel
author={author}
authorLabel={authorLabel}

View File

@@ -19,9 +19,9 @@ const PostTypeCard = ({
<label htmlFor={`post-type-${value}`} className="d-flex p-0 my-0 mr-3">
<Form.Radio value={value} id={`post-type-${value}`} className="sr-only">{type}</Form.Radio>
<Card
className={classNames('border-2 shadow-none', {
'border-primary': selected,
'border-light-400': !selected,
className={classNames('shadow-none', {
'border-primary-500-2': selected,
'border-light-400-2': !selected,
})}
style={{ cursor: 'pointer', width: `${enableInContextSidebar ? '10.021rem' : '14.25rem'}` }}
>

View File

@@ -241,6 +241,10 @@ header {
.sidebar-desktop-width {
min-width: 29rem !important;
@include media-breakpoint-down(lg) {
min-width: 25rem !important;
}
}
.sidebar-XL-width {
@@ -251,8 +255,13 @@ header {
background-color: #e9e6e4 !important;
}
.border-2 {
border: 2px solid #cccccc !important;
.border-light-400-2 {
border: 2px solid $light-400 !important;
border-width: 2px !important;
}
.border-primary-500-2 {
border: 2px solid $primary-500 !important;
border-width: 2px !important;
}
@@ -468,6 +477,10 @@ header {
display: flex;
}
}
.pgn__avatar {
flex-shrink: 0;
}
}
.spinner-dimentions {
@@ -544,7 +557,7 @@ header {
}
.author-name {
line-height: 1;
line-height: 1.5;
word-break: break-all;
}