@rh-support/troubleshoot 2.4.5-beta.1 → 2.4.5-beta.11

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 (110) hide show
  1. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +2 -2
  2. package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
  3. package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +4 -18
  4. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  5. package/lib/esm/components/CaseEditView/CaseOverview/index.js +2 -2
  6. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  7. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +2 -4
  8. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
  9. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +1 -2
  10. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  11. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +4 -6
  12. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +2 -3
  14. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +1 -4
  16. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +21 -95
  17. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  18. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +137 -269
  19. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  20. package/lib/esm/components/CaseInformation/Description.js +20 -16
  21. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  22. package/lib/esm/components/CaseInformation/Fts.js +5 -6
  23. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  24. package/lib/esm/components/CaseManagement/Cep.js +2 -3
  25. package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
  26. package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +5 -11
  27. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  28. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +5 -11
  29. package/lib/esm/components/Cve/CveItem.d.ts +8 -0
  30. package/lib/esm/components/Cve/CveItem.d.ts.map +1 -0
  31. package/lib/esm/components/Cve/CveItem.js +96 -0
  32. package/lib/esm/components/Cve/CveModal.d.ts +3 -0
  33. package/lib/esm/components/Cve/CveModal.d.ts.map +1 -0
  34. package/lib/esm/components/Cve/CveModal.js +41 -0
  35. package/lib/esm/components/Cve/CvePanel.d.ts +7 -0
  36. package/lib/esm/components/Cve/CvePanel.d.ts.map +1 -0
  37. package/lib/esm/components/Cve/CvePanel.js +23 -0
  38. package/lib/esm/components/Cve/CveSidebar.d.ts +3 -0
  39. package/lib/esm/components/Cve/CveSidebar.d.ts.map +1 -0
  40. package/lib/esm/components/Cve/CveSidebar.js +23 -0
  41. package/lib/esm/components/OpenCase/OpenCase.d.ts +3 -0
  42. package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
  43. package/lib/esm/components/OpenCase/OpenCase.js +8 -0
  44. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +3 -0
  45. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  46. package/lib/esm/components/ProductSelector/AllProductsSelector.js +33 -21
  47. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -0
  48. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  49. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +2 -2
  50. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +1 -1
  51. package/lib/esm/components/ProductSelector/ProductSelector.d.ts +4 -2
  52. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  53. package/lib/esm/components/ProductSelector/ProductSelector.js +8 -7
  54. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  55. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -1
  56. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  57. package/lib/esm/components/Recommendations/AsideResults.js +3 -5
  58. package/lib/esm/components/Recommendations/EARules/EARule.d.ts.map +1 -1
  59. package/lib/esm/components/Recommendations/EARules/EARule.js +2 -0
  60. package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.d.ts.map +1 -1
  61. package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +2 -2
  62. package/lib/esm/components/Recommendations/EARules/EARuleWidget.d.ts.map +1 -1
  63. package/lib/esm/components/Recommendations/EARules/EARuleWidget.js +5 -6
  64. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  65. package/lib/esm/components/Recommendations/Recommendations.js +55 -27
  66. package/lib/esm/components/Recommendations/RecommendationsLoader.d.ts +3 -0
  67. package/lib/esm/components/Recommendations/RecommendationsLoader.d.ts.map +1 -0
  68. package/lib/esm/components/Recommendations/RecommendationsLoader.js +11 -0
  69. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  70. package/lib/esm/components/Review/Review.js +1 -1
  71. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -1
  72. package/lib/esm/components/SubmitCase/SubmitCase.js +3 -3
  73. package/lib/esm/components/Suggestions/TopContent.d.ts.map +1 -1
  74. package/lib/esm/components/Suggestions/TopContent.js +4 -1
  75. package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts +2 -2
  76. package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts.map +1 -1
  77. package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.js +1 -10
  78. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  79. package/lib/esm/components/shared/useIsSectionValid.js +14 -7
  80. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  81. package/lib/esm/components/wizardLayout/WizardAside.js +11 -9
  82. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  83. package/lib/esm/components/wizardLayout/WizardLayout.js +1 -4
  84. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  85. package/lib/esm/components/wizardLayout/WizardMain.js +0 -5
  86. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  87. package/lib/esm/components/wizardLayout/WizardNavigation.js +3 -7
  88. package/lib/esm/css/results.css +6 -0
  89. package/lib/esm/hooks/useFetchCVEData.d.ts +5 -0
  90. package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -0
  91. package/lib/esm/hooks/useFetchCVEData.js +136 -0
  92. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  93. package/lib/esm/hooks/useWizard.js +10 -2
  94. package/lib/esm/models/caseCreationWorkflows.d.ts +25 -0
  95. package/lib/esm/models/caseCreationWorkflows.d.ts.map +1 -0
  96. package/lib/esm/models/caseCreationWorkflows.js +1 -0
  97. package/lib/esm/reducers/CaseConstNTypes.d.ts +4 -0
  98. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  99. package/lib/esm/reducers/CaseConstNTypes.js +3 -0
  100. package/lib/esm/reducers/RouteConstNTypes.d.ts +0 -1
  101. package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
  102. package/lib/esm/reducers/RouteConstNTypes.js +0 -1
  103. package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
  104. package/lib/esm/reducers/SessionRestoreReducer.js +1 -1
  105. package/lib/esm/scss/_main.scss +20 -2
  106. package/lib/esm/scss/_pf-overrides.scss +0 -6
  107. package/lib/esm/utils/caseUtils.d.ts +18 -0
  108. package/lib/esm/utils/caseUtils.d.ts.map +1 -1
  109. package/lib/esm/utils/caseUtils.js +42 -0
  110. package/package.json +11 -11
@@ -14,3 +14,45 @@ export const extractKTQuestion1FromDescription = (description) => {
14
14
  return description;
15
15
  }
16
16
  };
17
+ /**
18
+ * Normalizes CVE (Common Vulnerabilities and Exposures) identifiers
19
+ * to the standard format: CVE-YYYY-NNNNN
20
+ *
21
+ * @param {string} input - The input text containing CVE identifiers
22
+ * @returns {string} Normalized text with standardized CVE format
23
+ *
24
+ * @example
25
+ * normalizeCVE("CVE 2021-44228") and normalizeCVE("CVE2022-1234")
26
+ * // Returns: "CVE-2021-44228" and "CVE-2022-1234"
27
+ */
28
+ export const normalizeCVE = (input) => {
29
+ // Function to format each match
30
+ const formatCVE = (match) => {
31
+ // Remove all spaces, ensure there's a dash after CVE and before the year
32
+ return match
33
+ .toUpperCase()
34
+ .replace(/\s/g, '')
35
+ .replace(/^CVE(?!-)/, 'CVE-')
36
+ .replace(/(\d{4})(\d{4,7})/, '$1-$2');
37
+ };
38
+ // Replace all matches in the input string
39
+ return input.replace(input, formatCVE);
40
+ };
41
+ /**
42
+ * Finds all CVE identifiers in the given text.
43
+ * @param {string} text - The input text to search for CVE identifiers.
44
+ * @returns {string[]} An array of CVE identifiers found in the text, or an empty array if none are found.
45
+ */
46
+ export const findCVEsInString = (text) => {
47
+ // Regular expression to match CVE identifiers
48
+ // CVE 2021-44228 , CVE2022-1234 and CVE-2022-1234
49
+ const cveRegex = /\b(CVE[-\s]?\d{4}-\d{4,7})\b/gim;
50
+ // Find all matches in the text
51
+ const matches = text.match(cveRegex);
52
+ // Normalizes CVE
53
+ const normalizedCVEs = matches === null || matches === void 0 ? void 0 : matches.map((cve) => normalizeCVE(cve));
54
+ // Deduplicate the matches
55
+ const uniqueMatches = [...new Set(normalizedCVEs)];
56
+ // Return the unique matches, or an empty array if no matches found
57
+ return uniqueMatches || [];
58
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.4.5-beta.1",
3
+ "version": "2.4.5-beta.11",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -25,7 +25,7 @@
25
25
  "lib/**/*"
26
26
  ],
27
27
  "peerDependencies": {
28
- "@cee-eng/hydrajs": "4.17.27",
28
+ "@cee-eng/hydrajs": "4.17.33",
29
29
  "@cee-eng/ui-toolkit": "1.1.8",
30
30
  "@patternfly/patternfly": "5.4.0",
31
31
  "@patternfly/react-core": "5.4.0",
@@ -51,7 +51,7 @@
51
51
  "react-virtualized": "^9.22.5"
52
52
  },
53
53
  "dependencies": {
54
- "@cee-eng/hydrajs": "4.17.27",
54
+ "@cee-eng/hydrajs": "4.17.33",
55
55
  "@cee-eng/ui-toolkit": "1.1.8",
56
56
  "@patternfly/patternfly": "5.4.0",
57
57
  "@patternfly/react-core": "5.4.0",
@@ -60,12 +60,14 @@
60
60
  "@progress/kendo-licensing": "1.3.5",
61
61
  "@progress/kendo-react-pdf": "^5.16.0",
62
62
  "@redux-devtools/extension": "^3.3.0",
63
- "@rh-support/components": "2.1.93",
64
- "@rh-support/react-context": "2.1.102",
63
+ "@rh-support/components": "2.4.2",
64
+ "@rh-support/react-context": "2.4.2",
65
65
  "@rh-support/types": "2.0.5",
66
- "@rh-support/user-permissions": "2.1.57",
67
- "@rh-support/utils": "2.1.46",
68
- "date-fns": "^4.1.0",
66
+ "@rh-support/user-permissions": "2.4.2",
67
+ "@rh-support/utils": "2.4.2",
68
+ "@types/react-redux": "^7.1.33",
69
+ "@types/redux": "^3.6.0",
70
+ "date-fns": "3.6.0",
69
71
  "dompurify": "^2.2.6",
70
72
  "dot": "^1.1.3",
71
73
  "downshift": "^6.0.5",
@@ -103,9 +105,7 @@
103
105
  "@types/react": "^18.2.20",
104
106
  "@types/react-bootstrap-typeahead": "^5.1.3",
105
107
  "@types/react-dom": "^18.2.18",
106
- "@types/react-redux": "^7.1.33",
107
108
  "@types/react-router-dom": "^5.1.2",
108
- "@types/redux": "^3.6.0",
109
109
  "faker": "^5.5.3",
110
110
  "jest": "^29.7.0",
111
111
  "jest-environment-jsdom": "^29.7.0"
@@ -134,5 +134,5 @@
134
134
  "defaults and supports es6-module",
135
135
  "maintained node versions"
136
136
  ],
137
- "gitHead": "91b8d4959b93c0227d070e881682d84d6d4eeac1"
137
+ "gitHead": "d867a78014ee4a08aa8d7bf9e0dc9bd08ce6ac5a"
138
138
  }