Skip to content

Commit 1efcbef

Browse files
committed
feat(declarativeui): use relative URLs only, icon is a URL to the icon file
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 parent 8feaa1a commit 1efcbef

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

lib/Capabilities.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,14 @@ public function getCapabilities(): array {
9696
'fileId' => '123456789',
9797
'taskTypeId' => TextToTextSummary::ID,
9898
]);
99+
$url = str_replace($this->urlGenerator->getBaseUrl(), '', $url);
99100
$url = str_replace('123456789', '{fileId}', $url);
100101
$endpoint = [
101102
'name' => $this->l->t('Summarize'),
102103
'url' => $url,
103104
'method' => 'POST',
104105
'mimetype_filters' => implode(', ', $textMimeTypes),
105-
'android_icon' => 'creation',
106-
'ios_icon' => 'creation',
107-
'desktop_icon' => 'creation',
106+
'icon' => $this->urlGenerator->imagePath(Application::APP_ID, 'declarativeui/summarize.svg'),
108107
];
109108
$capabilities['declarativeui'][Application::APP_ID]['context-menu'][] = $endpoint;
110109
}
@@ -115,15 +114,14 @@ public function getCapabilities(): array {
115114
'fileId' => '123456789',
116115
'taskTypeId' => \OCP\TaskProcessing\TaskTypes\TextToSpeech::ID,
117116
]);
117+
$url = str_replace($this->urlGenerator->getBaseUrl(), '', $url);
118118
$url = str_replace('123456789', '{fileId}', $url);
119119
$endpoint = [
120120
'name' => $this->l->t('Transcribe audio'),
121121
'url' => $url,
122122
'method' => 'POST',
123123
'mimetype_filters' => 'audio/',
124-
'android_icon' => 'speech_to_text',
125-
'ios_icon' => 'speech_to_text',
126-
'desktop_icon' => 'speech_to_text',
124+
'icon' => $this->urlGenerator->imagePath(Application::APP_ID, 'declarativeui/speech_to_text.svg'),
127125
];
128126
$capabilities['declarativeui'][Application::APP_ID]['context-menu'][] = $endpoint;
129127
}
@@ -134,15 +132,14 @@ public function getCapabilities(): array {
134132
'fileId' => '123456789',
135133
'taskTypeId' => AudioToText::ID,
136134
]);
135+
$url = str_replace($this->urlGenerator->getBaseUrl(), '', $url);
137136
$url = str_replace('123456789', '{fileId}', $url);
138137
$endpoint = [
139138
'name' => $this->l->t('Text to speech'),
140139
'url' => $url,
141140
'method' => 'POST',
142141
'mimetype_filters' => implode(', ', $textMimeTypes),
143-
'android_icon' => 'text_to_speech',
144-
'ios_icon' => 'text_to_speech',
145-
'desktop_icon' => 'text_to_speech',
142+
'icon' => $this->urlGenerator->imagePath(Application::APP_ID, 'declarativeui/text_to_speech.svg'),
146143
];
147144
$capabilities['declarativeui'][Application::APP_ID]['context-menu'][] = $endpoint;
148145
}

0 commit comments

Comments
 (0)