Skip to content

Commit d8bb650

Browse files
remove unsupported xml file type from lightspeed (#1749)
1 parent 1401ec7 commit d8bb650

12 files changed

Lines changed: 23 additions & 30 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-lightspeed': patch
3+
---
4+
5+
Remove unsupported file type from lightspeed

workspaces/lightspeed/packages/app/e2e-tests/utils/fileUpload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import { Page, Locator, FileChooser, expect } from '@playwright/test';
1717

18-
export const supportedFileTypes = ['.txt', '.yaml', '.json', '.xml'];
18+
export const supportedFileTypes = ['.txt', '.yaml', '.json'];
1919

2020
export async function triggerFileChooser(
2121
page: Page,
@@ -83,7 +83,7 @@ export async function validateSuccessfulUpload(page: Page, fileName: string) {
8383
export async function validateFailedUpload(page: Page) {
8484
const alertHeader = page.getByText('File upload failed');
8585
const alertText = page.getByText(
86-
'Unsupported file type. Supported types are: .txt, .yaml, .json and .xml.',
86+
'Unsupported file type. Supported types are: .txt, .yaml, and .json.',
8787
);
8888

8989
await expect(alertHeader).toBeVisible();

workspaces/lightspeed/packages/app/e2e-tests/utils/testHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const sendMessage = async (
3030
waitForResponse = true,
3131
) => {
3232
const inputLocator = page.getByRole('textbox', {
33-
name: 'Send a message and optionally upload a JSON, YAML, TXT, or XML file...',
33+
name: 'Send a message and optionally upload a JSON, YAML, or TXT file...',
3434
});
3535
await inputLocator.fill(message);
3636
const sendButton = page.getByRole('button', { name: 'Send' });

workspaces/lightspeed/plugins/lightspeed/src/components/__tests__/LightspeedChat.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ describe('LightspeedChat', () => {
211211
const input = screen.getByTestId('attachment-input') as HTMLInputElement;
212212
expect(input).toHaveAttribute(
213213
'accept',
214-
'text/plain,.txt,application/json,.json,application/yaml,.yaml,.yml,application/xml,.xml',
214+
'text/plain,.txt,application/json,.json,application/yaml,.yaml,.yml',
215215
);
216216
});
217217

@@ -244,7 +244,7 @@ describe('LightspeedChat', () => {
244244

245245
expect(
246246
screen.getByText(
247-
'Unsupported file type. Supported types are: .txt, .yaml, .json and .xml.',
247+
'Unsupported file type. Supported types are: .txt, .yaml, and .json.',
248248
),
249249
).toBeInTheDocument();
250250
});

workspaces/lightspeed/plugins/lightspeed/src/const.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export const supportedFileTypes = {
3131
'text/plain': ['.txt'],
3232
'application/json': ['.json'],
3333
'application/yaml': ['.yaml', '.yml'],
34-
'application/xml': ['.xml'],
3534
};
3635

3736
export const DEFAULT_SAMPLE_PROMPTS: SamplePrompts = [

workspaces/lightspeed/plugins/lightspeed/src/translations/de.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ const lightspeedTranslationDe = createTranslationMessages({
108108
'chatbox.welcome.greeting': 'Hallo, {{userName}}',
109109
'chatbox.welcome.description': 'Wie kann ich Ihnen heute helfen?',
110110
'chatbox.message.placeholder':
111-
'Senden Sie eine Nachricht und laden Sie optional eine JSON-, YAML-, TXT- oder XML-Datei hoch...',
111+
'Senden Sie eine Nachricht und laden Sie optional eine JSON-, YAML-, oder TXT-Datei hoch...',
112112
'chatbox.fileUpload.failed': 'Datei-Upload fehlgeschlagen',
113113
'chatbox.fileUpload.infoText':
114-
'Unterstützte Dateitypen sind: .txt, .yaml, .json und .xml. Die maximale Dateigröße beträgt 25 MB.',
114+
'Unterstützte Dateitypen sind: .txt, .yaml, und .json. Die maximale Dateigröße beträgt 25 MB.',
115115

116116
// Accessibility and ARIA labels
117117
'aria.chatbotSelector': 'Chatbot-Auswahl',
@@ -154,7 +154,7 @@ const lightspeedTranslationDe = createTranslationMessages({
154154
'file.upload.error.alreadyExists': 'Die Datei existiert bereits.',
155155
'file.upload.error.multipleFiles': 'Mehr als eine Datei hochgeladen.',
156156
'file.upload.error.unsupportedType':
157-
'Nicht unterstützter Dateityp. Unterstützte Typen sind: .txt, .yaml, .json und .xml.',
157+
'Nicht unterstützter Dateityp. Unterstützte Typen sind: .txt, .yaml, und .json.',
158158
'file.upload.error.fileTooLarge':
159159
'Ihre Dateigröße ist zu groß. Bitte stellen Sie sicher, dass Ihre Datei kleiner als 25 MB ist.',
160160
'file.upload.error.readFailed':

workspaces/lightspeed/plugins/lightspeed/src/translations/es.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ const lightspeedTranslationEs = createTranslationMessages({
112112
'chatbox.welcome.greeting': 'Hola, {{userName}}',
113113
'chatbox.welcome.description': '¿Cómo puedo ayudarte hoy?',
114114
'chatbox.message.placeholder':
115-
'Envía un mensaje y opcionalmente sube un archivo JSON, YAML, TXT o XML...',
115+
'Envía un mensaje y opcionalmente sube un archivo JSON, YAML, o TXT...',
116116
'chatbox.fileUpload.failed': 'La carga del archivo falló',
117117
'chatbox.fileUpload.infoText':
118-
'Los tipos de archivo soportados son: .txt, .yaml, .json y .xml. El tamaño máximo del archivo es 25 MB.',
118+
'Los tipos de archivo soportados son: .txt, .yaml, y .json. El tamaño máximo del archivo es 25 MB.',
119119

120120
// Accessibility and ARIA labels
121121
'aria.chatbotSelector': 'Selector de chatbot',
@@ -158,7 +158,7 @@ const lightspeedTranslationEs = createTranslationMessages({
158158
'file.upload.error.alreadyExists': 'El archivo ya existe.',
159159
'file.upload.error.multipleFiles': 'Se subió más de un archivo.',
160160
'file.upload.error.unsupportedType':
161-
'Tipo de archivo no soportado. Los tipos soportados son: .txt, .yaml, .json y .xml.',
161+
'Tipo de archivo no soportado. Los tipos soportados son: .txt, .yaml, y .json.',
162162
'file.upload.error.fileTooLarge':
163163
'El tamaño de tu archivo es demasiado grande. Por favor asegúrate de que tu archivo sea menor a 25 MB.',
164164
'file.upload.error.readFailed':

workspaces/lightspeed/plugins/lightspeed/src/translations/fr.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ const lightspeedTranslationFr = createTranslationMessages({
111111
'chatbox.welcome.greeting': 'Bonjour, {{userName}}',
112112
'chatbox.welcome.description': "Comment puis-je vous aider aujourd'hui ?",
113113
'chatbox.message.placeholder':
114-
'Envoyez un message et téléchargez optionnellement un fichier JSON, YAML, TXT ou XML...',
114+
'Envoyez un message et téléchargez optionnellement un fichier JSON, YAML, ou TXT...',
115115
'chatbox.fileUpload.failed': 'Le téléchargement du fichier a échoué',
116116
'chatbox.fileUpload.infoText':
117-
'Les types de fichiers pris en charge sont : .txt, .yaml, .json et .xml. La taille maximale du fichier est de 25 Mo.',
117+
'Les types de fichiers pris en charge sont : .txt, .yaml, et .json. La taille maximale du fichier est de 25 Mo.',
118118

119119
// Accessibility and ARIA labels
120120
'aria.chatbotSelector': 'Sélecteur de chatbot',
@@ -157,7 +157,7 @@ const lightspeedTranslationFr = createTranslationMessages({
157157
'file.upload.error.alreadyExists': 'Le fichier existe déjà.',
158158
'file.upload.error.multipleFiles': "Plus d'un fichier a été téléchargé.",
159159
'file.upload.error.unsupportedType':
160-
'Type de fichier non pris en charge. Les types pris en charge sont : .txt, .yaml, .json et .xml.',
160+
'Type de fichier non pris en charge. Les types pris en charge sont : .txt, .yaml, et .json.',
161161
'file.upload.error.fileTooLarge':
162162
'La taille de votre fichier est trop importante. Veuillez vous assurer que votre fichier fait moins de 25 Mo.',
163163
'file.upload.error.readFailed':

workspaces/lightspeed/plugins/lightspeed/src/translations/ref.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ export const lightspeedMessages = {
105105
'chatbox.welcome.greeting': 'Hello, {{userName}}',
106106
'chatbox.welcome.description': 'How can I help you today?',
107107
'chatbox.message.placeholder':
108-
'Send a message and optionally upload a JSON, YAML, TXT, or XML file...',
108+
'Send a message and optionally upload a JSON, YAML, or TXT file...',
109109
'chatbox.fileUpload.failed': 'File upload failed',
110110
'chatbox.fileUpload.infoText':
111-
'Supported file types are: .txt, .yaml, .json and .xml. The maximum file size is 25 MB.',
111+
'Supported file types are: .txt, .yaml, and .json. The maximum file size is 25 MB.',
112112

113113
// Accessibility and ARIA labels
114114
'aria.chatbotSelector': 'Chatbot selector',
@@ -151,7 +151,7 @@ export const lightspeedMessages = {
151151
'file.upload.error.alreadyExists': 'File already exists.',
152152
'file.upload.error.multipleFiles': 'Uploaded more than one file.',
153153
'file.upload.error.unsupportedType':
154-
'Unsupported file type. Supported types are: .txt, .yaml, .json and .xml.',
154+
'Unsupported file type. Supported types are: .txt, .yaml, and .json.',
155155
'file.upload.error.fileTooLarge':
156156
'Your file size is too large. Please ensure that your file is less than 25 MB.',
157157
'file.upload.error.readFailed': 'Failed to read file: {{errorMessage}}',

workspaces/lightspeed/plugins/lightspeed/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export enum SupportedFileType {
8888
JSON = 'application/json',
8989
YAML = 'application/x-yaml',
9090
TEXT = 'text/plain',
91-
XML = 'text/xml',
9291
}
9392
export interface FileContent {
9493
content: string;

0 commit comments

Comments
 (0)