bug: misc fixes
This commit is contained in:
parent
34e6d78972
commit
890af33b7d
4 changed files with 20 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react'
|
||||
import React, { useState } from 'react'
|
||||
import { Input, Slider, Button, Popup, CircularLoader } from 'UI';
|
||||
import { saveCaptureRate, editCaptureRate } from 'Duck/watchdogs';
|
||||
import { connect } from 'react-redux';
|
||||
|
|
@ -12,8 +12,11 @@ function isPercent(val) {
|
|||
|
||||
const SessionCaptureRate = props => {
|
||||
const { captureRate, saveCaptureRate, editCaptureRate, loading, onClose } = props;
|
||||
const sampleRate = captureRate.get('rate');
|
||||
if (sampleRate == null) return null;
|
||||
const _sampleRate = captureRate.get('rate');
|
||||
if (_sampleRate == null) return null;
|
||||
console.log(_sampleRate)
|
||||
|
||||
const [sampleRate, setSampleRate] = useState(_sampleRate)
|
||||
|
||||
const captureAll = captureRate.get('captureAll');
|
||||
|
||||
|
|
@ -46,7 +49,7 @@ const SessionCaptureRate = props => {
|
|||
name="sampleRate"
|
||||
disabled={ captureAll }
|
||||
value={ captureAll ? '100' : sampleRate }
|
||||
onChange={ ({ target: { value }}) => isPercent(value) && editCaptureRate(+value) }
|
||||
onChange={ ({ target: { value }}) => isPercent(value) && setSampleRate(+value) }
|
||||
size="small"
|
||||
className={stl.inputField}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const RehydrateSlidePanel = props => {
|
|||
onClose={ onClose }
|
||||
size="small"
|
||||
content={
|
||||
isModalDisplayed && (
|
||||
<div className="px-4">
|
||||
<hr className="mb-3" />
|
||||
<div>
|
||||
|
|
@ -33,6 +34,7 @@ const RehydrateSlidePanel = props => {
|
|||
<SessionCaptureRate onClose={ onClose } />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { hasSiteId, siteChangeAvaliable } from 'App/routes';
|
|||
import { STATUS_COLOR_MAP, GREEN } from 'Types/site';
|
||||
import { Icon, SlideModal } from 'UI';
|
||||
import { pushNewSite } from 'Duck/user'
|
||||
import { init } from 'Duck/site';
|
||||
import styles from './siteDropdown.css';
|
||||
import cn from 'classnames';
|
||||
import NewSiteForm from '../Client/Sites/NewSiteForm';
|
||||
|
|
@ -15,7 +16,8 @@ import NewSiteForm from '../Client/Sites/NewSiteForm';
|
|||
siteId: state.getIn([ 'user', 'siteId' ]),
|
||||
}), {
|
||||
setSiteId,
|
||||
pushNewSite
|
||||
pushNewSite,
|
||||
init
|
||||
})
|
||||
export default class SiteDropdown extends React.PureComponent {
|
||||
state = { showProductModal: false }
|
||||
|
|
@ -28,6 +30,11 @@ export default class SiteDropdown extends React.PureComponent {
|
|||
}
|
||||
};
|
||||
|
||||
newSite = () => {
|
||||
this.props.init({})
|
||||
this.setState({showProductModal: true})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { sites, siteId, location: { pathname } } = this.props;
|
||||
const { showProductModal } = this.state;
|
||||
|
|
@ -62,7 +69,7 @@ export default class SiteDropdown extends React.PureComponent {
|
|||
</ul>
|
||||
<div
|
||||
className={cn(styles.btnNew, 'flex items-center justify-center py-3 cursor-pointer')}
|
||||
onClick={() => this.setState({showProductModal: true})}
|
||||
onClick={this.newSite}
|
||||
>
|
||||
<Icon
|
||||
name="plus"
|
||||
|
|
@ -78,7 +85,7 @@ export default class SiteDropdown extends React.PureComponent {
|
|||
title="New Project"
|
||||
size="small"
|
||||
isDisplayed={ showProductModal }
|
||||
content={ <NewSiteForm onClose={ this.closeModal } /> }
|
||||
content={ showProductModal && <NewSiteForm onClose={ this.closeModal } /> }
|
||||
onClose={ this.closeModal }
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export default function EventSearch(props) {
|
|||
value={value}
|
||||
onChange={onChange}
|
||||
style={{ height: '32px' }}
|
||||
autocomplete="off"
|
||||
/>
|
||||
<div
|
||||
onClick={() => { setShowSearch(!showSearch); clearSearch() }}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue