-
Notifications
You must be signed in to change notification settings - Fork 658
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
Raised for testing purpose - Contains all code of GSoC 2024 #5946
base: master
Are you sure you want to change the base?
Raised for testing purpose - Contains all code of GSoC 2024 #5946
Conversation
This is an impressive set of functionality. I've done some initial testing, and there are a few UX problems that I think will need to be fixed before this is ready to deploy.
|
I also encountered a JS error when entering 'reorder' mode on an existing module's index page:
|
Fixing this error and also reducing some unnecessary lines of code of 'reordering slides' pr. Then will move on to incorporating the listed changes to make it perfect for deployment. |
sir, where you found this error as, I tried replicating this error in my browser console but found nothing |
@ragesoss sir, kindly have a look |
Hmm... I still hit that same error. I'm doing this in wiki_education mode, with freshly reloaded training modules, and any time I click 'Change Order' on the index page of one of the YAML-backed modules, it throws a JS error and the React-rendered sidebar disappears. |
596a1a4
to
9125c59
Compare
@ragesoss sir, kindly verify that js error that we have encountered earlier is not happening now ? |
Yep! That fixes the error. Thanks! I will continue testing from here, this week or next. |
invalid | ||
invalid, | ||
label, | ||
spacer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for? It doesn't look like this property gets used in any components that use TextAreaInput.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a custom label that can be be given to text_area component. Sir, we are using this in our modals of 'creating library', 'creating categories' and 'adding modules'.
Whenever there is any error like no text provided by user, or exceeded the max limit of characters, then along with the boundaries of text_area_input.jsx this label also becomes red.
Eg :
case SET_TRAINING_MODE: | ||
return { | ||
...state, | ||
editMode: JSON.parse(mainDiv.getAttribute('data-training_mode')).editMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like violation of the Redux state model, as it changes state based on things outside of the current state and the data included in the action object (so it's not a pure function). Although it wouldn't actual be mutable normally, I think it still ought to be refactored so that reading from the DOM happens outside of the reducer and the editMode value is included in the action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for catching that Redux violation. I've refactored the code to maintain reducer purity by moving the DOM interaction out of the reducer. The editMode value is now read in the action creator and passed through the action's payload. The reducer now only depends on the state and action parameters, following Redux's pure function principles.
I found that the Edit Mode button is present and works even for logged out users. It should be limited to admins initially, and we might open it to any logged in user later on, but not logged out users. |
I get this error when clicking Remove Slide from a module index page (of a module that was originally from yaml):
|
bcf80c0
to
7f5b45a
Compare
@ragesoss Sir, I’ve added these updates :
Kindly review and let me know if there’s anything else we can add or fix before we are ready for deployment. |
I've done some more testing and turned up a few things. I'm able to reorder slides now, yay! From the index of a module (which has content from .yml files), I click the edit icon for a slide. If I change the title and do not enter anything for the (blank) wiki_page field, I get a console error upon clicking Update:
If I add a wiki_slide value to that empty field, the above error does not occur and the content is successfully loaded from the wiki, but the wiki_slide value is not persisted in the database record; it's still This might be only an issue because I'm testing in a cross-config way, using |
What this PR does
This pr is created for testing all training modification features.
Eg: how they work over production server