diff --git a/ui-common/src/components/ServiceMapModal/ServiceMapModal.module.sass b/ui-common/src/components/ServiceMapModal/ServiceMapModal.module.sass index a00abdf3f..b14c7e4f3 100644 --- a/ui-common/src/components/ServiceMapModal/ServiceMapModal.module.sass +++ b/ui-common/src/components/ServiceMapModal/ServiceMapModal.module.sass @@ -96,8 +96,3 @@ & .servicesFilterList height: calc(100% - 30px - 52px) - -.totalSelected - font-size: 12px - color: $light-blue-color - font-weight: 700 diff --git a/ui-common/src/components/ServiceMapModal/ServiceMapModal.tsx b/ui-common/src/components/ServiceMapModal/ServiceMapModal.tsx index 9ea86c681..2a7e99459 100644 --- a/ui-common/src/components/ServiceMapModal/ServiceMapModal.tsx +++ b/ui-common/src/components/ServiceMapModal/ServiceMapModal.tsx @@ -68,7 +68,6 @@ export const ServiceMapModal: React.FC = ({ isOpen, onClos const [checkedProtocols, setCheckedProtocols] = useState([]) const [checkedServices, setCheckedServices] = useState([]) const [serviceMapApiData, setServiceMapApiData] = useState({ edges: [], nodes: [] }) - const [servicesSearchVal, setServicesSearchVal] = useState("") const [graphOptions, setGraphOptions] = useState(ServiceMapOptions); const [isFilterClicked, setIsFilterClicked] = useState(true) @@ -219,22 +218,14 @@ export const ServiceMapModal: React.FC = ({ isOpen, onClos
-

- PROTOCOLS -  ({checkedProtocols.length}) -

- +
-

- SERVICES -  ({checkedServices.length}) -

- setServicesSearchVal(event.target.value)} /> -
- +
+
diff --git a/ui-common/src/components/UI/SelectList.tsx b/ui-common/src/components/UI/SelectList.tsx index 3875dedfd..8e7e03004 100644 --- a/ui-common/src/components/UI/SelectList.tsx +++ b/ui-common/src/components/UI/SelectList.tsx @@ -3,6 +3,7 @@ import Radio from "./Radio"; import styles from './style/SelectList.module.sass' import NoDataMessage from "./NoDataMessage"; import Checkbox from "./Checkbox"; +import { useCommonStyles } from "../../helpers/commonStyle"; export interface Props { @@ -10,14 +11,17 @@ export interface Props { tableName: string; checkedValues?: string[]; multiSelect: boolean; - searchValue?: string; setCheckedValues: (newValues) => void; - tableClassName? - checkBoxWidth?: string + tableClassName?; + checkBoxWidth?: string; + inputSearchClass? : string + isFilterable? : boolean } -const SelectList: React.FC = ({ items, tableName, checkedValues = [], multiSelect = true, searchValue = "", setCheckedValues, tableClassName, - checkBoxWidth = 50 }) => { +const SelectList: React.FC = ({ items, tableName, checkedValues = [], multiSelect = true, setCheckedValues, tableClassName, + checkBoxWidth = 50 ,inputSearchClass,isFilterable = true}) => { + const commonClasses = useCommonStyles(); + const [searchValue, setSearchValue] = useState("") const noItemsMessage = "No items to show"; const [headerChecked, setHeaderChecked] = useState(false) @@ -73,11 +77,10 @@ const SelectList: React.FC = ({ items, tableName, checkedValues = [], mul toggleAll(isChecked)} /> - {tableName} + All : - - {tableName} + const tableBody = filteredValues.length === 0 ? @@ -100,7 +103,14 @@ const SelectList: React.FC = ({ items, tableName, checkedValues = [], mul } ) - return
+ return +

+ {tableName} +  ({checkedValues.length}) +

+ {isFilterable && setSearchValue(event.target.value)} data-cy="searchInput" />} +
{tableHead} @@ -110,6 +120,7 @@ const SelectList: React.FC = ({ items, tableName, checkedValues = [], mul
+
} -export default SelectList; \ No newline at end of file +export default SelectList; diff --git a/ui-common/src/components/UI/style/SelectList.module.sass b/ui-common/src/components/UI/style/SelectList.module.sass index 02af14f07..0ce2d1fe9 100644 --- a/ui-common/src/components/UI/style/SelectList.module.sass +++ b/ui-common/src/components/UI/style/SelectList.module.sass @@ -1,4 +1,6 @@ @import '../../../variables.module' +@import '../../../components' + .selectListTable overflow: auto @@ -17,6 +19,7 @@ position: sticky top: 0 background: $main-background-color + font-size: 12px tr border-bottom-width: 1px @@ -27,7 +30,15 @@ td color: $light-gray padding: 10px - font-size: 16px + font-size: 11px + font-weight: 600 + padding-top: 5px + padding-bottom: 5px .nowrap white-space: nowrap + +.totalSelected + font-size: 12px + color: $light-blue-color + font-weight: 700