Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
6dbbabe
sorting in channels added
GarvitSinghal47 Jan 31, 2024
b20b754
suggested changes done
GarvitSinghal47 Feb 2, 2024
5660842
icon added
GarvitSinghal47 Feb 3, 2024
933a134
Add user email to storage request
Feb 9, 2024
6a156ae
Merge branch 'unstable' of https://www.github.com/Abhishekzod007/stud…
Abhishekzod007 Feb 9, 2024
578a2c5
upgrade le-utils
Feb 21, 2024
25c0c8e
Bump es5-ext from 0.10.61 to 0.10.63
dependabot[bot] Feb 27, 2024
76a5b93
Bump dexie from 3.2.4 to 3.2.6
dependabot[bot] Mar 5, 2024
5a930e9
introduce v-model approach
EshaanAgg Mar 8, 2024
4ba2bdc
fix: remove un-necessary console.log
EshaanAgg Mar 8, 2024
c6d08bc
Add defaultWidth prop to ResizableNavigationDrawer
Abhishekzod007 Mar 10, 2024
cc2828a
Merge branch 'unstable' of https://www.github.com/Abhishekzod007/stud…
Abhishekzod007 Mar 10, 2024
6496a23
Merge pull request #4465 from learningequality/dependabot/npm_and_yar…
rtibbles Mar 12, 2024
eeaf838
Fix lint issue in ResizableNavigationDrawer
Abhishekzod007 Mar 12, 2024
5c0d00a
Merge pull request #4436 from Abhishekzod007/patch_navbarwidth
bjester Mar 12, 2024
d2f0481
Bump broadcast-channel from 5.1.0 to 7.0.0
dependabot[bot] Mar 13, 2024
012aa27
fix some tests
EshaanAgg Mar 13, 2024
7f83d52
Merge branch 'unstable' into sort-functionality
bjester Mar 13, 2024
33e8fce
Update to KIconButton
bjester Mar 13, 2024
f54a1d2
fix more tests
EshaanAgg Mar 13, 2024
4a09e3e
fix linting errors
EshaanAgg Mar 13, 2024
77245bd
Merge pull request #4423 from GarvitSinghal47/sort-functionality
bjester Mar 13, 2024
131b776
Merge pull request #4457 from learningequality/dependabot/npm_and_yar…
rtibbles Mar 16, 2024
a375742
Bump follow-redirects from 1.15.4 to 1.15.6
dependabot[bot] Mar 16, 2024
a5afa7d
Merge pull request #4474 from learningequality/dependabot/npm_and_yar…
rtibbles Mar 16, 2024
3b8c3d2
add version in name
poju3185 Mar 18, 2024
0c76f4c
fix another one
EshaanAgg Mar 18, 2024
12e0318
Bump autoprefixer from 9.8.8 to 10.4.18
dependabot[bot] Mar 20, 2024
8bf494f
Merge pull request #4476 from learningequality/dependabot/npm_and_yar…
rtibbles Mar 20, 2024
e26730d
-s
poju3185 Mar 21, 2024
9ff1313
Cleanup unused broadcast-channel dependency.
rtibbles Mar 22, 2024
8a928bb
Merge pull request #4473 from learningequality/dependabot/npm_and_yar…
rtibbles Mar 22, 2024
1c9c8d4
Bump webpack-dev-middleware from 5.3.3 to 5.3.4
dependabot[bot] Mar 22, 2024
5129510
Update migrations for le-utils upgrade.
rtibbles Mar 22, 2024
8c3d74d
Merge pull request #4483 from learningequality/dependabot/npm_and_yar…
rtibbles Mar 22, 2024
6e3be57
Merge pull request #4444 from jredrejo/upgrade_le_utils
rtibbles Mar 22, 2024
ad09968
Increase channel version when saving export database
poju3185 Mar 23, 2024
cf8b91b
Update notify_team_new_comment.yml
rtibbles Mar 25, 2024
f372bb2
Bump express from 4.18.1 to 4.19.2
dependabot[bot] Mar 25, 2024
dc3597e
fix all tests
EshaanAgg Mar 26, 2024
51f74fd
Revert "fix all tests"
EshaanAgg Mar 26, 2024
d97c203
Revert "Revert "fix all tests""
EshaanAgg Mar 26, 2024
e2c21bb
remove package-lock.json
EshaanAgg Mar 26, 2024
fd70391
revert changes in yarn.lock
EshaanAgg Mar 26, 2024
8ae3793
Merge https://github.com/learningequality/studio into mig
EshaanAgg Mar 26, 2024
fb765d2
Merge pull request #4484 from learningequality/dependabot/npm_and_yar…
rtibbles Mar 26, 2024
6cb9c0f
Bump web-streams-polyfill from 3.2.1 to 4.0.0
dependabot[bot] Mar 27, 2024
d6d9738
add support for errors to checkbox
EshaanAgg Mar 29, 2024
e793fee
fix create
EshaanAgg Mar 29, 2024
d61ed39
fix linting
EshaanAgg Mar 29, 2024
c4d590d
Merge pull request #4472 from EshaanAgg/mig
akolson Mar 29, 2024
18e0bf1
Merge pull request #4475 from poju3185/versioned-channel-db
rtibbles Mar 29, 2024
004fbe4
Update webstreams polyfill import for v4 breaking API change.
rtibbles Mar 29, 2024
48227f5
Merge pull request #4488 from learningequality/dependabot/npm_and_yar…
rtibbles Mar 29, 2024
2240a83
Allow building of postgres image when pushing to search-recommendations
bjester Apr 3, 2024
d29bb66
Merge branch 'unstable' into allow-docker-build-search-rec
bjester Apr 3, 2024
3dc0783
Reorganize migrations after unstable merge
bjester Apr 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/containerbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- unstable
- hotfixes
- master
- search-recommendations
tags:
- 'v*'
pull_request:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/notify_team_new_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
steps:
- name: Escape title double quotes
id: escape_title
run: |
title='${{ github.event.issue.title }}'
echo "ISSUE_TITLE=${title//\"/\\\"}" >> "$GITHUB_OUTPUT"
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
run: echo "ISSUE_TITLE=${ISSUE_TITLE//\"/\\\"}" >> "$GITHUB_OUTPUT"

- name: Send message to Slack channel
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
</VSlideYTransition>

<!-- Agreements -->
<Checkbox
<VCheckbox
v-model="acceptedAgreement"
:label="$tr('agreement')"
required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
v-if="isMultipleSelection"
:key="answerIdx"
:value="answerIdx"
:input-value="correctAnswersIndices"
:inputValue="correctAnswersIndices"
@change="onCorrectAnswersIndicesUpdate"
/>
</VFlex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const checkShowAnswers = wrapper => {
wrapper
.find('[data-test="showAnswersCheckbox"]')
.find('input')
.setChecked(true);
.element.click();
};

const getItems = wrapper => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
color="primary"
:data-test="`checkbox-${accessibilityItem.help}`"
>
<template #label>
<template>
<span class="text-xs-left">{{ accessibilityItem.label }}</span>
&nbsp;
<HelpTooltip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
app
style="height: calc(100% - 64px);"
:minWidth="150"
:defaultWidth="250"
:maxWidth="500"
@scroll="scroll"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,40 @@
</div>
<VSlideXTransition>
<div v-if="selected.length">
<IconButton
<KIconButton
v-if="canEdit"
icon="edit"
:text="$tr('editSelectedButton')"
data-test="edit-selected-btn"
@click="editNodes(selected)"
/>
<IconButton
<KIconButton
icon="clipboard"
:text="$tr('copySelectedButton')"
data-test="copy-selected-to-clipboard-btn"
@click="copyToClipboard(selected)"
/>
<IconButton
<KIconButton
v-if="canEdit"
icon="move"
:text="$tr('moveSelectedButton')"
data-test="move-selected-btn"
@click="openMoveModal"
/>
<IconButton
<KIconButton
v-if="canEdit"
icon="copy"
:text="$tr('duplicateSelectedButton')"
data-test="duplicate-selected-btn"
@click="duplicateNodes(selected)"
/>
<IconButton
<KIconButton
v-if="canEdit"
icon="sort"
:text="$tr('SortAlphabetically')"
@click="sortNodes(selected)"
/>
<KIconButton
v-if="canEdit"
icon="remove"
:text="$tr('deleteSelectedButton')"
Expand Down Expand Up @@ -435,6 +441,44 @@
clearSelections() {
this.selected = [];
},

sortNodes(selected) {
const selectedNodes = selected.map(id => this.getContentNode(id));
const orderedNodes = selectedNodes.sort(this.compareNodeTitles);

const reversedNodes = orderedNodes.reverse();

const nodeX = this.findNodeBeforeFirstSelected(orderedNodes, selected);

const targetParent = this.node.id;
const targetNode = nodeX || targetParent;
const targetPosition = nodeX
? RELATIVE_TREE_POSITIONS.RIGHT
: RELATIVE_TREE_POSITIONS.FIRST_CHILD;

const nodeIdsToMove = reversedNodes.map(node => String(node.id));

this.moveContentNodes({
id__in: nodeIdsToMove,
target: targetNode,
position: targetPosition,
});
},

findNodeBeforeFirstSelected(nodes, selected) {
for (let i = 1; i < nodes.length; i++) {
if (selected.includes(nodes[i])) {
return nodes[i - 1];
}
}
return null;
},

compareNodeTitles(nodeA, nodeB) {
const titleA = nodeA.title.toLowerCase();
const titleB = nodeB.title.toLowerCase();
return titleA.localeCompare(titleB);
},
updateTitleForPage() {
let detailTitle;
const topicTitle = this.getTitle(this.getContentNode(this.topicId));
Expand Down Expand Up @@ -707,6 +751,7 @@
},
$trs: {
addTopic: 'New folder',
SortAlphabetically: 'Sort alphabetically',
addExercise: 'New exercise',
uploadFiles: 'Upload files',
importFromChannels: 'Import from channels',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ describe('trashModal', () => {
wrapper.find('[data-test="item"]').trigger('click');
expect(wrapper.vm.previewNodeId).toBe(testChildren[0].id);
});
it('checking item in list should set selected', () => {
wrapper.find('[data-test="checkbox"]').vm.$emit('change', ['selected']);
expect(wrapper.vm.selected).toEqual(['selected']);
it('checking item in list should add the item ID to the selected array', () => {
wrapper
.find('[data-test="checkbox"]')
.find('input[type="checkbox"]')
.element.click();
expect(wrapper.vm.selected).toEqual(['test1']);
});
it('checking select all checkbox should check all items', () => {
wrapper.find('[data-test="selectall"]').vm.$emit('change', true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<Checkbox
v-model="selectedChannels"
color="primary"
data-test="checkbox"
:data-test="`checkbox-${channel.id}`"
:value="channel.id"
class="channel ma-0"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@ describe('channelSelectionList', () => {
});
it('should select channels when the channel has been checked', () => {
wrapper.setData({ loading: false });
wrapper.find('[data-test="checkbox"]').vm.$emit('change', [editChannel.id]);
wrapper.find(`[data-test="checkbox-${editChannel.id}"]`).element.click();

expect(wrapper.emitted('input')[0][0]).toEqual([editChannel.id]);
});
it('should deselect channels when the channel has been unchecked', () => {
wrapper.setData({ loading: false });
wrapper.find('[data-test="checkbox"]').vm.$emit('change', []);
expect(wrapper.emitted('input')[0][0]).toEqual([]);
wrapper.find(`[data-test="checkbox-${editChannel.id}"]`).element.click(); // Check the channel
wrapper.find(`[data-test="checkbox-${editChannel.id}"]`).element.click(); // Uncheck the channel

expect(wrapper.emitted('input')[0].length).toEqual(1); // Only one event should be emitted (corresponding to the initial check)
expect(wrapper.emitted('input')[0][0]).toEqual([editChannel.id]); // The initial check event should be emitted
});
it('should filter channels based on the search text', () => {
wrapper.setData({ loading: false, search: searchWord });
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
type: Number,
default: 100,
},
defaultWidth: {
type: Number,
default: 150,
},
maxWidth: {
type: Number,
default: window.innerWidth - 100,
Expand Down Expand Up @@ -68,7 +72,7 @@
const localStorageName = this.localName + '-drawer-width';
return {
dragging: false,
width: parseFloat(localStorage[localStorageName]) || this.minWidth,
width: parseFloat(localStorage[localStorageName]) || this.defaultWidth || this.minWidth,
localStorageName,
};
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,138 @@
<template>

<KCheckbox
:value="value"
:label="label"
:showLabel="showLabel"
:indeterminate="indeterminate"
:disabled="disabled"
:description="description"
:checked="isChecked"
@change="handleChange"
>
<slot></slot>
</KCheckbox>

</template>

<script>

import { VCheckbox } from 'vuetify/lib/components/VCheckbox';
import KCheckbox from 'kolibri-design-system/lib/KCheckbox';

export default {
name: 'Checkbox',
extends: VCheckbox,
components: {
KCheckbox,
},
model: {
prop: 'inputValue',
event: 'input',
},
props: {
/* eslint-disable kolibri/vue-no-unused-properties */
color: {
/*
* The label to show next to the checkbox
*/
label: {
type: String,
default: 'primary',
default: null,
},
hideDetails: {
/*
* Whether to show the label next to the checkbox
*/
showLabel: {
type: Boolean,
default: true,
},
/* eslint-enable kolibri/vue-no-unused-properties */
/*
* The value of the checkbox.
* If the checkbox is used with a v-model of array type,
* then this value would be added/removed from the array based on the checkbox state.
* If the checkbox is used with a v-model of any other type, then the v-model would
* be set to this value when the checkbox is checked and set to null when unchecked.
*/
value: {
type: [String, Number],
default: null,
},
/*
* Whether the checkbox is disabled
*/
disabled: {
type: Boolean,
default: false,
},
/*
* The description to show below the checkbox
*/
description: {
type: String,
default: null,
},
/*
* Whether the checkbox is in indeterminate state
*/
indeterminate: {
type: Boolean,
default: false,
},
/*
* The reactive state of the checkbox which is used with v-model.
* It is changed with the "input" event.
* If used as an array, "value" prop is added/removed from it based on the checkbox state.
* If used as a boolean, it is set to true when checked and false when unchecked.
* If used as any other type, it is set to "value" prop when checked and null when unchecked.
*/
inputValue: {
type: [Array, Boolean, Number, String, Object],
default: false,
},
},
computed: {
isChecked: {
get() {
if (Array.isArray(this.inputValue)) {
return this.inputValue.includes(this.value);
}

if (typeof this.inputValue === 'boolean') {
return this.inputValue;
}

return Boolean(this.inputValue);
},
set(checked) {
if (Array.isArray(this.inputValue)) {
const index = this.inputValue.indexOf(this.value);
if (checked && index === -1) {
this.updateInputValue([this.value, ...this.inputValue]);
} else if (!checked && index !== -1) {
const newInputValue = [...this.inputValue];
newInputValue.splice(index, 1);
this.updateInputValue(newInputValue);
}
return;
}

if (typeof this.inputValue === 'boolean') {
this.updateInputValue(checked);
return;
}

if (checked) {
this.updateInputValue(this.value);
} else {
this.updateInputValue(null);
}
},
},
},
methods: {
handleChange(checked) {
this.isChecked = checked;
},
updateInputValue(newValue) {
this.$emit('input', newValue);
},
},
};

Expand All @@ -29,4 +146,4 @@
color: var(--v-text);
}

</style>
</style>
Loading