Skip to content

Commit

Permalink
Merge pull request #7471 from learningequality/release-v0.14.x
Browse files Browse the repository at this point in the history
0.14 -> develop
  • Loading branch information
indirectlylit committed Aug 12, 2020
2 parents 45c0723 + ac82251 commit 4364fb0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ export default {
getRecipientNamesForLesson(state) {
return function(lesson) {
const fullLesson = state.lessonMap[lesson.id];
if (!fullLesson) {
return [];
}
const recipientsForGroups = fullLesson.groups.length
? this.getLearnersForGroups(fullLesson.groups)
: [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export default {
},
REMOVE_FROM_WORKING_RESOURCES(state, resources) {
state.workingResources = state.workingResources.filter(
workingResource => !resources.find(r => r.id === workingResource.contentnode_id)
// Resources could either be a content node or a resource item from a lesson
workingResource =>
!resources.find(r => (r.id || r.contentnode_id) === workingResource.contentnode_id)
);
},
ADD_TO_RESOURCE_CACHE(state, { node, channelTitle }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
computed: {
...mapState('classSummary', ['examMap', 'lessonMap']),
exam() {
return this.examMap[this.$route.params.quizId];
return this.examMap[this.$route.params.quizId] || {};
},
lesson() {
return this.lessonMap[this.$route.params.lessonId];
return this.lessonMap[this.$route.params.lessonId] || {};
},
resource() {
return this.examOrLesson === 'lesson' ? this.lesson : this.exam;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
saveResources() {
return this.saveLessonResources({
lessonId: this.lessonId,
resourceIds: this.workingResources,
resources: this.workingResources,
});
},
selectionMetadata(content) {
Expand All @@ -357,7 +357,7 @@
if (checked) {
this.addToSelectedResources(content);
} else {
this.removeFromSelectedResources(content);
this.removeFromSelectedResources([content]);
}
},
handleSearchTerm(searchTerm) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<KButton
:text="coreString('removeAction')"
appearance="flat-button"
@click="removeResource(resource.contentnode_id)"
@click="removeResource(resource)"
/>
</KFixedGridItem>
</KFixedGrid>
Expand Down Expand Up @@ -141,9 +141,9 @@
resourceKind(resourceId) {
return this.resourceContentNodes[resourceId].kind;
},
removeResource(resourceId) {
this.firstRemovalTitle = this.resourceTitle(resourceId);
this.removeFromWorkingResources(resourceId);
removeResource(resource) {
this.firstRemovalTitle = this.resourceTitle(resource.contentnode_id);
this.removeFromWorkingResources([resource]);
this.autoSave(this.lessonId, this.workingResources);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@
}),
computed: {
cardColumnSpan() {
if (this.windowBreakpoint <= 1) return 4;
if (this.windowBreakpoint === 2) return 8;
if (this.windowBreakpoint <= 4) return 6;
if (this.windowBreakpoint <= 2) return 4;
if (this.windowBreakpoint <= 3) return 6;
if (this.windowBreakpoint <= 6) return 4;
return 3;
},
Expand Down
6 changes: 2 additions & 4 deletions kolibri/plugins/learn/assets/src/views/LearnIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,8 @@
maxWidth() {
// ref: https://www.figma.com/file/zbxBoJUUkOynZtgK0wO9KD/Channel-descriptions?node-id=281%3A1270
if (this.pageName !== PageNames.TOPICS_ROOT) return undefined;
if (this.windowBreakpoint <= 2) return 400;
if (this.windowBreakpoint <= 4) return 800;
if (this.windowBreakpoint <= 6) return 1200;
return 1600;
if (this.windowBreakpoint <= 1) return 400;
return 1800;
},
profileNeedsUpdate() {
return (
Expand Down
5 changes: 3 additions & 2 deletions kolibri/utils/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,14 @@ def is_debian_package():
try:
check_output(["apt-cache", "show", "kolibri"])
apt_repo = str(check_output(["apt-cache", "madison", "kolibri"]))
if apt_repo:
if len(apt_repo) > 4: # repo will have at least http
install_type = "apt"
except (
CalledProcessError,
FileNotFoundError,
): # kolibri package not installed!
install_type = "whl"
if sys.path[-1] != "/usr/lib/python3/dist-packages":
install_type = "whl"
return install_type

def is_kolibri_server():
Expand Down

0 comments on commit 4364fb0

Please sign in to comment.