Skip to content

Commit 963dc96

Browse files
rtibblesbotclaude
andcommitted
Show Print all passwords button in app context
Remove the isAppContext gate on the print button and the title row's grid span so AllPasswordsPage always uses the two-column layout with the print button, on both the coach and facility passwords pages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0fb004f commit 963dc96

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

packages/kolibri-common/components/AllPasswordsPage.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
<!-- Screen-only header with Print button -->
1515
<KGrid v-show="!$isPrint">
1616
<KGridItem
17-
:layout12="{ span: isAppContext ? 12 : 6, alignment: 'left' }"
18-
:layout8="{ span: isAppContext ? 8 : 4, alignment: 'left' }"
19-
:layout4="{ span: isAppContext ? 4 : 2, alignment: 'left' }"
17+
:layout12="{ span: 6, alignment: 'left' }"
18+
:layout8="{ span: 4, alignment: 'left' }"
19+
:layout4="{ span: 2, alignment: 'left' }"
2020
class="header-row"
2121
>
2222
<h1 class="header-title">{{ allPasswordsHeader$() }}</h1>
2323
</KGridItem>
2424
<KGridItem
25-
v-if="!isAppContext"
2625
:layout12="{ span: 6, alignment: 'right' }"
2726
:layout8="{ span: 4, alignment: 'right' }"
2827
:layout4="{ span: 2, alignment: 'right' }"
@@ -149,7 +148,6 @@
149148
import UserPicturePassword from 'kolibri-common/components/UserPicturePassword';
150149
import NoPasswordInfo from 'kolibri-common/components/NoPasswordInfo';
151150
import LearnerPasswordCard from 'kolibri-common/components/LearnerPasswordCard';
152-
import useUser from 'kolibri/composables/useUser';
153151
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
154152
155153
export default {
@@ -162,7 +160,6 @@
162160
const showPrintDialog = ref(false);
163161
const printFormat = ref('images');
164162
165-
const { isAppContext } = useUser();
166163
const { windowBreakpoint } = useKResponsiveWindow();
167164
168165
const {
@@ -240,7 +237,6 @@
240237
}
241238
242239
return {
243-
isAppContext,
244240
handleSortChange,
245241
showPrintDialog,
246242
printFormat,

packages/kolibri-common/components/__tests__/AllPasswordsPage.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ref } from 'vue';
22
import { render, screen, fireEvent } from '@testing-library/vue';
33
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
4+
import useUser, { useUserMock } from 'kolibri/composables/useUser'; // eslint-disable-line
45
import { picturePasswordStrings } from 'kolibri-common/strings/picturePasswords';
56
import AllPasswordsPage from '../AllPasswordsPage.vue';
67

@@ -87,6 +88,12 @@ describe('AllPasswordsPage', () => {
8788
renderComponent();
8889
expect(screen.getByRole('button', { name: printAction$() })).toBeInTheDocument();
8990
});
91+
92+
it('renders a Print button in app context', () => {
93+
useUser.mockImplementation(() => useUserMock({ isAppContext: true }));
94+
renderComponent();
95+
expect(screen.getByRole('button', { name: printAction$() })).toBeInTheDocument();
96+
});
9097
});
9198

9299
describe('print dialog', () => {

0 commit comments

Comments
 (0)