@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.
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +2 -2
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +4 -18
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +2 -2
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +1 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +4 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +2 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +1 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +21 -95
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +137 -269
- package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +20 -16
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +5 -6
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +2 -3
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +5 -11
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +5 -11
- package/lib/esm/components/Cve/CveItem.d.ts +8 -0
- package/lib/esm/components/Cve/CveItem.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveItem.js +96 -0
- package/lib/esm/components/Cve/CveModal.d.ts +3 -0
- package/lib/esm/components/Cve/CveModal.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveModal.js +41 -0
- package/lib/esm/components/Cve/CvePanel.d.ts +7 -0
- package/lib/esm/components/Cve/CvePanel.d.ts.map +1 -0
- package/lib/esm/components/Cve/CvePanel.js +23 -0
- package/lib/esm/components/Cve/CveSidebar.d.ts +3 -0
- package/lib/esm/components/Cve/CveSidebar.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveSidebar.js +23 -0
- package/lib/esm/components/OpenCase/OpenCase.d.ts +3 -0
- package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/OpenCase.js +8 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +3 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +33 -21
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -0
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +2 -2
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts +4 -2
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +8 -7
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -1
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +3 -5
- package/lib/esm/components/Recommendations/EARules/EARule.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARule.js +2 -0
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +2 -2
- package/lib/esm/components/Recommendations/EARules/EARuleWidget.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleWidget.js +5 -6
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +55 -27
- package/lib/esm/components/Recommendations/RecommendationsLoader.d.ts +3 -0
- package/lib/esm/components/Recommendations/RecommendationsLoader.d.ts.map +1 -0
- package/lib/esm/components/Recommendations/RecommendationsLoader.js +11 -0
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.js +3 -3
- package/lib/esm/components/Suggestions/TopContent.d.ts.map +1 -1
- package/lib/esm/components/Suggestions/TopContent.js +4 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts +2 -2
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.js +1 -10
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +14 -7
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +11 -9
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +1 -4
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +0 -5
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +3 -7
- package/lib/esm/css/results.css +6 -0
- package/lib/esm/hooks/useFetchCVEData.d.ts +5 -0
- package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -0
- package/lib/esm/hooks/useFetchCVEData.js +136 -0
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +10 -2
- package/lib/esm/models/caseCreationWorkflows.d.ts +25 -0
- package/lib/esm/models/caseCreationWorkflows.d.ts.map +1 -0
- package/lib/esm/models/caseCreationWorkflows.js +1 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +4 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +3 -0
- package/lib/esm/reducers/RouteConstNTypes.d.ts +0 -1
- package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/RouteConstNTypes.js +0 -1
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +1 -1
- package/lib/esm/scss/_main.scss +20 -2
- package/lib/esm/scss/_pf-overrides.scss +0 -6
- package/lib/esm/utils/caseUtils.d.ts +18 -0
- package/lib/esm/utils/caseUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseUtils.js +42 -0
- 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.
|
|
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.
|
|
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.
|
|
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.
|
|
64
|
-
"@rh-support/react-context": "2.
|
|
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.
|
|
67
|
-
"@rh-support/utils": "2.
|
|
68
|
-
"
|
|
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": "
|
|
137
|
+
"gitHead": "d867a78014ee4a08aa8d7bf9e0dc9bd08ce6ac5a"
|
|
138
138
|
}
|