Skip to content

Commit

Permalink
UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akolson committed Dec 9, 2024
1 parent 596e109 commit 7574c06
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<KCard
:title="node.title"
:headingLevel="2"
:headingLevel="1"
thumbnailScaleType="contain"
thumbnailDisplay="small"
thumbnailAlign="right"
Expand All @@ -15,7 +15,7 @@
:inputValue="isSelected(node)"
@input="toggleSelected(node)"
>
<span class="visuallyhidden">Select '{{ node.title }}'</span>
<span class="visuallyhidden">{{ $tr('selectCard', { title: node.title }) }}</span>
</Checkbox>
</template>
<template #aboveTitle>
Expand Down Expand Up @@ -94,6 +94,9 @@
this.$emit('preview', this.node);
},
},
$trs: {
selectCard: 'Select { title }',
},
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
ref="contentTreeList"
:topicNode="topicNode"
:selected.sync="selected"
:topicId="$route.params.nodeId"
:topicId="topicId"
@preview="preview($event)"
@change_selected="handleChangeSelected"
@copy_to_clipboard="handleCopyToClipboard"
Expand All @@ -94,7 +94,7 @@
:layout4="{ span: 4 }"
>
<h3 class="pb-2 pt-0 px-2">
{{ resourcesMightBeRelevantTitle$({ topic: 'Basic Addition' }) }}
{{ recommendationsSectionTitle }}
</h3>
<div class="my-3 px-2">
<ActionLink
Expand Down Expand Up @@ -205,6 +205,7 @@
resourcesMightBeRelevantTitle$,
problemShowingResourcesMessage$,
aboutRecommendationsDescription$,
resourcesInChannelMightBeRelevantTitle$,
aboutRecommendationsFeedbackDescription$,
} = searchRecommendationsStrings;
Expand All @@ -224,6 +225,7 @@
resourcesMightBeRelevantTitle$,
problemShowingResourcesMessage$,
aboutRecommendationsDescription$,
resourcesInChannelMightBeRelevantTitle$,
aboutRecommendationsFeedbackDescription$,
layoutFitsTwoColumns,
};
Expand All @@ -235,6 +237,7 @@
copyNode: null,
languageFromChannelList: null,
showSavedSearches: false,
importDestination: '',
showAboutRecommendations: false,
recommendations: [],
otherRecommendations: [],
Expand All @@ -253,6 +256,7 @@
computed: {
...mapGetters('importFromChannels', ['savedSearchesExist']),
...mapGetters(['isAIFeatureEnabled']),
...mapGetters('contentNode', ['getContentNodeAncestors']),
...mapState('importFromChannels', ['selected']),
...mapState('currentChannel', ['currentChannelId']),
isBrowsing() {
Expand Down Expand Up @@ -317,6 +321,24 @@
width: this.isAIFeatureEnabled ? '1200px' : '800px',
};
},
firstAncestor() {
const ancestors = this.getContentNodeAncestors(this.topicId, true);
return ancestors?.[0] ?? null;
},
topicId() {
return this.$route.params.nodeId;
},
recommendationsSectionTitle() {
if (this.firstAncestor) {
return this.resourcesInChannelMightBeRelevantTitle$({
channelName: this.firstAncestor?.title,
topic: this.importDestination,
});
}
return this.resourcesMightBeRelevantTitle$({
topic: this.importDestination,
});
},
},
beforeRouteEnter(to, from, next) {
next(vm => {
Expand All @@ -339,11 +361,14 @@
mounted() {
this.searchTerm = this.$route.params.searchTerm || '';
this.loadRecommendations();
this.loadContentNode(this.$route.params.destNodeId).then(node => {
this.importDestination = node?.title || '';
});
},
methods: {
...mapActions('channel', ['loadChannel']),
...mapActions('clipboard', ['copy']),
...mapActions('contentNode', ['loadPublicContentNode']),
...mapActions('contentNode', ['loadContentNode', 'loadPublicContentNode']),
...mapActions('importFromChannels', ['fetchResourceSearchResults']),
...mapMutations('importFromChannels', {
selectNodes: 'SELECT_NODES',
Expand Down

0 comments on commit 7574c06

Please sign in to comment.