Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: WIP adding move modal #235

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e73ce03
feat: [AXIMST-111] add textbook page (#130)
vladislavkeblysh Jan 31, 2024
8c01200
feat: [AXIMST-111] Textbooks: textbook sidebar (#140)
vladislavkeblysh Jan 31, 2024
47bc745
feat: [AXIMST-27] Unit page - render xblock content (#121)
ihor-romaniuk Feb 1, 2024
deecc8d
fix: [AXIMST-434-435] fixed textbook chapter texts
vladislavkeblysh Feb 1, 2024
25d8780
fix: [AXIMST-27] Unit page - change iframe pararm for display xblock …
ihor-romaniuk Feb 5, 2024
f6faabf
feat: [AXIMST-117] Textbooks: add textbook form (#159)
vladislavkeblysh Feb 12, 2024
08999e4
feat: [AXIMST-123] Textbooks: Edit textbook (#168)
vladislavkeblysh Feb 13, 2024
fa6d084
feat: [AXIMST-135] Textbooks: Delete textbook (#169)
vladislavkeblysh Feb 14, 2024
9e42924
feat: [AXIMST-46] Course unit - Drag And Drop For Xblocks (#158)
PKulkoRaccoonGang Feb 15, 2024
f20e70e
feat: [AXIMST-129] Textbooks: Textbook preview (#172)
vladislavkeblysh Feb 20, 2024
ea7525a
fix: [AXIMST-488-489] Textbooks: file size and upload connection aler…
vladislavkeblysh Feb 20, 2024
11198c3
fix: [AXIMST-504] Textbooks: closing delete modal (#175)
vladislavkeblysh Feb 20, 2024
7cc8899
feat: [AXIMST-469] Unit page - display unit and xblock visibility mes…
ihor-romaniuk Feb 20, 2024
d1f7641
fix: [AXIMST-510] there is no message if a user upload a large file (…
Feb 23, 2024
d3548d4
fix: [AXIMST-545] fixed upload modal error text (#193)
vladislavkeblysh Feb 29, 2024
a570736
feat: [AXIMST-52] display unit and xblock render errors (#191)
ihor-romaniuk Feb 29, 2024
b8b2588
fix: [AXIMST-558] Course unit - Fixed loading errors and PropTypes (#…
PKulkoRaccoonGang Mar 4, 2024
8bcfd5d
feat: [AXIMST-538] Add errors handling 4xx, 5xx (#196)
ruzniaievdm Mar 6, 2024
13661f5
feat: [AXIMST-605] add file name to upload preview modal (#202)
vladislavkeblysh Mar 11, 2024
52cee6b
feat: [AXIMST-605] add file name to upload preview modal
vladislavkeblysh Mar 14, 2024
21bcc1c
fix: [AXIMST-656] Course unit - Fixed space between xblocks (#206)
PKulkoRaccoonGang Mar 18, 2024
fa95694
feat: Course unit - Rendering xblocks in iframes (#201)
PKulkoRaccoonGang Mar 21, 2024
00b784a
fix: fixing problems with dnd after sync (#212)
PKulkoRaccoonGang Mar 25, 2024
e382417
fix: [AXIMST-719] fixed SCORM xblock rendering (#215)
PKulkoRaccoonGang Mar 26, 2024
66244c8
feat: [AXIMST-560] display tags count on each component (#214)
khudym Mar 27, 2024
8a3c5a0
fix: tags count after rebase (#219)
monteri Apr 1, 2024
8fdb7bb
refactor: delete i18n after incorrect rebase (#216)
khudym Mar 27, 2024
fcb6919
fix: [AXIMST-719] Course unit - Xblock problems (#213)
PKulkoRaccoonGang Mar 29, 2024
c51de28
fix: [AXIMST-655] fixed position of the view-port after loading the u…
PKulkoRaccoonGang Mar 29, 2024
7fc1c90
fix: [AXIMST-738] Unit page tagging add margin to the tag button (#221)
khudym Apr 1, 2024
8f0034a
fix: [AXIMST-718] fixed problem with CSRF token (#222)
PKulkoRaccoonGang Apr 2, 2024
c7b91b6
fix: [AXIMST-737] add tooltip, change tag to button (#220)
khudym Apr 2, 2024
1cbf835
feat: [AXIMST-739] added xblock actions (#218)
PKulkoRaccoonGang Apr 2, 2024
d6086d4
fix: [AXIMST-736] Unit page tagging waffle flag (#225)
khudym Apr 2, 2024
d049879
refactor: removed canEdit mock (#224)
PKulkoRaccoonGang Apr 2, 2024
352f60c
feat: [AXIMST-28] added edit modals for xblocks (#223)
PKulkoRaccoonGang Apr 9, 2024
d21fc55
fix: [AXIMST-718] Course unit - Created logic for getting CSRF token …
PKulkoRaccoonGang Apr 9, 2024
6693b23
fix: [AXIMST-745] added studioBaseUrl for static paths (#228)
PKulkoRaccoonGang Apr 9, 2024
46ce2dd
refactor: [AXIMST-746] Unit page performance refactoring (#229)
khudym Apr 10, 2024
2bb1817
fix: [AXIMST-768] fixed sidebar updating (#230)
PKulkoRaccoonGang Apr 11, 2024
63381c2
fix: [AXIMST-785] fixed discard logic (#232)
PKulkoRaccoonGang Apr 11, 2024
8293f88
fix: [AXIMST-769] Course unit - Added display of error alert (#233)
PKulkoRaccoonGang Apr 12, 2024
7126f1a
feat: [AXIMST-800] Course unit - Added Collapse and Expand all button…
PKulkoRaccoonGang Apr 15, 2024
ff9e9f1
feat: WIP adding move modal
GlugovGrGlib Apr 29, 2024
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ INVITE_STUDENTS_EMAIL_TO=''
AI_TRANSLATIONS_BASE_URL=''
ENABLE_HOME_PAGE_COURSE_API_V2=false
ENABLE_CHECKLIST_QUALITY=''
SECURE_ORIGIN_XBLOCK_BOOTSTRAP_HTML_URL=null
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ INVITE_STUDENTS_EMAIL_TO="[email protected]"
AI_TRANSLATIONS_BASE_URL='http://localhost:18760'
ENABLE_HOME_PAGE_COURSE_API_V2=false
ENABLE_CHECKLIST_QUALITY=true
SECURE_ORIGIN_XBLOCK_BOOTSTRAP_HTML_URL=/xblock-bootstrap.html
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ BBB_LEARN_MORE_URL=''
INVITE_STUDENTS_EMAIL_TO="[email protected]"
ENABLE_HOME_PAGE_COURSE_API_V2=true
ENABLE_CHECKLIST_QUALITY=true
SECURE_ORIGIN_XBLOCK_BOOTSTRAP_HTML_URL=/xblock-bootstrap.html
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ temp/babel-plugin-react-intl
/temp
/.vscode
/module.config.js
/module.dev-tutor.config.js

# Local environment overrides
.env.private
Expand Down
121 changes: 121 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"@testing-library/user-event": "^13.2.1",
"axios": "^0.28.0",
"axios-mock-adapter": "1.22.0",
"copy-webpack-plugin": "^11.0.0",
"eslint-import-resolver-webpack": "^0.13.8",
"fetch-mock-jest": "^1.5.1",
"glob": "7.2.3",
Expand Down
5 changes: 5 additions & 0 deletions src/CourseAuthoringRoutes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import CourseImportPage from './import-page/CourseImportPage';
import { DECODED_ROUTES } from './constants';
import CourseChecklist from './course-checklist';
import GroupConfigurations from './group-configurations';
import { Textbooks } from './textbooks';

/**
* As of this writing, these routes are mounted at a path prefixed with the following:
Expand Down Expand Up @@ -125,6 +126,10 @@ const CourseAuthoringRoutes = () => {
path="certificates"
element={<PageWrap><Certificates courseId={courseId} /></PageWrap>}
/>
<Route
path="/pages-and-resources/textbooks"
element={<PageWrap><Textbooks courseId={courseId} /></PageWrap>}
/>
</Routes>
</CourseAuthoringPage>
);
Expand Down
1 change: 1 addition & 0 deletions src/certificates/data/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createSelector } from '@reduxjs/toolkit';
export const getLoadingStatus = (state) => state.certificates.loadingStatus;
export const getSavingStatus = (state) => state.certificates.savingStatus;
export const getSavingImageStatus = (state) => state.certificates.savingImageStatus;
export const getErrorMessage = (state) => state.certificates.errorMessage;
export const getSendRequestErrors = (state) => state.certificates.sendRequestErrors.developer_message;
export const getCertificates = state => state.certificates.certificatesData.certificates;
export const getHasCertificateModes = state => state.certificates.certificatesData.hasCertificateModes;
Expand Down
5 changes: 4 additions & 1 deletion src/certificates/data/slice.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ const slice = createSlice({
loadingStatus: RequestStatus.PENDING,
savingStatus: '',
savingImageStatus: '',
errorMessage: '',
},
reducers: {
updateSavingStatus: (state, { payload }) => {
state.savingStatus = payload.status;
const { status, errorMessage } = payload;
state.savingStatus = status;
state.errorMessage = errorMessage;
},
updateSavingImageStatus: (state, { payload }) => {
state.savingImageStatus = payload.status;
Expand Down
13 changes: 5 additions & 8 deletions src/certificates/data/thunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
hideProcessingNotification,
showProcessingNotification,
} from '../../generic/processing-notification/data/slice';
import { handleResponseErrors } from '../../generic/saving-error-alert';
import { NOTIFICATION_MESSAGES } from '../../constants';
import {
getCertificates,
Expand Down Expand Up @@ -51,8 +52,7 @@ export function createCourseCertificate(courseId, certificate) {
dispatch(updateSavingStatus({ status: RequestStatus.SUCCESSFUL }));
return true;
} catch (error) {
dispatch(updateSavingStatus({ status: RequestStatus.FAILED }));
return false;
return handleResponseErrors(error, dispatch, updateSavingStatus);
} finally {
dispatch(hideProcessingNotification());
}
Expand All @@ -70,8 +70,7 @@ export function updateCourseCertificate(courseId, certificate) {
dispatch(updateCertificateSuccess(certificatesValues));
return true;
} catch (error) {
dispatch(updateSavingStatus({ status: RequestStatus.FAILED }));
return false;
return handleResponseErrors(error, dispatch, updateSavingStatus);
} finally {
dispatch(hideProcessingNotification());
}
Expand All @@ -89,8 +88,7 @@ export function deleteCourseCertificate(courseId, certificateId) {
dispatch(updateSavingStatus({ status: RequestStatus.SUCCESSFUL }));
return true;
} catch (error) {
dispatch(updateSavingStatus({ status: RequestStatus.FAILED }));
return false;
return handleResponseErrors(error, dispatch, updateSavingStatus);
} finally {
dispatch(hideProcessingNotification());
}
Expand All @@ -111,8 +109,7 @@ export function updateCertificateActiveStatus(courseId, path, activationStatus)
dispatch(fetchCertificates(courseId));
return true;
} catch (error) {
dispatch(updateSavingStatus({ status: RequestStatus.FAILED }));
return false;
return handleResponseErrors(error, dispatch, updateSavingStatus);
} finally {
dispatch(hideProcessingNotification());
}
Expand Down
12 changes: 6 additions & 6 deletions src/certificates/layout/MainLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import PropTypes from 'prop-types';
import { Container, Layout } from '@openedx/paragon';
import { useIntl } from '@edx/frontend-platform/i18n';

import { SavingErrorAlert } from '../../generic/saving-error-alert';
import ProcessingNotification from '../../generic/processing-notification';
import InternetConnectionAlert from '../../generic/internet-connection-alert';
import SubHeader from '../../generic/sub-header/SubHeader';
import messages from '../messages';
import CertificatesSidebar from './certificates-sidebar/CertificatesSidebar';
Expand All @@ -14,8 +14,8 @@ const MainLayout = ({ courseId, showHeaderButtons, children }) => {
const intl = useIntl();

const {
isQueryPending,
isQueryFailed,
errorMessage,
savingStatus,
isShowProcessingNotification,
processingNotificationTitle,
} = useLayout();
Expand Down Expand Up @@ -54,9 +54,9 @@ const MainLayout = ({ courseId, showHeaderButtons, children }) => {
isShow={isShowProcessingNotification}
title={processingNotificationTitle}
/>
<InternetConnectionAlert
isFailed={isQueryFailed}
isQueryPending={isQueryPending}
<SavingErrorAlert
savingStatus={savingStatus}
errorMessage={errorMessage}
/>
</div>
</>
Expand Down
12 changes: 5 additions & 7 deletions src/certificates/layout/hooks/useLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,26 @@ import { useSelector } from 'react-redux';

import { RequestStatus } from '../../../data/constants';
import { getProcessingNotification } from '../../../generic/processing-notification/data/selectors';
import { getSavingStatus, getSavingImageStatus } from '../../data/selectors';
import { getSavingStatus, getErrorMessage } from '../../data/selectors';

const useLayout = () => {
const savingStatus = useSelector(getSavingStatus);
const savingImageStatus = useSelector(getSavingImageStatus);
const errorMessage = useSelector(getErrorMessage);

const {
isShow: isShowProcessingNotification,
title: processingNotificationTitle,
} = useSelector(getProcessingNotification);

const isQueryPending = savingStatus === RequestStatus.PENDING || savingImageStatus === RequestStatus.PENDING;
const isQueryFailed = savingStatus === RequestStatus.FAILED || savingImageStatus === RequestStatus.FAILED;

useEffect(() => {
if (savingStatus === RequestStatus.SUCCESSFUL) {
window.scrollTo({ top: 0, behavior: 'smooth' });
}
}, [savingStatus]);

return {
isQueryPending,
isQueryFailed,
errorMessage,
savingStatus,
isShowProcessingNotification,
processingNotificationTitle,
};
Expand Down
2 changes: 2 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@ export const CLIPBOARD_STATUS = {
};

export const STRUCTURAL_XBLOCK_TYPES = ['vertical', 'sequential', 'chapter', 'course'];

export const UPLOAD_FILE_MAX_SIZE = 20 * 1000 * 1000; // 20mb
Loading
Loading