@red-hat-developer-hub/backstage-plugin-intelligent-assistant 3.1.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/README.md +10 -7
  3. package/config.d.ts +42 -13
  4. package/dist/alpha.d.ts +22 -7
  5. package/dist/api/NotebooksApiClient.esm.js +10 -0
  6. package/dist/api/NotebooksApiClient.esm.js.map +1 -1
  7. package/dist/api/notebooksApi.esm.js.map +1 -1
  8. package/dist/components/LightSpeedChat.esm.js +55 -53
  9. package/dist/components/LightSpeedChat.esm.js.map +1 -1
  10. package/dist/components/LightspeedChatContainer.esm.js +7 -5
  11. package/dist/components/LightspeedChatContainer.esm.js.map +1 -1
  12. package/dist/components/LightspeedDrawerContext.esm.js.map +1 -1
  13. package/dist/components/McpServersSettings.esm.js +4 -3
  14. package/dist/components/McpServersSettings.esm.js.map +1 -1
  15. package/dist/components/MessageBarModelSelector.esm.js +16 -5
  16. package/dist/components/MessageBarModelSelector.esm.js.map +1 -1
  17. package/dist/components/mcpServersDisplayUtils.esm.js.map +1 -1
  18. package/dist/components/notebooks/AddDocumentModal.esm.js +181 -66
  19. package/dist/components/notebooks/AddDocumentModal.esm.js.map +1 -1
  20. package/dist/components/notebooks/DocumentSidebar.esm.js +258 -27
  21. package/dist/components/notebooks/DocumentSidebar.esm.js.map +1 -1
  22. package/dist/components/notebooks/FileListItem.esm.js +15 -9
  23. package/dist/components/notebooks/FileListItem.esm.js.map +1 -1
  24. package/dist/components/notebooks/NotebookCard.esm.js +71 -14
  25. package/dist/components/notebooks/NotebookCard.esm.js.map +1 -1
  26. package/dist/components/notebooks/NotebookView.esm.js +202 -42
  27. package/dist/components/notebooks/NotebookView.esm.js.map +1 -1
  28. package/dist/components/notebooks/NotebooksTab.esm.js.map +1 -1
  29. package/dist/components/notebooks/OverwriteConfirmModal.esm.js +122 -42
  30. package/dist/components/notebooks/OverwriteConfirmModal.esm.js.map +1 -1
  31. package/dist/components/notebooks/UploadResourceScreen.esm.js +0 -1
  32. package/dist/components/notebooks/UploadResourceScreen.esm.js.map +1 -1
  33. package/dist/const.esm.js +2 -1
  34. package/dist/const.esm.js.map +1 -1
  35. package/dist/hooks/notebooks/useInlineEdit.esm.js +60 -0
  36. package/dist/hooks/notebooks/useInlineEdit.esm.js.map +1 -0
  37. package/dist/hooks/notebooks/useLightspeedNotebooksPermission.esm.js +4 -3
  38. package/dist/hooks/notebooks/useLightspeedNotebooksPermission.esm.js.map +1 -1
  39. package/dist/hooks/notebooks/useRenameDocument.esm.js +50 -0
  40. package/dist/hooks/notebooks/useRenameDocument.esm.js.map +1 -0
  41. package/dist/hooks/notebooks/useRenameNotebook.esm.js +48 -1
  42. package/dist/hooks/notebooks/useRenameNotebook.esm.js.map +1 -1
  43. package/dist/hooks/notebooks/useRenameNotebookWithAlert.esm.js +34 -0
  44. package/dist/hooks/notebooks/useRenameNotebookWithAlert.esm.js.map +1 -0
  45. package/dist/hooks/useLightspeedDeletePermission.esm.js +2 -2
  46. package/dist/hooks/useLightspeedDeletePermission.esm.js.map +1 -1
  47. package/dist/hooks/useLightspeedUpdatePermission.esm.js +2 -2
  48. package/dist/hooks/useLightspeedUpdatePermission.esm.js.map +1 -1
  49. package/dist/hooks/useLightspeedViewPermission.esm.js +6 -4
  50. package/dist/hooks/useLightspeedViewPermission.esm.js.map +1 -1
  51. package/dist/translations/de.esm.js +32 -17
  52. package/dist/translations/de.esm.js.map +1 -1
  53. package/dist/translations/es.esm.js +32 -17
  54. package/dist/translations/es.esm.js.map +1 -1
  55. package/dist/translations/fr.esm.js +32 -17
  56. package/dist/translations/fr.esm.js.map +1 -1
  57. package/dist/translations/it.esm.js +32 -17
  58. package/dist/translations/it.esm.js.map +1 -1
  59. package/dist/translations/ja.esm.js +32 -17
  60. package/dist/translations/ja.esm.js.map +1 -1
  61. package/dist/translations/ref.esm.js +34 -18
  62. package/dist/translations/ref.esm.js.map +1 -1
  63. package/dist/types.esm.js.map +1 -1
  64. package/dist/utils/lightspeed-chatbox-utils.esm.js.map +1 -1
  65. package/dist/utils/notebook-upload-runner.esm.js +16 -0
  66. package/dist/utils/notebook-upload-runner.esm.js.map +1 -0
  67. package/package.json +5 -4
  68. package/dist/components/notebooks/RenameNotebookModal.esm.js +0 -187
  69. package/dist/components/notebooks/RenameNotebookModal.esm.js.map +0 -1
package/dist/const.esm.js CHANGED
@@ -10,6 +10,7 @@ const supportedFileTypes = {
10
10
  };
11
11
  const NOTEBOOK_MAX_FILES = 10;
12
12
  const NOTEBOOK_MAX_FILE_SIZE_BYTES = 25 * 1024 * 1024;
13
+ const NOTEBOOK_MAX_TITLE_LENGTH = 255;
13
14
  const UNTITLED_NOTEBOOK_NAME = "Untitled Notebook";
14
15
  const NOTEBOOK_ALLOWED_EXTENSIONS = {
15
16
  "text/plain": [".txt", ".log"],
@@ -70,5 +71,5 @@ const DOCKED_CONTENT_OFFSET = "calc(var(--docked-drawer-width, 500px) + 1.5em)";
70
71
  const LIGHTSPEED_PATH = "/intelligent-assistant";
71
72
  const LIGHTSPEED_LEGACY_PATH = "/lightspeed";
72
73
 
73
- export { DEFAULT_SAMPLE_PROMPTS, DOCKED_CONTENT_OFFSET, LIGHTSPEED_APP_DRAWER_ID, LIGHTSPEED_LEGACY_PATH, LIGHTSPEED_PATH, NOTEBOOK_ALLOWED_EXTENSIONS, NOTEBOOK_EXTENSION_TO_FILE_TYPE, NOTEBOOK_MAX_FILES, NOTEBOOK_MAX_FILE_SIZE_BYTES, NOTEBOOK_PROMPT_KEYS, RHDH_SAMPLE_PROMPTS, TEMP_CONVERSATION_ID, UNTITLED_NOTEBOOK_NAME, VALID_TOPIC_RESTRICTION_PROVIDER_IDS, supportedFileTypes };
74
+ export { DEFAULT_SAMPLE_PROMPTS, DOCKED_CONTENT_OFFSET, LIGHTSPEED_APP_DRAWER_ID, LIGHTSPEED_LEGACY_PATH, LIGHTSPEED_PATH, NOTEBOOK_ALLOWED_EXTENSIONS, NOTEBOOK_EXTENSION_TO_FILE_TYPE, NOTEBOOK_MAX_FILES, NOTEBOOK_MAX_FILE_SIZE_BYTES, NOTEBOOK_MAX_TITLE_LENGTH, NOTEBOOK_PROMPT_KEYS, RHDH_SAMPLE_PROMPTS, TEMP_CONVERSATION_ID, UNTITLED_NOTEBOOK_NAME, VALID_TOPIC_RESTRICTION_PROVIDER_IDS, supportedFileTypes };
74
75
  //# sourceMappingURL=const.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"const.esm.js","sources":["../src/const.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SamplePrompts } from './types';\n\nexport const TEMP_CONVERSATION_ID = 'temp-conversation-id';\n\nexport const LIGHTSPEED_APP_DRAWER_ID = 'intelligent-assistant';\n\n// Translation keys for disclaimers\nexport const FUNCTION_DISCLAIMER_WITHOUT_QUESTION_VALIDATION_KEY =\n 'disclaimer.withoutValidation';\nexport const FUNCTION_DISCLAIMER_KEY = 'disclaimer.withValidation';\n\nconst createPrompt = (titleKey: string, messageKey: string) => {\n return { titleKey, messageKey };\n};\n\nexport const supportedFileTypes = {\n 'text/plain': ['.txt'],\n 'application/json': ['.json'],\n 'application/yaml': ['.yaml', '.yml'],\n};\n\nexport const NOTEBOOK_MAX_FILES = 10;\nexport const NOTEBOOK_MAX_FILE_SIZE_BYTES = 25 * 1024 * 1024; // 25 MB\nexport const UNTITLED_NOTEBOOK_NAME = 'Untitled Notebook';\n\nexport const NOTEBOOK_ALLOWED_EXTENSIONS: Record<string, string[]> = {\n 'text/plain': ['.txt', '.log'],\n 'text/markdown': ['.md'],\n 'application/pdf': ['.pdf'],\n 'application/json': ['.json'],\n 'application/x-yaml': ['.yaml', '.yml'],\n};\n\nexport const NOTEBOOK_EXTENSION_TO_FILE_TYPE: Record<string, string> = {\n '.txt': 'txt',\n '.md': 'md',\n '.pdf': 'pdf',\n '.json': 'json',\n '.yaml': 'yaml',\n '.yml': 'yaml',\n '.log': 'log',\n};\n\nexport const DEFAULT_SAMPLE_PROMPTS: SamplePrompts = [\n createPrompt(\n 'prompts.codeReadability.title',\n 'prompts.codeReadability.message',\n ),\n createPrompt('prompts.debugging.title', 'prompts.debugging.message'),\n createPrompt(\n 'prompts.developmentConcept.title',\n 'prompts.developmentConcept.message',\n ),\n createPrompt(\n 'prompts.codeOptimization.title',\n 'prompts.codeOptimization.message',\n ),\n createPrompt('prompts.documentation.title', 'prompts.documentation.message'),\n createPrompt('prompts.gitWorkflows.title', 'prompts.gitWorkflows.message'),\n createPrompt(\n 'prompts.testingStrategies.title',\n 'prompts.testingStrategies.message',\n ),\n createPrompt(\n 'prompts.sortingAlgorithms.title',\n 'prompts.sortingAlgorithms.message',\n ),\n createPrompt('prompts.eventDriven.title', 'prompts.eventDriven.message'),\n];\n\nexport const RHDH_SAMPLE_PROMPTS: SamplePrompts = [\n createPrompt('prompts.tekton.title', 'prompts.tekton.message'),\n createPrompt('prompts.openshift.title', 'prompts.openshift.message'),\n createPrompt('prompts.rhdh.title', 'prompts.rhdh.message'),\n];\n\nexport const NOTEBOOK_PROMPT_KEYS: string[] = [\n 'notebooks.prompts.coreConcepts.title',\n 'notebooks.prompts.vulnerabilities.title',\n 'notebooks.prompts.accessIssue.title',\n];\n\n// Topic restriction valid provider IDs\nexport const VALID_TOPIC_RESTRICTION_PROVIDER_IDS = [\n 'lightspeed_question_validity-shield',\n];\n\n// Matches app shell margin on main when ApplicationDrawer is docked (e.g. Root.tsx).\nexport const DOCKED_CONTENT_OFFSET =\n 'calc(var(--docked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AAAA,IACA;AAAA,GACF;AAAA,EACA,YAAA;AAAA,IACE,gCAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,YAAA,CAAa,+BAA+B,+BAA+B,CAAA;AAAA,EAC3E,YAAA,CAAa,8BAA8B,8BAA8B,CAAA;AAAA,EACzE,YAAA;AAAA,IACE,iCAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,YAAA;AAAA,IACE,iCAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,YAAA,CAAa,6BAA6B,6BAA6B;AACzE;AAEO,MAAM,mBAAA,GAAqC;AAAA,EAChD,YAAA,CAAa,wBAAwB,wBAAwB,CAAA;AAAA,EAC7D,YAAA,CAAa,2BAA2B,2BAA2B,CAAA;AAAA,EACnE,YAAA,CAAa,sBAAsB,sBAAsB;AAC3D;AAEO,MAAM,oBAAA,GAAiC;AAAA,EAC5C,sCAAA;AAAA,EACA,yCAAA;AAAA,EACA;AACF;AAGO,MAAM,oCAAA,GAAuC;AAAA,EAClD;AACF;AAGO,MAAM,qBAAA,GACX;AAEK,MAAM,eAAA,GAAkB;AACxB,MAAM,sBAAA,GAAyB;;;;"}
1
+ {"version":3,"file":"const.esm.js","sources":["../src/const.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SamplePrompts } from './types';\n\nexport const TEMP_CONVERSATION_ID = 'temp-conversation-id';\n\nexport const LIGHTSPEED_APP_DRAWER_ID = 'intelligent-assistant';\n\n// Translation keys for disclaimers\nexport const FUNCTION_DISCLAIMER_WITHOUT_QUESTION_VALIDATION_KEY =\n 'disclaimer.withoutValidation';\nexport const FUNCTION_DISCLAIMER_KEY = 'disclaimer.withValidation';\n\nconst createPrompt = (titleKey: string, messageKey: string) => {\n return { titleKey, messageKey };\n};\n\nexport const supportedFileTypes = {\n 'text/plain': ['.txt'],\n 'application/json': ['.json'],\n 'application/yaml': ['.yaml', '.yml'],\n};\n\nexport const NOTEBOOK_MAX_FILES = 10;\nexport const NOTEBOOK_MAX_FILE_SIZE_BYTES = 25 * 1024 * 1024; // 25 MB\nexport const NOTEBOOK_MAX_TITLE_LENGTH = 255;\nexport const UNTITLED_NOTEBOOK_NAME = 'Untitled Notebook';\n\nexport const NOTEBOOK_ALLOWED_EXTENSIONS: Record<string, string[]> = {\n 'text/plain': ['.txt', '.log'],\n 'text/markdown': ['.md'],\n 'application/pdf': ['.pdf'],\n 'application/json': ['.json'],\n 'application/x-yaml': ['.yaml', '.yml'],\n};\n\nexport const NOTEBOOK_EXTENSION_TO_FILE_TYPE: Record<string, string> = {\n '.txt': 'txt',\n '.md': 'md',\n '.pdf': 'pdf',\n '.json': 'json',\n '.yaml': 'yaml',\n '.yml': 'yaml',\n '.log': 'log',\n};\n\nexport const DEFAULT_SAMPLE_PROMPTS: SamplePrompts = [\n createPrompt(\n 'prompts.codeReadability.title',\n 'prompts.codeReadability.message',\n ),\n createPrompt('prompts.debugging.title', 'prompts.debugging.message'),\n createPrompt(\n 'prompts.developmentConcept.title',\n 'prompts.developmentConcept.message',\n ),\n createPrompt(\n 'prompts.codeOptimization.title',\n 'prompts.codeOptimization.message',\n ),\n createPrompt('prompts.documentation.title', 'prompts.documentation.message'),\n createPrompt('prompts.gitWorkflows.title', 'prompts.gitWorkflows.message'),\n createPrompt(\n 'prompts.testingStrategies.title',\n 'prompts.testingStrategies.message',\n ),\n createPrompt(\n 'prompts.sortingAlgorithms.title',\n 'prompts.sortingAlgorithms.message',\n ),\n createPrompt('prompts.eventDriven.title', 'prompts.eventDriven.message'),\n];\n\nexport const RHDH_SAMPLE_PROMPTS: SamplePrompts = [\n createPrompt('prompts.tekton.title', 'prompts.tekton.message'),\n createPrompt('prompts.openshift.title', 'prompts.openshift.message'),\n createPrompt('prompts.rhdh.title', 'prompts.rhdh.message'),\n];\n\nexport const NOTEBOOK_PROMPT_KEYS: string[] = [\n 'notebooks.prompts.coreConcepts.title',\n 'notebooks.prompts.vulnerabilities.title',\n 'notebooks.prompts.accessIssue.title',\n];\n\n// Topic restriction valid provider IDs\nexport const VALID_TOPIC_RESTRICTION_PROVIDER_IDS = [\n 'lightspeed_question_validity-shield',\n];\n\n// Matches app shell margin on main when ApplicationDrawer is docked (e.g. Root.tsx).\nexport const DOCKED_CONTENT_OFFSET =\n 'calc(var(--docked-drawer-width, 500px) + 1.5em)';\n\nexport const LIGHTSPEED_PATH = '/intelligent-assistant';\nexport const LIGHTSPEED_LEGACY_PATH = '/lightspeed';\n"],"names":[],"mappings":"AAkBO,MAAM,oBAAA,GAAuB;AAE7B,MAAM,wBAAA,GAA2B;AAOxC,MAAM,YAAA,GAAe,CAAC,QAAA,EAAkB,UAAA,KAAuB;AAC7D,EAAA,OAAO,EAAE,UAAU,UAAA,EAAW;AAChC,CAAA;AAEO,MAAM,kBAAA,GAAqB;AAAA,EAChC,YAAA,EAAc,CAAC,MAAM,CAAA;AAAA,EACrB,kBAAA,EAAoB,CAAC,OAAO,CAAA;AAAA,EAC5B,kBAAA,EAAoB,CAAC,OAAA,EAAS,MAAM;AACtC;AAEO,MAAM,kBAAA,GAAqB;AAC3B,MAAM,4BAAA,GAA+B,KAAK,IAAA,GAAO;AACjD,MAAM,yBAAA,GAA4B;AAClC,MAAM,sBAAA,GAAyB;AAE/B,MAAM,2BAAA,GAAwD;AAAA,EACnE,YAAA,EAAc,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,EAC7B,eAAA,EAAiB,CAAC,KAAK,CAAA;AAAA,EACvB,iBAAA,EAAmB,CAAC,MAAM,CAAA;AAAA,EAC1B,kBAAA,EAAoB,CAAC,OAAO,CAAA;AAAA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dit = ({
4
+ currentName,
5
+ onSave,
6
+ onStart
7
+ }) => {
8
+ const [isEditing, setIsEditing] = useState(false);
9
+ const [editValue, setEditValue] = useState("");
10
+ const inputRef = useRef(null);
11
+ const startEditing = useCallback(() => {
12
+ setIsEditing(true);
13
+ setEditValue(currentName);
14
+ onStart?.();
15
+ }, [currentName, onStart]);
16
+ useEffect(() => {
17
+ if (isEditing) {
18
+ inputRef.current?.focus();
19
+ inputRef.current?.select();
20
+ }
21
+ }, [isEditing]);
22
+ const cancelEditing = useCallback(() => {
23
+ setIsEditing(false);
24
+ setEditValue("");
25
+ }, []);
26
+ const save = useCallback(() => {
27
+ const trimmed = editValue.trim();
28
+ if (!trimmed || trimmed === currentName) {
29
+ cancelEditing();
30
+ return;
31
+ }
32
+ onSave(trimmed);
33
+ cancelEditing();
34
+ }, [editValue, currentName, onSave, cancelEditing]);
35
+ const handleKeyDown = useCallback(
36
+ (event) => {
37
+ if (event.key === "Enter") {
38
+ event.preventDefault();
39
+ save();
40
+ } else if (event.key === "Escape") {
41
+ event.preventDefault();
42
+ cancelEditing();
43
+ }
44
+ },
45
+ [save, cancelEditing]
46
+ );
47
+ return {
48
+ isEditing,
49
+ editValue,
50
+ setEditValue,
51
+ inputRef,
52
+ startEditing,
53
+ cancelEditing,
54
+ save,
55
+ handleKeyDown
56
+ };
57
+ };
58
+
59
+ export { useInlineEdit };
60
+ //# sourceMappingURL=useInlineEdit.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInlineEdit.esm.js","sources":["../../../src/hooks/notebooks/useInlineEdit.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\ntype UseInlineEditOptions = {\n currentName: string;\n onSave: (newName: string) => void;\n onStart?: () => void;\n};\n\nexport const useInlineEdit = ({\n currentName,\n onSave,\n onStart,\n}: UseInlineEditOptions) => {\n const [isEditing, setIsEditing] = useState(false);\n const [editValue, setEditValue] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const startEditing = useCallback(() => {\n setIsEditing(true);\n setEditValue(currentName);\n onStart?.();\n }, [currentName, onStart]);\n\n useEffect(() => {\n if (isEditing) {\n inputRef.current?.focus();\n inputRef.current?.select();\n }\n }, [isEditing]);\n\n const cancelEditing = useCallback(() => {\n setIsEditing(false);\n setEditValue('');\n }, []);\n\n const save = useCallback(() => {\n const trimmed = editValue.trim();\n if (!trimmed || trimmed === currentName) {\n cancelEditing();\n return;\n }\n onSave(trimmed);\n cancelEditing();\n }, [editValue, currentName, onSave, cancelEditing]);\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n save();\n } else if (event.key === 'Escape') {\n event.preventDefault();\n cancelEditing();\n }\n },\n [save, cancelEditing],\n );\n\n return {\n isEditing,\n editValue,\n setEditValue,\n inputRef,\n startEditing,\n cancelEditing,\n save,\n handleKeyDown,\n };\n};\n"],"names":[],"mappings":";;AAwBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,WAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAA4B;AAC1B,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAChD,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,EAAE,CAAA;AAC7C,EAAA,MAAM,QAAA,GAAW,OAAyB,IAAI,CAAA;AAE9C,EAAA,MAAM,YAAA,GAAe,YAAY,MAAM;AACrC,IAAA,YAAA,CAAa,IAAI,C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IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAA;AAAA,IACA,aAAA;AAAA,IACA,IAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1,13 +1,14 @@
1
1
  import { usePermission } from '@backstage/plugin-permission-react';
2
- import { lightspeedNotebooksUsePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';
2
+ import { iaNotebooksUsePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';
3
3
 
4
4
  const useLightspeedNotebooksPermission = () => {
5
5
  const result = usePermission({
6
- permission: lightspeedNotebooksUsePermission
6
+ permission: iaNotebooksUsePermission
7
7
  });
8
8
  return {
9
9
  loading: result.loading,
10
- allowed: result.allowed
10
+ allowed: result.allowed,
11
+ iaNotebooksUsePermissionName: iaNotebooksUsePermission.name
11
12
  };
12
13
  };
13
14
 
@@ -1 +1 @@
1
- {"version":3,"file":"useLightspeedNotebooksPermission.esm.js","sources":["../../../src/hooks/notebooks/useLightspeedNotebooksPermission.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nimport { lightspeedNotebooksUsePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';\n\nexport const useLightspeedNotebooksPermission = () => {\n const result = usePermission({\n permission: lightspeedNotebooksUsePermission,\n });\n\n return {\n loading: result.loading,\n allowed: result.allowed,\n };\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,mCAAmC,MAAM;AACpD,EAAA,MAAM,SAAS,aAAA,CAAc;AAAA,IAC3B,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,OAAO;AAAA,IACL,SAAS,MAAA,CAAO,OAAA;AAAA,IAChB,SAAS,MAAA,CAAO;AAAA,GAClB;AACF;;;;"}
1
+ {"version":3,"file":"useLightspeedNotebooksPermission.esm.js","sources":["../../../src/hooks/notebooks/useLightspeedNotebooksPermission.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nimport { iaNotebooksUsePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';\n\nexport const useLightspeedNotebooksPermission = () => {\n const result = usePermission({\n permission: iaNotebooksUsePermission,\n });\n\n return {\n loading: result.loading,\n allowed: result.allowed,\n iaNotebooksUsePermissionName: iaNotebooksUsePermission.name,\n };\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,mCAAmC,MAAM;AACpD,EAAA,MAAM,SAAS,aAAA,CAAc;AAAA,IAC3B,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,OAAO;AAAA,IACL,SAAS,MAAA,CAAO,OAAA;AAAA,IAChB,SAAS,MAAA,CAAO,OAAA;AAAA,IAChB,8BAA8B,wBAAA,CAAyB;AAAA,GACzD;AACF;;;;"}
@@ -0,0 +1,50 @@
1
+ import { useApi } from '@backstage/core-plugin-api';
2
+ import { useQueryClient, useMutation } from '@tanstack/react-query';
3
+ import { notebooksApiRef } from '../../api/notebooksApi.esm.js';
4
+
5
+ const useRenameDocument = () => {
6
+ const notebooksApi = useApi(notebooksApiRef);
7
+ const queryClient = useQueryClient();
8
+ return useMutation({
9
+ mutationFn: async (payload) => {
10
+ await notebooksApi.renameDocument(
11
+ payload.sessionId,
12
+ payload.documentId,
13
+ payload.newTitle
14
+ );
15
+ },
16
+ onMutate: async (payload) => {
17
+ await queryClient.cancelQueries({
18
+ queryKey: ["notebooks", "documents", payload.sessionId]
19
+ });
20
+ const previousDocuments = queryClient.getQueryData([
21
+ "notebooks",
22
+ "documents",
23
+ payload.sessionId
24
+ ]);
25
+ queryClient.setQueryData(
26
+ ["notebooks", "documents", payload.sessionId],
27
+ (old) => old?.map(
28
+ (doc) => doc.document_id === payload.documentId ? { ...doc, title: payload.newTitle } : doc
29
+ )
30
+ );
31
+ return { previousDocuments };
32
+ },
33
+ onError: (_err, payload, context) => {
34
+ if (context?.previousDocuments) {
35
+ queryClient.setQueryData(
36
+ ["notebooks", "documents", payload.sessionId],
37
+ context.previousDocuments
38
+ );
39
+ }
40
+ },
41
+ onSettled: (_data, _error, payload) => {
42
+ queryClient.invalidateQueries({
43
+ queryKey: ["notebooks", "documents", payload.sessionId]
44
+ });
45
+ }
46
+ });
47
+ };
48
+
49
+ export { useRenameDocument };
50
+ //# sourceMappingURL=useRenameDocument.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRenameDocument.esm.js","sources":["../../../src/hooks/notebooks/useRenameDocument.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport {\n useMutation,\n useQueryClient,\n type UseMutationResult,\n} from '@tanstack/react-query';\n\nimport { notebooksApiRef } from '../../api/notebooksApi';\nimport { SessionDocument } from '../../types';\n\ntype RenameDocumentPayload = {\n sessionId: string;\n documentId: string;\n newTitle: string;\n};\n\ntype RenameDocumentContext = {\n previousDocuments: SessionDocument[] | undefined;\n};\n\nexport const useRenameDocument = (): UseMutationResult<\n void,\n unknown,\n RenameDocumentPayload,\n RenameDocumentContext\n> => {\n const notebooksApi = useApi(notebooksApiRef);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (payload: RenameDocumentPayload) => {\n await notebooksApi.renameDocument(\n payload.sessionId,\n payload.documentId,\n payload.newTitle,\n );\n },\n onMutate: async (payload): Promise<RenameDocumentContext> => {\n await queryClient.cancelQueries({\n queryKey: ['notebooks', 'documents', payload.sessionId],\n });\n\n const previousDocuments = queryClient.getQueryData<SessionDocument[]>([\n 'notebooks',\n 'documents',\n payload.sessionId,\n ]);\n\n queryClient.setQueryData<SessionDocument[]>(\n ['notebooks', 'documents', payload.sessionId],\n old =>\n old?.map(doc =>\n doc.document_id === payload.documentId\n ? { ...doc, title: payload.newTitle }\n : doc,\n ),\n );\n\n return { previousDocuments };\n },\n onError: (_err, payload, context) => {\n if (context?.previousDocuments) {\n queryClient.setQueryData(\n ['notebooks', 'documents', payload.sessionId],\n context.previousDocuments,\n );\n }\n },\n onSettled: (_data, _error, payload) => {\n queryClient.invalidateQueries({\n queryKey: ['notebooks', 'documents', payload.sessionId],\n });\n },\n });\n};\n"],"names":[],"mappings":";;;;AAqCO,MAAM,oBAAoB,MAK5B;AACH,EAAA,MAAM,YAAA,GAAe,OAAO,eAAe,CAAA;AAC3C,EAAA,MAAM,cAAc,cAAA,EAAe;AAEnC,EAAA,OAAO,WAAA,CAAY;AAAA,IACjB,UAAA,EAAY,OAAO,OAAA,KAAmC;AACpD,MAAA,MAAM,YAAA,CAAa,cAAA;AAAA,QACjB,OAAA,CAAQ,SAAA;AAAA,QACR,OAAA,CAAQ,UAAA;AAAA,QACR,OAAA,CAAQ;AAAA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ebooksApi.renameSession(payload.sessionId, payload.name);
11
11
  },
12
- onSuccess: () => {
12
+ onMutate: async (payload) => {
13
+ await queryClient.cancelQueries({
14
+ queryKey: ["notebooks", "sessions"]
15
+ });
16
+ await queryClient.cancelQueries({
17
+ queryKey: ["notebooks", "session", payload.sessionId]
18
+ });
19
+ const previousSessions = queryClient.getQueryData([
20
+ "notebooks",
21
+ "sessions"
22
+ ]);
23
+ const previousSession = queryClient.getQueryData([
24
+ "notebooks",
25
+ "session",
26
+ payload.sessionId
27
+ ]);
28
+ queryClient.setQueryData(
29
+ ["notebooks", "sessions"],
30
+ (old) => old?.map(
31
+ (s) => s.session_id === payload.sessionId ? { ...s, name: payload.name } : s
32
+ )
33
+ );
34
+ if (previousSession) {
35
+ queryClient.setQueryData(
36
+ ["notebooks", "session", payload.sessionId],
37
+ (old) => old ? { ...old, name: payload.name } : old
38
+ );
39
+ }
40
+ return { previousSessions, previousSession };
41
+ },
42
+ onError: (_err, payload, context) => {
43
+ if (context?.previousSessions) {
44
+ queryClient.setQueryData(
45
+ ["notebooks", "sessions"],
46
+ context.previousSessions
47
+ );
48
+ }
49
+ if (context?.previousSession) {
50
+ queryClient.setQueryData(
51
+ ["notebooks", "session", payload.sessionId],
52
+ context.previousSession
53
+ );
54
+ }
55
+ },
56
+ onSettled: (_data, _error, payload) => {
13
57
  queryClient.invalidateQueries({ queryKey: ["notebooks", "sessions"] });
58
+ queryClient.invalidateQueries({
59
+ queryKey: ["notebooks", "session", payload.sessionId]
60
+ });
14
61
  }
15
62
  });
16
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useRenameNotebook.esm.js","sources":["../../../src/hooks/notebooks/useRenameNotebook.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport {\n useMutation,\n useQueryClient,\n type UseMutationResult,\n} from '@tanstack/react-query';\n\nimport { notebooksApiRef } from '../../api/notebooksApi';\n\ntype RenameNotebookPayload = {\n sessionId: string;\n name: string;\n};\n\nexport const useRenameNotebook = (): UseMutationResult<\n void,\n unknown,\n RenameNotebookPayload\n> => {\n const notebooksApi = useApi(notebooksApiRef);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (payload: RenameNotebookPayload) => {\n await notebooksApi.renameSession(payload.sessionId, payload.name);\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['notebooks', 'sessions'] });\n },\n });\n};\n"],"names":[],"mappings":";;;;AA+BO,MAAM,oBAAoB,MAI5B;AACH,EAAA,MAAM,YAAA,GAAe,OAAO,eAAe,CAAA;AAC3C,EAAA,MAAM,cAAc,cAAA,EAAe;AAEnC,EAAA,OAAO,WAAA,CAAY;AAAA,IACjB,UAAA,EAAY,OAAO,OAAA,KAAmC;AACpD,MAAA,MAAM,YAAA,CAAa,aAAA,CAAc,OAAA,CAAQ,SAAA,EAAW,QAAQ,IAAI,CAAA;AAAA,IAClE,CAAA;AAAA,IACA,WAAW,MAAM;AACf,MAAA,WAAA,CAAY,kBAAkB,EAAE,QAAA,EAAU,CAAC,WAAA,EAAa,UAAU,GAAG,CAAA;AAAA,IACvE;AAAA,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"useRenameNotebook.esm.js","sources":["../../../src/hooks/notebooks/useRenameNotebook.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport {\n useMutation,\n useQueryClient,\n type UseMutationResult,\n} from '@tanstack/react-query';\n\nimport { notebooksApiRef } from '../../api/notebooksApi';\nimport { NotebookSession } from '../../types';\n\ntype RenameNotebookPayload = {\n sessionId: string;\n name: string;\n};\n\ntype RenameNotebookContext = {\n previousSessions: NotebookSession[] | undefined;\n previousSession: NotebookSession | undefined;\n};\n\nexport const useRenameNotebook = (): UseMutationResult<\n void,\n unknown,\n RenameNotebookPayload,\n RenameNotebookContext\n> => {\n const notebooksApi = useApi(notebooksApiRef);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (payload: RenameNotebookPayload) => {\n await notebooksApi.renameSession(payload.sessionId, payload.name);\n },\n onMutate: async (payload): Promise<RenameNotebookContext> => {\n await queryClient.cancelQueries({\n queryKey: ['notebooks', 'sessions'],\n });\n await queryClient.cancelQueries({\n queryKey: ['notebooks', 'session', payload.sessionId],\n });\n\n const previousSessions = queryClient.getQueryData<NotebookSession[]>([\n 'notebooks',\n 'sessions',\n ]);\n const previousSession = queryClient.getQueryData<NotebookSession>([\n 'notebooks',\n 'session',\n payload.sessionId,\n ]);\n\n queryClient.setQueryData<NotebookSession[]>(\n ['notebooks', 'sessions'],\n old =>\n old?.map(s =>\n s.session_id === payload.sessionId\n ? { ...s, name: payload.name }\n : s,\n ),\n );\n\n if (previousSession) {\n queryClient.setQueryData<NotebookSession>(\n ['notebooks', 'session', payload.sessionId],\n old => (old ? { ...old, name: payload.name } : old),\n );\n }\n\n return { previousSessions, previousSession };\n },\n onError: (_err, payload, context) => {\n if (context?.previousSessions) {\n queryClient.setQueryData(\n ['notebooks', 'sessions'],\n context.previousSessions,\n );\n }\n if (context?.previousSession) {\n queryClient.setQueryData(\n ['notebooks', 'session', payload.sessionId],\n context.previousSession,\n );\n }\n },\n onSettled: (_data, _error, payload) => {\n queryClient.invalidateQueries({ queryKey: ['notebooks', 'sessions'] });\n queryClient.invalidateQueries({\n queryKey: ['notebooks', 'session', payload.sessionId],\n });\n },\n });\n};\n"],"names":[],"mappings":";;;;AAqCO,MAAM,oBAAoB,MAK5B;AACH,EAAA,MAAM,YAAA,GAAe,OAAO,eAAe,CAAA;AAC3C,EAAA,MAAM,cAAc,cAAA,EAAe;AAEnC,EAAA,OAAO,WAAA,CAAY;AAAA,IACjB,UAAA,EAAY,OAAO,OAAA,KAAmC;AACpD,MAAA,MAAM,YAAA,CAAa,aAAA,CAAc,OAAA,CAAQ,SAAA,EAAW,QAAQ,IAAI,CAAA;AAAA,IAClE,CAAA;AAAA,IACA,QAAA,EAAU,OAAO,OAAA,KAA4C;AAC3D,MAAA,MAAM,YAAY,aAAA,CAAc;AAAA,QAC9B,QAAA,EAAU,CAAC,WAAA,EAAa,UAAU;AAAA,OACnC,CAAA;AACD,MAAA,MAAM,YAAY,aAAA,CAAc;AAAA,QAC9B,QAAA,EAAU,CAAC,WAAA,EAAa,SAAA,EAAW,QAAQ,SAAS;AAAA,OACrD,CAAA;AAED,MAAA,MAAM,gBAAA,GAAmB,YAAY,YAAA,CAAgC;AAAA,QACnE,WAAA;AAAA,QACA;AAAA,OACD,CAAA;AACD,MAAA,MAAM,eAAA,GAAkB,YAAY,YAAA,CAA8B;AAAA,QAChE,WAAA;AAAA,QACA,SAAA;AAAA,QACA,OAAA,CAAQ;AAAA,OACT,CAAA;AAED,MAAA,WAAA,CAAY,YAAA;AAAA,QACV,CAAC,aAAa,UAAU,CAAA;AAAA,QACxB,SACE,GAAA,EAAK,GAAA;AAAA,UAAI,CAAA,CAAA,KACP,CAAA,CAAE,UAAA,KAAe,OAAA,CAAQ,SAAA,GACrB,EAAE,GAAG,CAAA,EAAG,IAAA,EAAM,OAAA,CAAQ,IAAA,EAAK,GAC3B;AAAA;AACN,OACJ;AAEA,MAAA,IAAI,eAAA,EAAiB;AACnB,QAAA,WAAA,CAAY,YAAA;AAAA,UACV,CAAC,WAAA,EAAa,SAAA,EAAW,OAAA,CAAQ,SAAS,CAAA;AAAA,UAC1C,CAAA,GAAA,KAAQ,MAAM,EAAE,GAAG,KAAK,IAAA,EAAM,OAAA,CAAQ,MAAK,GAAI;AAAA,SACjD;AAAA,MACF;AAEA,MAAA,OAAO,EAAE,kBAAkB,eAAA,EAAgB;AAAA,IAC7C,CAAA;AAAA,IACA,OAAA,EAAS,CAAC,IAAA,EAAM,OAAA,EAAS,OAAA,KAAY;AACnC,MAAA,IAAI,SAAS,gBAAA,EAAkB;AAC7B,QAAA,WAAA,CAAY,YAAA;AAAA,UACV,CAAC,aAAa,UAAU,CAAA;AAAA,UACxB,OAAA,CAAQ;AAAA,SACV;AAAA,MACF;AACA,MAAA,IAAI,SAAS,eAAA,EAAiB;AAC5B,QAAA,WAAA,CAAY,YAAA;AAAA,UACV,CAAC,WAAA,EAAa,SAAA,EAAW,OAAA,CAAQ,SAAS,CAAA;AAAA,UAC1C,OAAA,CAAQ;AAAA,SACV;AAAA,MACF;AAAA,IACF,CAAA;AAAA,IACA,SAAA,EAAW,CAAC,KAAA,EAAO,MAAA,EAAQ,OAAA,KAAY;AACrC,MAAA,WAAA,CAAY,kBAAkB,EAAE,QAAA,EAAU,CAAC,WAAA,EAAa,UAAU,GAAG,CAAA;AACrE,MAAA,WAAA,CAAY,iBAAA,CAAkB;AAAA,QAC5B,QAAA,EAAU,CAAC,WAAA,EAAa,SAAA,EAAW,QAAQ,SAAS;AAAA,OACrD,CAAA;AAAA,IACH;AAAA,GACD,CAAA;AACH;;;;"}
@@ -0,0 +1,34 @@
1
+ import { useCallback } from 'react';
2
+ import { useTranslation } from '../useTranslation.esm.js';
3
+ import { useRenameNotebook } from './useRenameNotebook.esm.js';
4
+
5
+ const useRenameNotebookWithAlert = ({
6
+ setAlerts,
7
+ getNotebookName
8
+ }) => {
9
+ const { mutateAsync: renameNotebook } = useRenameNotebook();
10
+ const { t } = useTranslation();
11
+ return useCallback(
12
+ async (sessionId, newName) => {
13
+ const notebookName = getNotebookName(sessionId);
14
+ try {
15
+ await renameNotebook({ sessionId, name: newName });
16
+ } catch {
17
+ setAlerts((prev) => [
18
+ {
19
+ key: Date.now() + sessionId,
20
+ title: t("notebooks.rename.inline.error", {
21
+ notebookName
22
+ }),
23
+ variant: "danger"
24
+ },
25
+ ...prev
26
+ ]);
27
+ }
28
+ },
29
+ [renameNotebook, t, setAlerts, getNotebookName]
30
+ );
31
+ };
32
+
33
+ export { useRenameNotebookWithAlert };
34
+ //# sourceMappingURL=useRenameNotebookWithAlert.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRenameNotebookWithAlert.esm.js","sources":["../../../src/hooks/notebooks/useRenameNotebookWithAlert.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, type Dispatch, type SetStateAction } from 'react';\n\nimport { type AlertProps } from '@patternfly/react-core';\n\nimport { useTranslation } from '../useTranslation';\nimport { useRenameNotebook } from './useRenameNotebook';\n\ntype UseRenameNotebookWithAlertOptions = {\n setAlerts: Dispatch<SetStateAction<Partial<AlertProps>[]>>;\n getNotebookName: (sessionId: string) => string;\n};\n\nexport const useRenameNotebookWithAlert = ({\n setAlerts,\n getNotebookName,\n}: UseRenameNotebookWithAlertOptions): ((\n sessionId: string,\n newName: string,\n) => Promise<void>) => {\n const { mutateAsync: renameNotebook } = useRenameNotebook();\n const { t } = useTranslation();\n\n return useCallback(\n async (sessionId: string, newName: string) => {\n const notebookName = getNotebookName(sessionId);\n try {\n await renameNotebook({ sessionId, name: newName });\n } catch {\n setAlerts(prev => [\n {\n key: Date.now() + sessionId,\n title: (t as Function)('notebooks.rename.inline.error', {\n notebookName,\n }) as string,\n variant: 'danger',\n },\n ...prev,\n ]);\n }\n },\n [renameNotebook, t, setAlerts, getNotebookName],\n );\n};\n"],"names":[],"mappings":";;;;AA4BO,MAAM,6BAA6B,CAAC;AAAA,EACzC,SAAA;AAAA,EACA;AACF,CAAA,KAGuB;AACrB,EAAA,MAAM,EAAE,WAAA,EAAa,cAAA,EAAe,GAAI,iBAAA,EAAkB;AAC1D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,cAAA,EAAe;AAE7B,EAAA,OAAO,WAAA;AAAA,IACL,OAAO,WAAmB,OAAA,KAAoB;AAC5C,MAAA,MAAM,YAAA,GAAe,gBAAgB,SAAS,CAAA;AAC9C,MAAA,IAAI;AACF,QAAA,MAAM,cAAA,CAAe,EAAE,SAAA,EAAW,IAAA,EAAM,SAAS,CAAA;AAAA,MACnD,CAAA,CAAA,MAAQ;AACN,QAAA,SAAA,CAAU,CAAA,IAAA,KAAQ;AAAA,UAChB;AAAA,YACE,GAAA,EAAK,IAAA,CAAK,GAAA,EAAI,GAAI,SAAA;AAAA,YAClB,KAAA,EAAQ,EAAe,+BAAA,EAAiC;AAAA,cACtD;AAAA,aACD,CAAA;AAAA,YACD,OAAA,EAAS;AAAA,WACX;AAAA,UACA,GAAG;AAAA,SACJ,CAAA;AAAA,MACH;AAAA,IACF,CAAA;AAAA,IACA,CAAC,cAAA,EAAgB,CAAA,EAAG,SAAA,EAAW,eAAe;AAAA,GAChD;AACF;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { usePermission } from '@backstage/plugin-permission-react';
2
- import { lightspeedChatDeletePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';
2
+ import { iaChatManagePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';
3
3
 
4
4
  const useLightspeedDeletePermission = () => {
5
5
  const lightspeedDeletePermissionResult = usePermission({
6
- permission: lightspeedChatDeletePermission
6
+ permission: iaChatManagePermission
7
7
  });
8
8
  return lightspeedDeletePermissionResult;
9
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useLightspeedDeletePermission.esm.js","sources":["../../src/hooks/useLightspeedDeletePermission.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nimport { lightspeedChatDeletePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';\n\nexport const useLightspeedDeletePermission = () => {\n const lightspeedDeletePermissionResult = usePermission({\n permission: lightspeedChatDeletePermission,\n });\n\n return lightspeedDeletePermissionResult;\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,gCAAgC,MAAM;AACjD,EAAA,MAAM,mCAAmC,aAAA,CAAc;AAAA,IACrD,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,OAAO,gCAAA;AACT;;;;"}
1
+ {"version":3,"file":"useLightspeedDeletePermission.esm.js","sources":["../../src/hooks/useLightspeedDeletePermission.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nimport { iaChatManagePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';\n\nexport const useLightspeedDeletePermission = () => {\n const lightspeedDeletePermissionResult = usePermission({\n permission: iaChatManagePermission,\n });\n\n return lightspeedDeletePermissionResult;\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,gCAAgC,MAAM;AACjD,EAAA,MAAM,mCAAmC,aAAA,CAAc;AAAA,IACrD,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,OAAO,gCAAA;AACT;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { usePermission } from '@backstage/plugin-permission-react';
2
- import { lightspeedChatUpdatePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';
2
+ import { iaChatManagePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';
3
3
 
4
4
  const useLightspeedUpdatePermission = () => {
5
5
  const lightspeedUpdatePermissionResult = usePermission({
6
- permission: lightspeedChatUpdatePermission
6
+ permission: iaChatManagePermission
7
7
  });
8
8
  return lightspeedUpdatePermissionResult;
9
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useLightspeedUpdatePermission.esm.js","sources":["../../src/hooks/useLightspeedUpdatePermission.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nimport { lightspeedChatUpdatePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';\n\nexport const useLightspeedUpdatePermission = () => {\n const lightspeedUpdatePermissionResult = usePermission({\n permission: lightspeedChatUpdatePermission,\n });\n\n return lightspeedUpdatePermissionResult;\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,gCAAgC,MAAM;AACjD,EAAA,MAAM,mCAAmC,aAAA,CAAc;AAAA,IACrD,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,OAAO,gCAAA;AACT;;;;"}
1
+ {"version":3,"file":"useLightspeedUpdatePermission.esm.js","sources":["../../src/hooks/useLightspeedUpdatePermission.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nimport { iaChatManagePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';\n\nexport const useLightspeedUpdatePermission = () => {\n const lightspeedUpdatePermissionResult = usePermission({\n permission: iaChatManagePermission,\n });\n\n return lightspeedUpdatePermissionResult;\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,gCAAgC,MAAM;AACjD,EAAA,MAAM,mCAAmC,aAAA,CAAc;AAAA,IACrD,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,OAAO,gCAAA;AACT;;;;"}
@@ -1,16 +1,18 @@
1
1
  import { usePermission } from '@backstage/plugin-permission-react';
2
- import { lightspeedChatReadPermission, lightspeedChatCreatePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';
2
+ import { iaChatAccessPermission, iaChatUsePermission } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';
3
3
 
4
4
  const useLightspeedViewPermission = () => {
5
5
  const canReadChats = usePermission({
6
- permission: lightspeedChatReadPermission
6
+ permission: iaChatAccessPermission
7
7
  });
8
8
  const canCreateChats = usePermission({
9
- permission: lightspeedChatCreatePermission
9
+ permission: iaChatUsePermission
10
10
  });
11
11
  return {
12
12
  loading: canReadChats.loading || canCreateChats.loading,
13
- allowed: canReadChats.allowed && canCreateChats.allowed
13
+ allowed: canReadChats.allowed && canCreateChats.allowed,
14
+ iaChatAccessPermissionName: iaChatAccessPermission.name,
15
+ iaChatUsePermissionName: iaChatUsePermission.name
14
16
  };
15
17
  };
16
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"useLightspeedViewPermission.esm.js","sources":["../../src/hooks/useLightspeedViewPermission.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nimport {\n lightspeedChatCreatePermission,\n lightspeedChatReadPermission,\n} from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';\n\nexport const useLightspeedViewPermission = () => {\n const canReadChats = usePermission({\n permission: lightspeedChatReadPermission,\n });\n\n const canCreateChats = usePermission({\n permission: lightspeedChatCreatePermission,\n });\n\n return {\n loading: canReadChats.loading || canCreateChats.loading,\n allowed: canReadChats.allowed && canCreateChats.allowed,\n };\n};\n"],"names":[],"mappings":";;;AAuBO,MAAM,8BAA8B,MAAM;AAC/C,EAAA,MAAM,eAAe,aAAA,CAAc;AAAA,IACjC,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,MAAM,iBAAiB,aAAA,CAAc;AAAA,IACnC,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,YAAA,CAAa,OAAA,IAAW,cAAA,CAAe,OAAA;AAAA,IAChD,OAAA,EAAS,YAAA,CAAa,OAAA,IAAW,cAAA,CAAe;AAAA,GAClD;AACF;;;;"}
1
+ {"version":3,"file":"useLightspeedViewPermission.esm.js","sources":["../../src/hooks/useLightspeedViewPermission.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nimport {\n iaChatAccessPermission,\n iaChatUsePermission,\n} from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';\n\nexport const useLightspeedViewPermission = () => {\n const canReadChats = usePermission({\n permission: iaChatAccessPermission,\n });\n\n const canCreateChats = usePermission({\n permission: iaChatUsePermission,\n });\n\n return {\n loading: canReadChats.loading || canCreateChats.loading,\n allowed: canReadChats.allowed && canCreateChats.allowed,\n iaChatAccessPermissionName: iaChatAccessPermission.name,\n iaChatUsePermissionName: iaChatUsePermission.name,\n };\n};\n"],"names":[],"mappings":";;;AAuBO,MAAM,8BAA8B,MAAM;AAC/C,EAAA,MAAM,eAAe,aAAA,CAAc;AAAA,IACjC,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,MAAM,iBAAiB,aAAA,CAAc;AAAA,IACnC,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,YAAA,CAAa,OAAA,IAAW,cAAA,CAAe,OAAA;AAAA,IAChD,OAAA,EAAS,YAAA,CAAa,OAAA,IAAW,cAAA,CAAe,OAAA;AAAA,IAChD,4BAA4B,sBAAA,CAAuB,IAAA;AAAA,IACnD,yBAAyB,mBAAA,CAAoB;AAAA,GAC/C;AACF;;;;"}
@@ -5,6 +5,7 @@ const intelligentAssistantTranslationDe = createTranslationMessages({
5
5
  ref: intelligentAssistantTranslationRef,
6
6
  messages: {
7
7
  "aria.chatHistoryMenu": "Chatverlauf-Men\xFC",
8
+ "modelSelector.disabledTooltip": "Jede Chatsitzung unterst\xFCtzt nur ein Modell. Um das Modell zu wechseln, starten Sie einen neuen Chat.",
8
9
  "aria.chatbotSelector": "Chatbot-Auswahl",
9
10
  "aria.close": "Chatbot schlie\xDFen",
10
11
  "aria.closeDrawerPanel": "Drawer-Fenster schlie\xDFen",
@@ -141,41 +142,57 @@ const intelligentAssistantTranslationDe = createTranslationMessages({
141
142
  "modal.save": "Speichern",
142
143
  "modal.title.edit": "Anhang bearbeiten",
143
144
  "modal.title.preview": "Anhang in der Vorschau anzeigen",
145
+ "notebook.document.rename": "Umbenennen",
146
+ "notebook.document.rename.tooltip": "Klicken zum Umbenennen",
147
+ "notebook.document.rename.error": 'Umbenennung von "{{documentName}}" fehlgeschlagen.',
148
+ "notebook.document.rename.conflict": "Name existiert bereits.",
149
+ "notebook.document.rename.tooLong": "Name zu lang (max 255).",
144
150
  "notebook.document.delete": "L\xF6schen",
145
151
  "notebook.document.delete.action": "Entfernen",
146
152
  "notebook.document.delete.description": "Sind Sie sicher, dass Sie <documentName/> aus diesem Notizbuch entfernen m\xF6chten? Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.",
147
153
  "notebook.document.delete.success": '\u201E{{documentName}}" wurde erfolgreich entfernt.',
148
154
  "notebook.document.delete.title": "Ressource entfernen?",
149
- "notebook.overwrite.modal.action": "\xDCberschreiben",
150
- "notebook.overwrite.modal.description": "Die folgenden Dateien existieren bereits in diesem Notizbuch. M\xF6chten Sie sie mit den neuen Versionen \xFCberschreiben?",
151
- "notebook.overwrite.modal.title": "Dateien \xFCberschreiben?",
155
+ "notebook.overwrite.modal.action": "Hochladen ({{count}})",
156
+ "notebook.overwrite.modal.back": "Zur\xFCck",
157
+ "notebook.overwrite.modal.description": "{{duplicateCount}} Dateien existieren bereits in diesem Notizbuch. {{newCount}} neue Ressourcen werden trotzdem hinzugef\xFCgt.",
158
+ "notebook.overwrite.modal.ignore": "Doppelte Dateien ignorieren",
159
+ "notebook.overwrite.modal.replace": "Bestehende Dateien ersetzen",
160
+ "notebook.overwrite.modal.title": "Datei existiert bereits",
161
+ "notebook.overwrite.modal.title.one": "Datei existiert bereits",
162
+ "notebook.overwrite.modal.title.other": "Dateien existieren bereits",
163
+ "notebook.overwrite.modal.description.one": "{{duplicateCount}} Datei existiert bereits in diesem Notizbuch. {{newCount}} neue Ressourcen werden trotzdem hinzugef\xFCgt.",
164
+ "notebook.overwrite.modal.description.other": "{{duplicateCount}} Dateien existieren bereits in diesem Notizbuch. {{newCount}} neue Ressourcen werden trotzdem hinzugef\xFCgt.",
152
165
  "notebook.upload.error.fileTooLarge": "Upload-Fehler: Dateigr\xF6\xDFe \xFCberschreitet das Limit von 25 MB.",
153
166
  "notebook.upload.error.tooManyFiles": "Upload-Fehler: Maximal {{max}} Dateien erlaubt.",
154
167
  "notebook.upload.error.unsupportedType": "Upload-Fehler: Nicht unterst\xFCtzte Dateitypen gefunden. Bitte laden Sie nur unterst\xFCtzte Dateitypen hoch.",
155
168
  "notebook.upload.failed": 'Hochladen von "{{fileName}}" fehlgeschlagen.',
156
169
  "notebook.upload.modal.addButton": "Hinzuf\xFCgen ({{count}})",
170
+ "notebook.upload.modal.addButtonEmpty": "Hinzuf\xFCgen",
157
171
  "notebook.upload.modal.browseButton": "Hochladen",
158
- "notebook.upload.modal.dragDropTitle": "Dateien hierher ziehen und ablegen",
172
+ "notebook.upload.modal.dragDropTitle": "Dateien hierher ziehen und ablegen oder zum Durchsuchen klicken",
159
173
  "notebook.upload.modal.infoText": "Akzeptierte Dateitypen: .md, .txt, .pdf, .json, .yaml, .log",
174
+ "notebook.upload.modal.maxFileSize": "Maximale Dateigr\xF6\xDFe betr\xE4gt 25 MB.",
175
+ "notebook.upload.modal.supportedFormats": "Unterst\xFCtzte Formate:",
160
176
  "notebook.upload.modal.removeFile": "{{fileName}} entfernen",
161
177
  "notebook.upload.modal.selectedFiles": "{{count}} von {{max}} Dateien ausgew\xE4hlt",
162
178
  "notebook.upload.modal.separator": "oder",
163
- "notebook.upload.modal.title": "Dokument zum Notizbuch hinzuf\xFCgen",
179
+ "notebook.upload.modal.title": "Ressourcen hinzuf\xFCgen",
164
180
  "notebook.view.close": "Notizbuch schlie\xDFen",
165
181
  "notebook.view.documents.add": "Hinzuf\xFCgen",
166
- "notebook.view.documents.count": "{{count}} Dokumente",
167
- "notebook.view.documents.maxReached": "Maximal 10 Dokumente sind erlaubt. L\xF6schen Sie ein Dokument, um ein neues hochzuladen.",
168
- "notebook.view.documents.uploading": "Dokument wird hochgeladen",
182
+ "notebook.view.documents.count_one": "{{count}} Ressource",
183
+ "notebook.view.documents.count_other": "{{count}} Ressourcen",
184
+ "notebook.view.documents.maxReached": "Maximal 10 Ressourcen sind erlaubt. L\xF6schen Sie eine Ressource, um eine neue hochzuladen.",
185
+ "notebook.view.documents.uploading": "Ressource wird hochgeladen",
169
186
  "notebook.view.input.disabledTooltip": "W\xE4hlen Sie mindestens eine geladene Ressource aus, um den Chat zu starten",
170
- "notebook.view.input.placeholder": "Fragen Sie zu Ihren Dokumenten...",
187
+ "notebook.view.input.placeholder": "Fragen Sie zu Ihren Ressourcen...",
171
188
  "notebook.view.sidebar.collapse": "Seitenleiste einklappen",
172
189
  "notebook.view.sidebar.expand": "Seitenleiste ausklappen",
173
190
  "notebook.view.sidebar.resize": "Gr\xF6\xDFe der Seitenleiste \xE4ndern",
174
191
  "notebook.view.title": "Unbenanntes Notizbuch",
175
- "notebook.view.upload.action": "Ressource hochladen",
192
+ "notebook.view.upload.action": "Ressource hinzuf\xFCgen",
176
193
  "notebook.view.processing.description": "Ihre Dateien werden indexiert. Sie k\xF6nnen Fragen stellen, sobald die Verarbeitung abgeschlossen ist.",
177
194
  "notebook.view.processing.heading": "Ressourcen werden verarbeitet...",
178
- "notebook.view.upload.heading": "Laden Sie eine Ressource hoch, um zu beginnen",
195
+ "notebook.view.upload.heading": "F\xFCgen Sie eine Ressource hinzu, um zu beginnen",
179
196
  "notebooks.actions.delete": "L\xF6schen",
180
197
  "notebooks.actions.rename": "Umbenennen",
181
198
  "notebooks.card.openAria": "Notizbuch {{name}} \xF6ffnen",
@@ -183,18 +200,16 @@ const intelligentAssistantTranslationDe = createTranslationMessages({
183
200
  "notebooks.delete.message": "Dieses Notizbuch wird hier nicht mehr angezeigt. Dadurch werden auch zugeh\xF6rige Aktivit\xE4ten wie Eingaben, Antworten und Feedback aus Ihrer Aktivit\xE4t gel\xF6scht.",
184
201
  "notebooks.delete.title": "{{name}} l\xF6schen?",
185
202
  "notebooks.delete.toast": "Notizbuch gel\xF6scht!",
186
- "notebooks.documents": "Dokumente",
203
+ "notebooks.documents_one": "{{count}} Ressource",
204
+ "notebooks.documents_other": "{{count}} Ressourcen",
187
205
  "notebooks.empty.action": "Neues Notizbuch erstellen",
188
206
  "notebooks.empty.description": "Erstellen Sie ein neues Notizbuch, um Ihre Quellen zu organisieren und KI-gest\xFCtzte Erkenntnisse zu gewinnen.",
189
207
  "notebooks.empty.title": "Keine erstellten Notizb\xFCcher",
190
208
  "notebooks.prompts.accessIssue.title": "Hilf mir bei einem Zugriffsproblem",
191
209
  "notebooks.prompts.coreConcepts.title": "Was sind die Kernkonzepte?",
192
210
  "notebooks.prompts.vulnerabilities.title": "Zeige meine kritischen Schwachstellen",
193
- "notebooks.rename.action": "Senden",
194
- "notebooks.rename.description": "Bitte geben Sie den neuen Namen f\xFCr dieses Notizbuch ein und klicken Sie auf \u201ESenden\u201C, um fortzufahren.",
195
- "notebooks.rename.label": "Neuer Name",
196
- "notebooks.rename.placeholder": "Neuer Name",
197
- "notebooks.rename.title": "{{name}} umbenennen?",
211
+ "notebooks.rename.inline.tooltip": "Klicken zum Umbenennen",
212
+ "notebooks.rename.inline.error": 'Umbenennung von "{{notebookName}}" fehlgeschlagen.',
198
213
  "notebooks.title": "Meine Notizb\xFCcher",
199
214
  "notebooks.updated.days": "Vor {{days}} Tagen aktualisiert",
200
215
  "notebooks.updated.on": "Aktualisiert am",