Update AttandanceBlock KButton to KRouterLink
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
Update AttendanceBlock KButton to KRouterLink while maintaining styling.
Complexity: Low Target branch: release-v0.19.x
The Change
Change the KButton here: https://github.com/learningequality/kolibri/blob/6691db5ce055a70f62089b229f4336b409ec7cd7/kolibri/plugins/coach/frontend/views/home/HomePage/AttendanceBlock.vue#L13
To a KRouterLink - but ensure there is no change in visual styling. See the documentation for how to have the same button-like styling: https://design-system.learningequality.org/krouterlink#prop:appearance
Out of Scope
- Any changes to the route it links to
- Any changes to appearance
Acceptance Criteria
- [ ] Uses KRouterLink instead of KButton
- [ ] Visual appearance remains the same
Testing
Take a screenshot before and after.
Implementation Plan
Goal: Replace KButton with KRouterLink in AttendanceBlock.vue while maintaining identical visual styling.
Approach: Both components share the same appearance, primary, text, and :to props. The appearance="raised-button" prop ensures the KRouterLink renders with button styling. This is a near-drop-in replacement.
Phase 1: Update the component
- Swap import from
KButtontoKRouterLink(samekolibri-design-system/lib/buttons-and-links/path) - Update
componentsregistration - Change
<KButton>tag to<KRouterLink>in template (all props stay the same)
Phase 2: Update tests
- Remove unused
KButtonstub from test file (theKRouterLinkstub already exists) - Verify all 8 existing tests pass
Phase 3: Verify and commit
- Run linter and tests
- Commit
Files modified:
kolibri/plugins/coach/frontend/views/home/HomePage/AttendanceBlock.vuekolibri/plugins/coach/frontend/views/home/HomePage/__tests__/AttendanceBlock.spec.js
Risk: Very low — simple component swap with shared props interface. No behavioral changes.
Note that K* components are preregistered anyway, so there's never any need to import them on a per component basis.
Implementation Complete
Replaced KButton with KRouterLink in AttendanceBlock.vue.
Changes
AttendanceBlock.vue: Swapped import, component registration, and template tag fromKButtontoKRouterLink. All props (text,primary,appearance="raised-button",:to) remain identical — both components inherit these from the sharedbuttonMixin.AttendanceBlock.spec.js: Removed the now-unusedKButtonstub. The existingKRouterLinkstub already covered the component.
Verification
- Tests: 8/8 pass
- Lint: 2 files linted, 0 errors
- Visual styling: No change —
KRouterLinkwithappearance="raised-button"andprimaryrenders identically toKButtonwith the same props (confirmed via sharedbuttonMixinin kolibri-design-system)
Branch: issue-14380-743515
Self-Review Complete
Findings & Fixes
suggestion (fixed): Per @rtibbles' feedback, K* components are preregistered by KThemePlugin and don't need per-component imports. Removed the KRouterLink import (which had replaced the KButton import) and also removed the pre-existing KCircularLoader import and both their components registrations. Committed in 2fb9ac9726.
No blocking issues found. The template tag swap from KButton to KRouterLink is correct — all props (text, primary, appearance="raised-button", :to) are shared via buttonMixin, ensuring identical visual styling.
Verification
- 8/8 tests pass
- Lint clean (1 file, 0 errors)
- Final diff: 2 files, 1 insertion, 10 deletions
Acceptance Criteria
- [x] Uses
KRouterLinkinstead ofKButton - [x] Visual appearance remains the same (
appearance="raised-button"+primarypreserved) - [x] No changes to route or appearance
- [x] Tests pass, lint clean
Thanks for the note about K* components being pre-registered globally, @rtibbles. The PR at #14381 incorporates this — it removes the unnecessary KButton and KCircularLoader imports and component registrations in addition to swapping KButton → KRouterLink with appearance="raised-button" to maintain styling.
Fixed in #14381