-
Notifications
You must be signed in to change notification settings - Fork 667
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
Moved core notifications handling into NotificationsRoot component #12644
Conversation
Build Artifacts
|
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 your PR! I've added a note about a property that was removed that I'm not sure was intentional.
Additionally, it appears you've included two empty config files .bas_hprofile
and .bash_profile
.
The notifications code looks good to me, but I'll see about testing this locally to be sure there are no regressions.
notificationModalShown: true, | ||
}; | ||
}, | ||
computed: { | ||
...mapState({ | ||
error: state => state.core.error, |
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.
I'm not seeing why error
was removed here, was this intentional?
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.
mapState was removed to completely decouple the component from vuex store, but i did not think of error handling. Should i handle the error locally in getnotification
method or keep the mapState
for error property?
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.
@nucleogenesis i removed the empty bashrc files. As for the error handling, it is being handled locally in the methods. If you want me to handle error with mapState
, should i do that?
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.
My apologies for missing this last week @iamshobhraj
The mapState
function is assigning this.error
to the value of state.core.error
so that this.error
is reactive whenever state.core.error
changes.
Elsewhere in the component, this.error
is expected to exist so we should keep mapState
imported and keep this particular line mapping to the error
.
To be a bit more clear, basically you just need to remove the line notifications: ...
but not the error: ...
line.
@nucleogenesis Could you please tell me whats causing this error. I removed the empty bash files, fixed the import errors but I am still getting an error with this api endpoint while testing.
|
@iamshobhraj - I'm not sure exactly what the cause would be. Seems that kolibri/kolibri/core/assets/src/views/NotificationsRoot.vue Lines 155 to 156 in 9011352
Do you see any errors in your dev tools' "Network" tab for the request for the notifications? Maybe there is a permissions or other issue at hand I'm not seeing anything along these lines, but I can't help but wonder if something about the change from using |
@iamshobhraj - I just tested your PR locally, and did not see the error you are seeing. It tends to indicate that something has gone wrong in the backend, because the URL has not been properly registered. My first suggestion would be to make sure that your Python dependencies in your virtual environment are up to date https://kolibri-dev.readthedocs.io/en/develop/getting_started.html#install-python-dependencies If that's still not working, I'd recommend running What I see when I run your code is that it seems to be working as intended, with the only exception being the issue that @nucleogenesis previously pointed out. |
@rtibbles @nucleogenesis I'm sorry for late response. I made the changes requested. But i am still getting this error while testing locally after setting up the project again on my machine.
|
Did you try the steps I suggested here?
If the URL doesn't exist, something is going wrong with the Python backend (but the error is being silently caught by Django). |
yes, i followed it step by step again on my. |
In the browser console if you enter:
What do you get as the output (it may be very long)? |
|
Hrm, so I am seeing the I will test again locally on my machine, as I still don't quite understand how this is happening and only specifically on your device, seemingly. |
@rtibbles i found the issue. |
@iamshobhraj thank you for your continued work on this! I investigated the failing tests and seems like the tests just need to be updated according to the kinds of changes you made. This commit passes them locally for me: 9f5de38 As for the linting, you'll need to look at the linting issues in the PR actions output, or you can run |
Hey @iamshobhraj - would you be able to update your PR? I think that with the linting and tests fixed, this should be ready to merge. This is work that is currently blocking some upcoming work, so if you don't have time to come back to this someone on our team will likely push some commits here and merge it. Thank you again for your efforts and work on this! |
@nucleogenesis sorry for the delay. I have exams in my university so I was away. I'll make sure to add the changes tonight. Sorry for the inconvenience. |
@iamshobhraj no worries at all! If you need time for your exams or study today or can't get to it for any other reason, I can get the PR ready to merge no problem. Thanks again for everything you've done on this! <3 |
@nucleogenesis i made the changes to test file as per changes made in component file. also fixed the linting error. |
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.
I re-read the original issue to be sure this covers everything and you checked all of the boxes there! Wonderful work @iamshobhraj thank you!
Description
Moved core notifications handling from actions.js file to NotificationRoot component that were earlier handled through core vuex state. Removed vuex mutations in kolibri_app.js and its spec file.
issue addressed
Addresses #12626
Removes use of vuex in favour of composables.
Changelog