Skip to content

Commit

Permalink
Merge pull request Marklogic-retired#218 in PROD/explorer-ui from ~SV…
Browse files Browse the repository at this point in the history
…ISHAKA/explorer-ui:DHFPROD-4283 to develop

* commit '9fa1097cad2bfc03ea7d73f2232c242234f3bb15':
  removed vertical scroll for table
  multipopover fix
  multiple popovers fix
  • Loading branch information
Bruce An authored and Bruce An committed Feb 5, 2020
2 parents 707e346 + 9fa1097 commit ae1fc25
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions src/components/pop-over-search/pop-over-search.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Popover, Input, Checkbox, Icon} from 'antd';
import {Popover, Input, Checkbox, Icon} from 'antd';
import styles from './pop-over-search.module.scss';
import axios from "axios";

Expand All @@ -18,7 +18,7 @@ const PopOverSearch: React.FC<Props> = (props) => {
const [popOverVisibility, setPopOverVisibilty] = useState(false);

const getFacetValues = async (param) => {
if(param.target.value.length >= 2 && param.target.value.toLowerCase()){
if (param.target.value.length >= 2 && param.target.value.toLowerCase()) {
try {
const response = await axios({
method: 'POST',
Expand Down Expand Up @@ -49,16 +49,18 @@ const PopOverSearch: React.FC<Props> = (props) => {

const addFacetValues = () => {
props.checkFacetValues(checkedValues);
setPopOverVisibilty(false);
}

const searchPopover = () => {
setPopOverVisibilty(true);
}

const closePopover = () => {
setPopOverVisibilty(false);
const handleChange = (visible) => {
setPopOverVisibilty(visible);
}


const content = (
<div className={styles.popover}>
<Input placeholder="Search" allowClear={true} onChange={getFacetValues}/>
Expand All @@ -68,17 +70,20 @@ const PopOverSearch: React.FC<Props> = (props) => {
<hr/>
<div className={styles.checkIcon}>
<Icon type="check-square-o" className={styles.popoverIcons} onClick={addFacetValues}/>
<Icon type="close-square-o" className={styles.popoverIcons} onClick={closePopover}/>
</div>
</div>
)

return (
<Popover placement="leftTop" content={content} trigger="click" visible={popOverVisibility}>
<div className={styles.search} onClick={searchPopover}>Search</div>
<Popover
placement="leftTop"
content={content}
trigger="click"
onVisibleChange={handleChange}
visible={popOverVisibility}>
<div className={styles.search}>Search</div>
</Popover>
)

}

export default PopOverSearch;
Expand Down
2 changes: 1 addition & 1 deletion src/components/result-table/result-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ const ResultTable: React.FC<Props> = (props) => {
pagination={false}
expandedRowRender={expandedRowRender}
expandIcon={expandIcon}
scroll={{y:3/4*(window.innerHeight)}}
//scroll={{y:3/4*(window.innerHeight)}}
data-cy="search-tabular"
/>
</div>
Expand Down

0 comments on commit ae1fc25

Please sign in to comment.