Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,22 @@
this.loading = true;
return this.loadChildren({
parent,
complete: true,
}).then(() => {
this.loading = false;
});
},
},
mounted() {
this.loading = true;
let params = {};
const params = {
complete: true,
};
const channelListType = this.$route.query.channel_list || ChannelListTypes.PUBLIC;
if (channelListType === ChannelListTypes.PUBLIC) {
// TODO: load from public API instead
// TODO: challenging because of node_id->id and root_id->channel_id
params = { published: true };
params.published = true;
}

return Promise.all([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ export function loadContentNodeByNodeId(context, nodeId) {
});
}

export function loadChildren(context, { parent, published = null }) {
export function loadChildren(context, { parent, published = null, complete = null }) {
const params = { parent };
if (published !== null) {
params.published = published;
}
if (complete !== null) {
params.complete = complete;
}
return loadContentNodes(context, params);
}

Expand Down
2 changes: 2 additions & 0 deletions contentcuration/contentcuration/viewsets/contentnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from django_cte import CTEQuerySet
from django_filters.rest_framework import CharFilter
from django_filters.rest_framework import UUIDFilter
from django_filters.rest_framework import BooleanFilter
from le_utils.constants import completion_criteria
from le_utils.constants import content_kinds
from le_utils.constants import roles
Expand Down Expand Up @@ -86,6 +87,7 @@ class ContentNodeFilter(RequiredFilterSet):
ancestors_of = UUIDFilter(method="filter_ancestors_of")
parent__in = UUIDInFilter(field_name="parent")
_node_id_channel_id___in = CharFilter(method="filter__node_id_channel_id")
complete = BooleanFilter(field_name="complete")

class Meta:
model = ContentNode
Expand Down