Helper function(s) to manage display of metadata tags in the new cards
Summary
This PR adds new composable function useContentNodeMetadata to manage metadata tags for the new cards that will improve the user experience for coaches by providing relevant information at a glance.
References
https://github.com/learningequality/kolibri/issues/12525
Reviewer guidance
-
Functionality & Logic:
- Does the composable correctly prioritizes and limits the number of metadata tags as per the specifications:
-
Channels/Folders: Max 7 tags (3 from Category, 3 from Level, 1 from Language).
-
Resources: Max 3 tags (Activity, Duration, Level, Category, Language). This Channel maybe a good staring point
duvub-gufoz -
Verify that for multiple languages or activities, it displays "Multiple languages" or "multiple learning activities" respectively.
- Confirm that the composable accurately handles cases where certain metadata is missing, displaying the next available tag based on the prioritization system.
Translation & Output:
Check that the returned array of metadata strings is properly translated and can be easily consumed by card components for rendering.
TODO
- one thing I have started implementing is writing a unit test for the compassable
- Update the composable to Show resources / What you need. We will need to update our API endpoint to expose this.
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
- PR is fully functional
- PR has been tested for accessibility regressions
- External dependency files were updated if necessary (
yarnandpip) - Documentation is updated
- Contributor is in AUTHORS.md
Build Artifacts
| Asset type | Download link |
|---|---|
| PEX file | kolibri-0.18.0.dev0_git.20241021211242.pex |
| Windows Installer (EXE) | kolibri-0.18.0.dev0+git.20241021211242-windows-setup-unsigned.exe |
| Debian Package | kolibri_0.18.0.dev0+git.20241021211242-0ubuntu1_all.deb |
| Mac Installer (DMG) | kolibri-0.18.0.dev0+git.20241021211242.dmg |
| Android Package (APK) | kolibri-0.18.0.dev0+git.20241021211242-0.1.4-debug.apk |
| TAR file | kolibri-0.18.0.dev0+git.20241021211242.tar.gz |
| WHL file | kolibri-0.18.0.dev0+git.20241021211242-py2.py3-none-any.whl |
I am not doing a review here, just took a peak out of curiosity and very nice work @AllanOXDi, the composable is structured well and all is readable :-)
I one thing have started implementing writing a unit test for the compassable
Nice! That'll be helpful for these kinds of functions. Generally, you could even get tests ready even before opening for review as it helps reviewers as a kind of documentation, and it also demonstrates in what scenarios it works robustly.
Merging but will open issues for these two uncovered part.
- write a unit test for the compassable.
- Update the composable to Show resources /What you need.