diff --git a/catalog/helm/values.yaml b/catalog/helm/values.yaml index 406b6309d..633cb1008 100644 --- a/catalog/helm/values.yaml +++ b/catalog/helm/values.yaml @@ -34,7 +34,7 @@ ui: name: # default use chart name + '-ui' image: #override: - tag: v0.27.5 + tag: v0.27.6 repository: quay.io/redhat-gpte/babylon-catalog-ui pullPolicy: IfNotPresent replicaCount: 1 diff --git a/catalog/ui/src/app/Catalog/Catalog.tsx b/catalog/ui/src/app/Catalog/Catalog.tsx index 87ad56366..5b7aaeedb 100644 --- a/catalog/ui/src/app/Catalog/Catalog.tsx +++ b/catalog/ui/src/app/Catalog/Catalog.tsx @@ -36,7 +36,14 @@ import { apiPaths, fetcherItemsInAllPages } from '@app/api'; import { CatalogItem } from '@app/types'; import useSession from '@app/utils/useSession'; import SearchInputString from '@app/components/SearchInputString'; -import { checkAccessControl, displayName, BABYLON_DOMAIN, FETCH_BATCH_LIMIT, stripTags } from '@app/util'; +import { + checkAccessControl, + displayName, + BABYLON_DOMAIN, + FETCH_BATCH_LIMIT, + stripTags, + CATALOG_MANAGER_DOMAIN, +} from '@app/util'; import LoadingIcon from '@app/components/LoadingIcon'; import Footer from '@app/components/Footer'; import { @@ -143,6 +150,17 @@ function filterCatalogItemByLabels(catalogItem: CatalogItem, labelFilter: { [att .substring(BABYLON_DOMAIN.length + 1) .replace(/-[0-9]+$/, '') .toLowerCase(); + if (matchAttr === ciAttr) { + if (matchValues.includes(ciValue.toLowerCase())) { + matched = true; + } + } + } + if (ciLabel.startsWith(`${CATALOG_MANAGER_DOMAIN}/`)) { + const ciAttr = ciLabel + .substring(CATALOG_MANAGER_DOMAIN.length + 1) + .replace(/-[0-9]+$/, '') + .toLowerCase(); if (matchAttr === ciAttr) { if (ciAttr === CUSTOM_LABELS.RATING.key) { if (parseInt(ciValue, 10) >= parseInt(matchValues[0], 10)) matched = true; diff --git a/catalog/ui/src/app/Catalog/CatalogItemDetails.tsx b/catalog/ui/src/app/Catalog/CatalogItemDetails.tsx index 8847b3565..8ca320402 100644 --- a/catalog/ui/src/app/Catalog/CatalogItemDetails.tsx +++ b/catalog/ui/src/app/Catalog/CatalogItemDetails.tsx @@ -41,6 +41,7 @@ import { getHelpUrl, isResourceClaimPartOfWorkshop, compareK8sObjectsArr, + CATALOG_MANAGER_DOMAIN, } from '@app/util'; import StarRating from '@app/components/StarRating'; import TimeInterval from '@app/components/TimeInterval'; @@ -163,14 +164,20 @@ const CatalogItemDetails: React.FC<{ catalogItem: CatalogItem; onClose: () => vo const attributes: { [attr: string]: string } = {}; for (const [label, value] of Object.entries(labels || {})) { if (label.startsWith(`${BABYLON_DOMAIN}/`)) { - const attr: string = label.substring(BABYLON_DOMAIN.length + 1); + const attr = label.substring(BABYLON_DOMAIN.length + 1); + if (!HIDDEN_LABELS_DETAIL_VIEW.includes(attr)) { + attributes[attr] = value; + } + } + if (label.startsWith(`${CATALOG_MANAGER_DOMAIN}/`)) { + const attr = label.substring(CATALOG_MANAGER_DOMAIN.length + 1); if (!HIDDEN_LABELS_DETAIL_VIEW.includes(attr)) { attributes[attr] = value; } } } - async function orderCatalogItem(): Promise { + async function orderCatalogItem() { navigate(`/catalog/${namespace}/order/${name}`); } diff --git a/catalog/ui/src/app/Catalog/CatalogLabelSelector.tsx b/catalog/ui/src/app/Catalog/CatalogLabelSelector.tsx index 4dba2c872..6b75307d0 100644 --- a/catalog/ui/src/app/Catalog/CatalogLabelSelector.tsx +++ b/catalog/ui/src/app/Catalog/CatalogLabelSelector.tsx @@ -2,7 +2,7 @@ import React, { useCallback, useState } from 'react'; import { Button, Checkbox, ExpandableSection, Form, FormGroup, Tooltip } from '@patternfly/react-core'; import FilterAltIcon from '@patternfly/react-icons/dist/js/icons/filter-alt-icon'; import { CatalogItem } from '@app/types'; -import { BABYLON_DOMAIN } from '@app/util'; +import { BABYLON_DOMAIN, CATALOG_MANAGER_DOMAIN } from '@app/util'; import StarRating from '@app/components/StarRating'; import { formatString, HIDDEN_LABELS, CUSTOM_LABELS } from './catalog-utils'; @@ -32,11 +32,17 @@ const CatalogLabelSelector: React.FC<{ for (const catalogItem of catalogItems || []) { if (!catalogItem.metadata.labels) continue; for (const [label, value] of Object.entries(catalogItem.metadata.labels)) { - if (!label.startsWith(`${BABYLON_DOMAIN}/`)) continue; + let domain: string = null; + if (label.startsWith(`${BABYLON_DOMAIN}/`)) { + domain = BABYLON_DOMAIN; + } else if (label.startsWith(`${CATALOG_MANAGER_DOMAIN}/`)) { + domain = CATALOG_MANAGER_DOMAIN; + } + if (!domain) continue; if (label.toLowerCase() === `${CUSTOM_LABELS.CATEGORY.domain}/${CUSTOM_LABELS.CATEGORY.key}`) continue; // Allow multiple values for labels with numeric suffixes - const attr = label.substring(BABYLON_DOMAIN.length + 1).replace(/-[0-9]+$/, ''); + const attr = label.substring(domain.length + 1).replace(/-[0-9]+$/, ''); const attrKey = attr.toLowerCase(); // Only non-hidden labels if (!HIDDEN_LABELS.includes(attr)) { @@ -60,14 +66,23 @@ const CatalogLabelSelector: React.FC<{ for (const catalogItem of filteredCatalogItems || []) { if (!catalogItem.metadata.labels) continue; for (const [label, value] of Object.entries(catalogItem.metadata.labels)) { - if (!label.startsWith(`${BABYLON_DOMAIN}/`)) continue; if (label.toLowerCase() === `${CUSTOM_LABELS.CATEGORY.domain}/${CUSTOM_LABELS.CATEGORY.key}`) continue; // Allow multiple values for labels with numeric suffixes - const attrKey = label.substring(BABYLON_DOMAIN.length + 1).replace(/-[0-9]+$/, ''); - // Only non-hidden labels - if (!HIDDEN_LABELS.includes(attrKey)) { - const valueKey = value.toLowerCase(); - labels[attrKey.toLowerCase()].values[valueKey].count++; + if (label.startsWith(`${BABYLON_DOMAIN}/`)) { + const attrKey = label.substring(BABYLON_DOMAIN.length + 1).replace(/-[0-9]+$/, ''); + // Only non-hidden labels + if (!HIDDEN_LABELS.includes(attrKey)) { + const valueKey = value.toLowerCase(); + labels[attrKey.toLowerCase()].values[valueKey].count++; + } + } + if (label.startsWith(`${CATALOG_MANAGER_DOMAIN}/`)) { + const attrKey = label.substring(CATALOG_MANAGER_DOMAIN.length + 1).replace(/-[0-9]+$/, ''); + // Only non-hidden labels + if (!HIDDEN_LABELS.includes(attrKey)) { + const valueKey = value.toLowerCase(); + labels[attrKey.toLowerCase()].values[valueKey].count++; + } } } } diff --git a/openshift/config/common/vars.yaml b/openshift/config/common/vars.yaml index ce8accf43..f53e0678f 100644 --- a/openshift/config/common/vars.yaml +++ b/openshift/config/common/vars.yaml @@ -1,5 +1,5 @@ # Component Versions -agnosticv_operator_version: v0.31.9 +agnosticv_operator_version: v0.31.10 babylon_anarchy_version: v0.23.1 babylon_anarchy_governor_version: v0.19.1 poolboy_version: v1.3.2