@rhc-shared-components/packages-table 1.0.6 → 1.0.8

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/dist/index.js CHANGED
@@ -2507,7 +2507,7 @@ var PackagesTable = function PackagesTable(_ref) {
2507
2507
  var link_data = validPackages == null ? void 0 : validPackages.filter(function (rpm) {
2508
2508
  return rpm.name === name && rpm.architecture === arch;
2509
2509
  });
2510
- vulnerability.rpm_nvra_with_link_data.push(link_data[0]);
2510
+ link_data.length > 0 ? vulnerability.rpm_nvra_with_link_data.push(link_data[0]) : link_data = null;
2511
2511
  });
2512
2512
  } else {
2513
2513
  var _vulnerability$packag;
@@ -2534,7 +2534,10 @@ var PackagesTable = function PackagesTable(_ref) {
2534
2534
  }) === index;
2535
2535
  });
2536
2536
  uniqueVulnerabilities.filter(function (vulnerability) {
2537
- if (vulnerability.rpm_nvra_with_link_data.length > 0) return vulnerability;
2537
+ if (vulnerability.rpm_nvra_with_link_data.length > 0) {
2538
+ console.log(vulnerability);
2539
+ return vulnerability;
2540
+ }
2538
2541
  });
2539
2542
  setUniqueVulnerabilities(uniqueVulnerabilities);
2540
2543
  }, [rpms, vulnerabilities]);
@@ -2319,8 +2319,8 @@ const PackagesTable = ({
2319
2319
  name,
2320
2320
  arch
2321
2321
  }) => {
2322
- const link_data = validPackages == null ? void 0 : validPackages.filter(rpm => rpm.name === name && rpm.architecture === arch);
2323
- vulnerability.rpm_nvra_with_link_data.push(link_data[0]);
2322
+ let link_data = validPackages == null ? void 0 : validPackages.filter(rpm => rpm.name === name && rpm.architecture === arch);
2323
+ link_data.length > 0 ? vulnerability.rpm_nvra_with_link_data.push(link_data[0]) : link_data = null;
2324
2324
  });
2325
2325
  } else {
2326
2326
  var _vulnerability$packag;
@@ -2339,7 +2339,10 @@ const PackagesTable = ({
2339
2339
  // filter out vulnerabilities with duplicate CVE IDs
2340
2340
  uniqueVulnerabilities.filter((value, index, self) => self.findIndex(vulnerability => vulnerability.cve_id === value.cve_id) === index);
2341
2341
  uniqueVulnerabilities.filter(vulnerability => {
2342
- if (vulnerability.rpm_nvra_with_link_data.length > 0) return vulnerability;
2342
+ if (vulnerability.rpm_nvra_with_link_data.length > 0) {
2343
+ console.log(vulnerability);
2344
+ return vulnerability;
2345
+ }
2343
2346
  });
2344
2347
  setUniqueVulnerabilities(uniqueVulnerabilities);
2345
2348
  }, [_rpms, _vulnerabilities]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhc-shared-components/packages-table",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "project description",
5
5
  "author": "redhatofficial",
6
6
  "license": "MIT",