diff --git a/frontend/app/components/shared/SaveSearchModal/SaveSearchModal.tsx b/frontend/app/components/shared/SaveSearchModal/SaveSearchModal.tsx index 668b657b0..916967966 100644 --- a/frontend/app/components/shared/SaveSearchModal/SaveSearchModal.tsx +++ b/frontend/app/components/shared/SaveSearchModal/SaveSearchModal.tsx @@ -5,6 +5,7 @@ import { Button, Modal, Form, Icon, Checkbox } from 'UI'; import { confirm } from 'UI/Confirmation'; import stl from './SaveSearchModal.css'; import cn from 'classnames'; +import { toast } from 'react-toastify'; interface Props { filter: any; @@ -20,7 +21,7 @@ interface Props { function SaveSearchModal(props: Props) { const { savedSearch, filter, loading, show, closeHandler } = props; const [name, setName] = useState(savedSearch ? savedSearch.name : ''); - + const onNameChange = ({ target: { value } }) => { props.edit({ name: value }); // setName(value); @@ -29,9 +30,14 @@ function SaveSearchModal(props: Props) { const onSave = () => { const { filter, closeHandler } = props; // if (name.trim() === '') return; - props.save(savedSearch.exists() ? savedSearch.searchId : null).then(function() { + props.save(savedSearch.exists() ? savedSearch.searchId : null) + .then(() => { // this.props.fetchFunnelsList(); + toast.success(`${savedSearch.exists() ? 'Updated' : 'Saved'} Successfully`); closeHandler(); + }) + .catch(e => { + toast.error('Something went wrong, please try again'); }); } @@ -48,13 +54,13 @@ function SaveSearchModal(props: Props) { } const onChangeOption = (e, { checked, name }) => props.edit({ [ name ]: checked }) - + return (
{ 'Save Search' }
- - +
({ userId: state.getIn([ 'user', 'account', 'id' ]), savedSearch: state.getIn([ 'search', 'savedSearch' ]), filter: state.getIn(['search', 'instance']), - loading: state.getIn([ 'search', 'saveRequest', 'loading' ]) || + loading: state.getIn([ 'search', 'saveRequest', 'loading' ]) || state.getIn([ 'search', 'updateRequest', 'loading' ]), -}), { edit, save, remove })(SaveSearchModal); \ No newline at end of file +}), { edit, save, remove })(SaveSearchModal); diff --git a/frontend/app/components/shared/SessionSettings/components/CaptureRate.tsx b/frontend/app/components/shared/SessionSettings/components/CaptureRate.tsx index d7be11132..a08d19b2b 100644 --- a/frontend/app/components/shared/SessionSettings/components/CaptureRate.tsx +++ b/frontend/app/components/shared/SessionSettings/components/CaptureRate.tsx @@ -18,50 +18,59 @@ function CaptureRate(props) { }); }, []) + const toggleRate = () => { + if (captureAll === false) { + settingsStore.saveCaptureRate({ captureAll: true }) + } + setCaptureAll(!captureAll) + setChanged(true) + } + return useObserver(() => ( -

Capture Rate

-
What percentage of your user sessions do you want to record and monitor?
-
+

Recordings

+
What percentage of user sessions do you want to Capture?
+
{ - setCaptureAll(!captureAll) - setChanged(true) - }} - label="Capture 100% of the sessions" + onChange={toggleRate} /> + 100%
+ {!captureAll && (
-
- { - setCaptureRate(value) - setChanged(true); - }} - disabled={captureAll} - min={0} - minValue={0} - /> - +
+ { + setCaptureRate(value) + setChanged(true); + }} + disabled={captureAll} + min={0} + minValue={0} + /> + +
+ of the sessions +
- of the sessions - -
+ )} )); } -export default CaptureRate; \ No newline at end of file +export default CaptureRate; diff --git a/frontend/app/components/shared/SessionSettings/components/DefaultPlaying.tsx b/frontend/app/components/shared/SessionSettings/components/DefaultPlaying.tsx index cb80c30b2..4ebd067a9 100644 --- a/frontend/app/components/shared/SessionSettings/components/DefaultPlaying.tsx +++ b/frontend/app/components/shared/SessionSettings/components/DefaultPlaying.tsx @@ -2,24 +2,31 @@ import React from 'react'; import { Toggler } from 'UI'; import { useStore } from 'App/mstore'; import { useObserver } from 'mobx-react-lite'; +import { toast } from 'react-toastify'; function DefaultPlaying(props) { const { settingsStore } = useStore(); const sessionSettings = useObserver(() => settingsStore.sessionSettings) - + + const toggleSkipToIssue = () => { + sessionSettings.updateKey('skipToIssue', !sessionSettings.skipToIssue) + toast.success("Default playing option saved successfully"); + } + + return useObserver(() => ( <> -

Default Playing Options

+

Default Playing Option

Always start playing the session from the first issue.
sessionSettings.updateKey('skipToIssue', !sessionSettings.skipToIssue)} + onChange={toggleSkipToIssue} />
)); } -export default DefaultPlaying; \ No newline at end of file +export default DefaultPlaying; diff --git a/frontend/app/components/shared/SessionSettings/components/ListingVisibility.tsx b/frontend/app/components/shared/SessionSettings/components/ListingVisibility.tsx index c358f9389..c5741fb14 100644 --- a/frontend/app/components/shared/SessionSettings/components/ListingVisibility.tsx +++ b/frontend/app/components/shared/SessionSettings/components/ListingVisibility.tsx @@ -3,6 +3,7 @@ import Select from 'Shared/Select'; import { Button, Input } from 'UI'; import { useStore } from 'App/mstore'; import { useObserver } from 'mobx-react-lite'; +import { toast } from 'react-toastify'; const numberOptions = [ { label: 'Less than', value: '<' }, @@ -19,18 +20,27 @@ function ListingVisibility(props) { const sessionSettings = useObserver(() => settingsStore.sessionSettings) const [durationSettings, setDurationSettings] = React.useState(sessionSettings.durationFilter); + const changeSettings = (changes) => { + setDurationSettings({ ...durationSettings, ...changes }); + setChanged(true); + } + const saveSettings = () => { + sessionSettings.updateKey('durationFilter', durationSettings); + setChanged(false); + toast.success("Listing visibility settings saved successfully"); + } + return ( <>

Listing Visibility

-
Do not show sessions duration with.
+
Do not show sessions with duration.