Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update KDropdownMenu usage to the latest KDS updates
Browse files Browse the repository at this point in the history
MisRob committed Sep 14, 2022
1 parent af568f0 commit 5b25e77
Showing 9 changed files with 102 additions and 55 deletions.
18 changes: 13 additions & 5 deletions kolibri/core/assets/src/views/ContentRenderer/DownloadButton.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<template>

<KDropdownMenu
:text="$tr('downloadContent')"
:options="fileOptions"
@select="download"
/>
<KButton
ref="button"
hasDropdown
:primary="$attrs.primary"
>
<span>{{ $tr('downloadContent') }}</span>
<template #menu>
<KDropdownMenu
:options="fileOptions"
@select="download"
/>
</template>
</KButton>

</template>

Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@
>
<template #menu>
<KDropdownMenu
:primary="false"
:hasIcons="true"
:options="overflowMenuLinks"
@select="handleSelect"
Original file line number Diff line number Diff line change
@@ -27,14 +27,20 @@
-->
<div>&nbsp;</div>
<KButtonGroup v-if="practiceQuizzesExist">
<KDropdownMenu
<KButton
primary
hasDropdown
appearance="raised-button"
:primary="true"
:text="coachString('newQuizAction')"
:options="dropdownOptions"
class="options-btn"
@select="handleSelect"
/>
>
<template #menu>
<KDropdownMenu
:options="dropdownOptions"
class="options-btn"
@select="handleSelect"
/>
</template>
</KButton>
</KButtonGroup>
<KRouterLink
v-else
Original file line number Diff line number Diff line change
@@ -12,12 +12,18 @@
{{ this.$formatNumber(group.users.length) }}
</td>
<td class="core-table-button-col">
<KDropdownMenu
<KButton
hasDropdown
appearance="flat-button"
:text="coreString('optionsLabel')"
:options="menuOptions"
@select="handleSelection"
/>
>
<template #menu>
<KDropdownMenu
:options="menuOptions"
@select="handleSelection"
/>
</template>
</KButton>
</td>
</tr>

Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<template>

<KDropdownMenu
:text="coreString('optionsLabel')"
:options="options"
<KButton
hasDropdown
appearance="flat-button"
:primary="false"
@select="$emit('select', $event.value)"
/>
:text="coreString('optionsLabel')"
>
<template #menu>
<KDropdownMenu
:options="options"
@select="$emit('select', $event.value)"
/>
</template>
</KButton>

</template>

Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<template>

<KDropdownMenu
:text="coreString('optionsLabel')"
:options="options"
<KButton
hasDropdown
appearance="flat-button"
:primary="false"
@select="$emit('select', $event.value)"
/>
:text="coreString('optionsLabel')"
>
<template #menu>
<KDropdownMenu
:options="options"
@select="$emit('select', $event.value)"
/>
</template>
</KButton>

</template>

32 changes: 22 additions & 10 deletions kolibri/plugins/device/assets/src/views/FacilitiesPage/index.vue
Original file line number Diff line number Diff line change
@@ -61,12 +61,18 @@
appearance="flat-button"
@click="facilityForSync = facility"
/>
<KDropdownMenu
:text="coreString('optionsLabel')"
:options="facilityOptions(facility)"
<KButton
hasDropdown
appearance="flat-button"
@select="handleOptionSelect($event.value, facility)"
/>
:text="coreString('optionsLabel')"
>
<template #menu>
<KDropdownMenu
:options="facilityOptions(facility)"
@select="handleOptionSelect($event.value, facility)"
/>
</template>
</KButton>
</KButtonGroup>
</td>
</tr>
@@ -91,12 +97,18 @@
appearance="flat-button"
@click="facilityForSync = facility"
/>
<KDropdownMenu
:text="coreString('optionsLabel')"
:options="facilityOptions(facility)"
<KButton
hasDropdown
appearance="flat-button"
@select="handleOptionSelect($event.value, facility)"
/>
:text="coreString('optionsLabel')"
>
<template #menu>
<KDropdownMenu
:options="facilityOptions(facility)"
@select="handleOptionSelect($event.value, facility)"
/>
</template>
</KButton>
</KButtonGroup>
</td>
</tr>
24 changes: 12 additions & 12 deletions kolibri/plugins/device/assets/src/views/ManageContentPage/index.vue
Original file line number Diff line number Diff line change
@@ -13,16 +13,21 @@
<template #options>
<KButtonGroup>
<!-- Margins to and bottom adds space when buttons are vertically stacked -->
<KDropdownMenu
<KButton
v-if="channelsAreInstalled"
hasDropdown
appearance="raised-button"
:text="coreString('optionsLabel')"
position="bottom left"
:options="dropdownOptions"
style="margin-top: 16px; margin-bottom: -16px;"
class="options-btn"
@select="handleSelect"
/>
:style="{ margin: '16px 8px -16px 0' }"
>
<template #menu>
<KDropdownMenu
position="bottom left"
:options="dropdownOptions"
@select="handleSelect"
/>
</template>
</KButton>
<KButton
:text="$tr('import')"
style="margin-top: 16px; margin-bottom: -16px;"
@@ -282,9 +287,4 @@
margin: auto;
}
.options-btn {
margin: 0;
margin-right: 8px;
}
</style>
16 changes: 11 additions & 5 deletions kolibri/plugins/facility/assets/src/views/UserPage/index.vue
Original file line number Diff line number Diff line change
@@ -54,13 +54,19 @@
:showDemographicInfo="true"
>
<template #action="userRow">
<KDropdownMenu
<KButton
appearance="flat-button"
hasDropdown
:text="$tr('optionsButtonLabel')"
:options="manageUserOptions(userRow.user.id)"
:disabled="!userCanBeEdited(userRow.user)"
appearance="flat-button"
@select="handleManageUserSelection($event, userRow.user)"
/>
>
<template #menu>
<KDropdownMenu
:options="manageUserOptions(userRow.user.id)"
@select="handleManageUserSelection($event, userRow.user)"
/>
</template>
</KButton>
</template>
</UserTable>
</template>

0 comments on commit 5b25e77

Please sign in to comment.