From ccaa4806fe9fea1bcb042f2915ef42747493d2a3 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Fri, 8 Mar 2024 15:18:22 +0100 Subject: [PATCH] show empty content if no AI provider was found (if task type list is empty) Signed-off-by: Julien Veyssier --- .../BeforeTemplateRenderedListener.php | 5 -- src/components/AdminSettings.vue | 3 +- .../AssistantTextProcessingForm.vue | 12 +++- src/components/NoProviderEmptyContent.vue | 69 +++++++++++++++++++ 4 files changed, 81 insertions(+), 8 deletions(-) create mode 100644 src/components/NoProviderEmptyContent.vue diff --git a/lib/Listener/BeforeTemplateRenderedListener.php b/lib/Listener/BeforeTemplateRenderedListener.php index c2da303d..2712c1c4 100644 --- a/lib/Listener/BeforeTemplateRenderedListener.php +++ b/lib/Listener/BeforeTemplateRenderedListener.php @@ -26,7 +26,6 @@ public function __construct( private IConfig $config, private IInitialState $initialStateService, private ?string $userId, - private ITextProcessingManager $textProcessingManager ) { } @@ -44,10 +43,6 @@ public function handle(Event $event): void { return; } - if (!$this->textProcessingManager->hasProviders()) { - return; - } - $adminAssistantEnabled = $this->config->getAppValue(Application::APP_ID, 'assistant_enabled', '1') === '1'; $userAssistantEnabled = $this->config->getUserValue($this->userId, Application::APP_ID, 'assistant_enabled', '1') === '1'; $assistantEnabled = $adminAssistantEnabled && $userAssistantEnabled; diff --git a/src/components/AdminSettings.vue b/src/components/AdminSettings.vue index d6efd633..a99887a8 100644 --- a/src/components/AdminSettings.vue +++ b/src/components/AdminSettings.vue @@ -11,14 +11,13 @@
{{ t('assistant', 'Top-right assistant') }}
- {{ t('assistant', 'To enable this feature, please install any AI text processing provider.') }} + {{ t('assistant', 'To be able to use this feature, please install at least one AI text processing provider.') }}
diff --git a/src/components/AssistantTextProcessingForm.vue b/src/components/AssistantTextProcessingForm.vue index 4241521a..eea73c21 100644 --- a/src/components/AssistantTextProcessingForm.vue +++ b/src/components/AssistantTextProcessingForm.vue @@ -1,5 +1,8 @@