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

Fix coreStrings import in AttemptLogList #12429

Merged

Conversation

AlexVelezLl
Copy link
Member

@AlexVelezLl AlexVelezLl commented Jul 9, 2024

Summary

For some webpack import issues, when importing coreStrings from a component inside core using kolibri.utils.coreStrings for some reason this import gets the default import of the file commonCoreString which is a mixin, instead of importing the named export of the coreStrings Translator. Referencing directly using relative import is a workaround to solve this e.g..

Before After
image image

References

Closes #12424.

Reviewer guidance

Replicate the escenario showed in ##12424.

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@AlexVelezLl AlexVelezLl requested a review from pcenov July 9, 2024 14:51
Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AlexVelezLl - I'm requesting changes to block merge until @rtibbles has a chance to look at this if he's able to tomorrow. He and I discussed this a bit and I recall he was skeptical of the need to import the file differently here than in other parts of the code.

One thing I noticed is that this appears to be an issue with the core package itself in that all plugins can import import coreStrings... but the one file in core cannot.

kolibri/plugins/user_auth/assets/src/views/LoginSideNavEntry.js|4 col 1| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/user_profile/assets/src/views/UserProfileSideNavEntry.js|4 col 1| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/learn/assets/src/views/LearnSideNavEntry.js|3 col 1| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/learn/assets/src/views/LibraryPage/OtherLibraries.vue|145 col 3| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/learn/assets/src/views/ExamPage/AnswerHistory.vue|109 col 3| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/learn/assets/src/composables/useLearningActivities.js|11 col 1| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/learn/assets/src/my_downloads/views/MyDownloadsSideNavEntry.js|3 col 1| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/device/assets/src/views/DeviceManagementSideNavEntry.js|6 col 1| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/facility/assets/src/views/FacilityManagementSideNavEntry.js|4 col 1| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/coach/assets/src/csv/fields.js|4 col 1| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/coach/assets/src/views/CoachSideNavEntry.js|3 col 1| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/plugins/coach/assets/src/views/common.js|2 col 1| import coreStrings from 'kolibri.utils.coreStrings';
kolibri/core/assets/src/views/AttemptLogList.vue|157 col 3| import coreStrings from 'kolibri.utils.coreStrings';

This may be a quirk of our build system and it may be one that can be fixed on the build-system level but that's probably more work than is necessary in light of our timeline.

I'm keen to merge this and make a follow-up in either case. Let's see if Richard is back tomorrow and has any thoughts as well, otherwise we'll merge this and make a follow-up

@pcenov
Copy link
Member

pcenov commented Jul 10, 2024

LGTM as well, though there's a Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'exercise_id') in the console when I select a question from the drop-down:

2024-07-10_16-26-21.mp4

@AlexVelezLl
Copy link
Member Author

Thank you @pcenov! I have fixed this

Copy link
Member

@pcenov pcenov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AlexVelezLl!

@nucleogenesis nucleogenesis dismissed their stale review July 12, 2024 15:50

Richard gave it a look, the full fix for the issue will be done fixing #5488, but this can be merged in the meantime

@nucleogenesis nucleogenesis merged commit 11ed18c into learningequality:develop Jul 12, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EQM - Cannot preview the answer history of a completed quiz in mobile view
3 participants