Skip to content

Commit

Permalink
Merge branch 'master' into abdullahwaheed/react-intl-to-formatjs
Browse files Browse the repository at this point in the history
  • Loading branch information
abdullahwaheed authored Oct 24, 2023
2 parents 64fc4d3 + 5db3a18 commit 1aeb8fb
Show file tree
Hide file tree
Showing 27 changed files with 93 additions and 93 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export TRANSIFEX_RESOURCE = frontend-app-discussions
transifex_resource = frontend-app-discussions
transifex_langs = "ar,fr,es_419,zh_CN,tr_TR,pl,fr_CA,fr_FR,de_DE,it_IT,pt_PT,uk,ru,hi,cs,es_AR,es_ES,fa_IR"
transifex_langs = "ar,cs,de_DE,es_419,es_AR,es_ES,fa_IR,fr,fr_CA,fr_FR,hi,it_IT,pl,pt_PT,tr_TR,uk,ru,zh_CN"

intl_imports = ./node_modules/.bin/intl-imports.js
transifex_utils = ./node_modules/.bin/transifex-utils.js
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"url": "https://github.com/openedx/frontend-app-discussions/issues"
},
"dependencies": {
"@edx/brand": "npm:@edx/brand-openedx@1.1.0",
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/frontend-component-footer": "12.1.0",
"@edx/frontend-component-header": "4.3.0",
"@edx/frontend-platform": "4.6.0",
"@edx/frontend-platform": "4.6.3",
"@edx/paragon": "20.44.0",
"@reduxjs/toolkit": "1.8.0",
"@tinymce/tinymce-react": "3.13.1",
Expand All @@ -56,7 +56,7 @@
"redux": "4.1.2",
"regenerator-runtime": "0.13.9",
"timeago.js": "4.0.2",
"tinymce": "5.10.2",
"tinymce": "5.10.7",
"yup": "0.31.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/discussions/common/ActionsDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const ActionsDropdown = ({
disabled={disabled}
size={iconSize}
ref={buttonRef}
iconClassNames={dropDownIconSize ? 'dropdown-icon-dimentions' : ''}
iconClassNames={dropDownIconSize ? 'dropdown-icon-dimensions' : ''}
/>
<div className="actions-dropdown">
<ModalPopup
Expand Down
14 changes: 7 additions & 7 deletions src/discussions/common/Confirmation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const Confirmation = ({
title,
description,
onClose,
comfirmAction,
closeButtonVaraint,
confirmAction,
closeButtonVariant,
confirmButtonVariant,
confirmButtonText,
}) => {
Expand All @@ -30,10 +30,10 @@ const Confirmation = ({
</ModalDialog.Body>
<ModalDialog.Footer>
<ActionRow>
<ModalDialog.CloseButton variant={closeButtonVaraint}>
<ModalDialog.CloseButton variant={closeButtonVariant}>
{intl.formatMessage(messages.confirmationCancel)}
</ModalDialog.CloseButton>
<Button variant={confirmButtonVariant} onClick={comfirmAction}>
<Button variant={confirmButtonVariant} onClick={confirmAction}>
{ confirmButtonText || intl.formatMessage(messages.confirmationConfirm)}
</Button>
</ActionRow>
Expand All @@ -45,16 +45,16 @@ const Confirmation = ({
Confirmation.propTypes = {
isOpen: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
comfirmAction: PropTypes.func.isRequired,
confirmAction: PropTypes.func.isRequired,
title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
closeButtonVaraint: PropTypes.string,
closeButtonVariant: PropTypes.string,
confirmButtonVariant: PropTypes.string,
confirmButtonText: PropTypes.string,
};

Confirmation.defaultProps = {
closeButtonVaraint: 'default',
closeButtonVariant: 'default',
confirmButtonVariant: 'primary',
confirmButtonText: '',
};
Expand Down
8 changes: 4 additions & 4 deletions src/discussions/common/HoverCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ const HoverCard = ({
const intl = useIntl();
const { enableInContextSidebar } = useContext(DiscussionContext);
const { isClosed } = useContext(PostCommentsContext);
const isUserPrivilagedInPostingRestriction = useUserPostingEnabled();
const isUserPrivilegedInPostingRestriction = useUserPostingEnabled();

return (
<div
className="flex-fill justify-content-end align-items-center hover-card mr-n4 position-absolute"
data-testid={`hover-card-${id}`}
id={`hover-card-${id}`}
>
{isUserPrivilagedInPostingRestriction && (
{isUserPrivilegedInPostingRestriction && (
<div className="d-flex">
<Button
variant="tertiary"
Expand Down Expand Up @@ -85,7 +85,7 @@ const HoverCard = ({
iconAs={Icon}
size="sm"
alt="Like"
iconClassNames="like-icon-dimentions"
iconClassNames="like-icon-dimensions"
onClick={(e) => {
e.preventDefault();
onLike();
Expand All @@ -99,7 +99,7 @@ const HoverCard = ({
iconAs={Icon}
size="sm"
alt="Follow"
iconClassNames="follow-icon-dimentions"
iconClassNames="follow-icon-dimensions"
onClick={(e) => {
e.preventDefault();
onFollow();
Expand Down
4 changes: 2 additions & 2 deletions src/discussions/data/hooks.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ describe('Hooks', () => {

describe('useUserPostingEnabled', () => {
const ComponentWithHook = () => {
const isUserPrivilagedInPostingRestriction = useUserPostingEnabled();
const isUserPrivilegedInPostingRestriction = useUserPostingEnabled();
return (
<div>
{String(isUserPrivilagedInPostingRestriction)}
{String(isUserPrivilegedInPostingRestriction)}
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/discussions/data/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const selectUserIsStaff = state => state.config.isUserAdmin;

export const selectUserIsGroupTa = state => state.config.isGroupTa;

export const selectconfigLoadingStatus = state => state.config.status;
export const selectConfigLoadingStatus = state => state.config.status;

export const selectLearnersTabEnabled = state => state.config.learnersTabEnabled;

Expand Down
4 changes: 2 additions & 2 deletions src/discussions/discussions-home/DiscussionSidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { DiscussionContext } from '../common/context';
import {
useContainerSize, useIsOnDesktop, useIsOnXLDesktop, useShowLearnersTab,
} from '../data/hooks';
import { selectconfigLoadingStatus, selectEnableInContext } from '../data/selectors';
import { selectConfigLoadingStatus, selectEnableInContext } from '../data/selectors';

const TopicPostsView = lazy(() => import('../in-context-topics/TopicPostsView'));
const InContextTopicsView = lazy(() => import('../in-context-topics/TopicsView'));
Expand All @@ -32,7 +32,7 @@ const DiscussionSidebar = ({ displaySidebar, postActionBarRef }) => {
const isOnXLDesktop = useIsOnXLDesktop();
const { enableInContextSidebar } = useContext(DiscussionContext);
const enableInContext = useSelector(selectEnableInContext);
const configStatus = useSelector(selectconfigLoadingStatus);
const configStatus = useSelector(selectConfigLoadingStatus);
const redirectToLearnersTab = useShowLearnersTab();
const sidebarRef = useRef(null);
const postActionBarHeight = useContainerSize(postActionBarRef);
Expand Down
2 changes: 1 addition & 1 deletion src/discussions/discussions-home/DiscussionsHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const DiscussionsHome = () => {
useFeedbackWrapper();
/* Display the content area if we are currently viewing/editing a post or creating one.
If the window is larger than a particular size, show the sidebar for navigating between posts/topics.
However, for smaller screens or embeds, onlyshow the sidebar if the content area isn't displayed. */
However, for smaller screens or embeds, only show the sidebar if the content area isn't displayed. */
const displayContentArea = (postId || postEditorVisible || (learnerUsername && postId));
if (displayContentArea) { displaySidebar = isOnDesktop; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { useIntl } from '@edx/frontend-platform/i18n';
import { PageBanner } from '@edx/paragon';

import { RequestStatus } from '../../data/constants';
import { selectconfigLoadingStatus, selectIsPostingEnabled } from '../data/selectors';
import { selectConfigLoadingStatus, selectIsPostingEnabled } from '../data/selectors';
import messages from '../messages';

const DiscussionsRestrictionBanner = () => {
const intl = useIntl();
const isPostingEnabled = useSelector(selectIsPostingEnabled);
const configLoadingStatus = useSelector(selectconfigLoadingStatus);
const configLoadingStatus = useSelector(selectConfigLoadingStatus);
const [showBanner, setShowBanner] = useState(true);

const handleDismiss = useCallback(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/discussions/discussions-home/FeedbackWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { logError } from '@edx/frontend-platform/logging';

import { RequestStatus } from '../../data/constants';
import {
selectconfigLoadingStatus,
selectConfigLoadingStatus,
selectIsCourseAdmin,
selectIsCourseStaff,
selectUserIsGroupTa,
Expand All @@ -19,7 +19,7 @@ export default function useFeedbackWrapper() {
const isUserGroupTA = useSelector(selectUserIsGroupTa);
const isCourseAdmin = useSelector(selectIsCourseAdmin);
const isCourseStaff = useSelector(selectIsCourseStaff);
const configStatus = useSelector(selectconfigLoadingStatus);
const configStatus = useSelector(selectConfigLoadingStatus);

useEffect(() => {
if (configStatus === RequestStatus.SUCCESSFUL) {
Expand Down
2 changes: 1 addition & 1 deletion src/discussions/empty-posts/EmptyPosts.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('EmptyPage', () => {
store = initializeStore();
});

test('"posts youve interacted with" message shown when no posts in system', async () => {
test('"posts you\'ve interacted with" message shown when no posts in system', async () => {
renderComponent(`/${courseId}/my-posts/`);
expect(
screen.queryByText(messages.emptyMyPosts.defaultMessage),
Expand Down
4 changes: 2 additions & 2 deletions src/discussions/learners/LearnersView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Button, Spinner } from '@edx/paragon';

import SearchInfo from '../../components/SearchInfo';
import { RequestStatus, Routes } from '../../data/constants';
import { selectconfigLoadingStatus, selectLearnersTabEnabled } from '../data/selectors';
import { selectConfigLoadingStatus, selectLearnersTabEnabled } from '../data/selectors';
import NoResults from '../posts/NoResults';
import {
learnersLoadingStatus,
Expand All @@ -33,7 +33,7 @@ const LearnersView = () => {
const nextPage = useSelector(selectLearnerNextPage());
const loadingStatus = useSelector(learnersLoadingStatus());
const usernameSearch = useSelector(selectUsernameSearch());
const courseConfigLoadingStatus = useSelector(selectconfigLoadingStatus);
const courseConfigLoadingStatus = useSelector(selectConfigLoadingStatus);
const learnersTabEnabled = useSelector(selectLearnersTabEnabled);
const learners = useSelector(selectAllLearners);

Expand Down
6 changes: 3 additions & 3 deletions src/discussions/post-comments/comments/CommentsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const CommentsView = ({ endorsed }) => {
const intl = useIntl();
const [addingResponse, setAddingResponse] = useState(false);
const { isClosed } = useContext(PostCommentsContext);
const isUserPrivilagedInPostingRestriction = useUserPostingEnabled();
const isUserPrivilegedInPostingRestriction = useUserPostingEnabled();

const {
endorsedCommentsIds,
Expand Down Expand Up @@ -66,7 +66,7 @@ const CommentsView = ({ endorsed }) => {
)}
{isLoading && !showLoadMoreResponses && (
<div className="mb-2 mt-3 d-flex justify-content-center">
<Spinner animation="border" variant="primary" className="spinner-dimentions" />
<Spinner animation="border" variant="primary" className="spinner-dimensions" />
</div>
)}
</div>
Expand All @@ -90,7 +90,7 @@ const CommentsView = ({ endorsed }) => {
{handleDefinition(messages.responseCount, unEndorsedCommentsIds.length)}
{unEndorsedCommentsIds.length === 0 && <br />}
{handleComments(unEndorsedCommentsIds, false)}
{(isUserPrivilagedInPostingRestriction && !!unEndorsedCommentsIds.length && !isClosed) && (
{(isUserPrivilegedInPostingRestriction && !!unEndorsedCommentsIds.length && !isClosed) && (
<div className="mx-4">
{!addingResponse && (
<Button
Expand Down
14 changes: 7 additions & 7 deletions src/discussions/post-comments/comments/comment/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Comment = ({
const currentPage = useSelector(selectCommentCurrentPage(id));
const sortedOrder = useSelector(selectCommentSortOrder);
const actions = useActions(ContentTypes.COMMENT, id);
const isUserPrivilagedInPostingRestriction = useUserPostingEnabled();
const isUserPrivilegedInPostingRestriction = useUserPostingEnabled();

useEffect(() => {
// If the comment has a parent comment, it won't have any children, so don't fetch them.
Expand Down Expand Up @@ -119,10 +119,10 @@ const Comment = ({
), [id, currentPage, sortedOrder]);

const handleAddCommentButton = useCallback(() => {
if (isUserPrivilagedInPostingRestriction) {
if (isUserPrivilegedInPostingRestriction) {
setReplying(true);
}
}, [isUserPrivilagedInPostingRestriction]);
}, [isUserPrivilegedInPostingRestriction]);

const handleCommentLike = useCallback(async () => {
await dispatch(editComment(id, { voted: !voted }));
Expand Down Expand Up @@ -154,8 +154,8 @@ const Comment = ({
title={intl.formatMessage(messages.deleteResponseTitle)}
description={intl.formatMessage(messages.deleteResponseDescription)}
onClose={hideDeleteConfirmation}
comfirmAction={handleDeleteConfirmation}
closeButtonVaraint="tertiary"
confirmAction={handleDeleteConfirmation}
closeButtonVariant="tertiary"
confirmButtonText={intl.formatMessage(messages.deleteConfirmationDelete)}
/>
{!abuseFlagged && (
Expand All @@ -164,7 +164,7 @@ const Comment = ({
title={intl.formatMessage(messages.reportResponseTitle)}
description={intl.formatMessage(messages.reportResponseDescription)}
onClose={hideReportConfirmation}
comfirmAction={handleReportConfirmation}
confirmAction={handleReportConfirmation}
confirmButtonVariant="danger"
/>
)}
Expand Down Expand Up @@ -265,7 +265,7 @@ const Comment = ({
/>
</div>
) : (
!isClosed && isUserPrivilagedInPostingRestriction && (inlineReplies.length >= 5) && (
!isClosed && isUserPrivilegedInPostingRestriction && (inlineReplies.length >= 5) && (
<Button
className="d-flex flex-grow mt-2 font-size-14 font-style font-weight-500 text-primary-500"
variant="plain"
Expand Down
Loading

0 comments on commit 1aeb8fb

Please sign in to comment.