Skip to content

Commit

Permalink
Fix Admin AI settings javascript error
Browse files Browse the repository at this point in the history
make sure all task types we want to display actually exist

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Oct 23, 2023
1 parent dc19882 commit 0567edf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/settings/src/components/AdminAI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</NcSettingsSection>
<NcSettingsSection :title="t('settings', 'Text processing')"
:description="t('settings', 'Text processing tasks can be implemented by different apps. Here you can set which app should be used for which task.')">
<template v-for="type in Object.keys(settings['ai.textprocessing_provider_preferences'])">
<template v-for="type in tpTaskTypes">
<div :key="type">
<h3>{{ t('settings', 'Task:') }} {{ getTaskType(type).name }}</h3>
<p>{{ getTaskType(type).description }}</p>
Expand Down Expand Up @@ -110,6 +110,9 @@ export default {
hasTextProcessing() {
return Object.keys(this.settings['ai.textprocessing_provider_preferences']).length > 0 && Array.isArray(this.textProcessingTaskTypes)
},
tpTaskTypes() {
return Object.keys(this.settings['ai.textprocessing_provider_preferences']).filter(type => !!this.getTaskType(type))
},
},
methods: {
moveUp(i) {
Expand Down

0 comments on commit 0567edf

Please sign in to comment.