Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use the channel title for the first breadcrumb #3486

Merged
merged 2 commits into from
Aug 10, 2022
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 @@ -5,11 +5,11 @@
<VToolbar dense color="transparent" flat>
<slot name="action"></slot>
<Breadcrumbs :items="ancestors" class="mx-1 px-2 py-0">
<template #item="{ item, isLast }">
<template #item="{ item, isFirst, isLast }">
<!-- Current item -->
<VLayout v-if="isLast" align-center row>
<VFlex class="font-weight-bold text-truncate" shrink :class="getTitleClass(item)">
{{ getTitle(item) }}
{{ isFirst ? currentChannel.name : getTitle(item) }}
</VFlex>
<Menu v-if="item.displayNodeOptions">
<template #activator="{ on }">
Expand All @@ -23,7 +23,7 @@
</Menu>
</VLayout>
<span v-else class="grey--text" :class="getTitleClass(item)">
{{ getTitle(item) }}
{{ isFirst ? currentChannel.name : getTitle(item) }}
</span>
</template>
</Breadcrumbs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
name="item"
:item="item"
:index="index"
:isFirst="index === 0"
:isLast="index === breadcrumbs.length - 1"
></slot>
</VBreadcrumbsItem>
Expand Down
6 changes: 0 additions & 6 deletions contentcuration/contentcuration/viewsets/contentnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,6 @@ def retrieve_thumbail_src(item):
return None


def get_title(item):
# If it's the root, use the channel name (should be original channel name)
return item["title"] if item["parent_id"] else item["original_channel_name"]


def consolidate_extra_fields(item):
extra_fields = item.get("extra_fields")
if item["kind"] == content_kinds.EXERCISE:
Expand Down Expand Up @@ -703,7 +698,6 @@ class ContentNodeViewSet(BulkUpdateMixin, ValuesViewset):
"tags": "content_tags",
"kind": "kind__kind",
"thumbnail_src": retrieve_thumbail_src,
"title": get_title,
"parent": "parent_id",
"grade_levels": partial(dict_if_none, field_name="grade_levels"),
"resource_types": partial(dict_if_none, field_name="resource_types"),
Expand Down