From 681a8b78900b7b87ac9c1f0ad6208afa2ba6336b Mon Sep 17 00:00:00 2001 From: Deepak Prabhakara Date: Tue, 15 Aug 2023 16:41:00 +0530 Subject: [PATCH] added skipViewLogEvent as props (#233) * added skipViewLogEvent as props * fixed typo --- src/components/containers/EventsBrowser.tsx | 1 + src/dev/LogsViewerWrapper.tsx | 1 + src/index.tsx | 3 +++ src/redux/data/events/thunks.js | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/containers/EventsBrowser.tsx b/src/components/containers/EventsBrowser.tsx index 2bc379f0..43149c85 100644 --- a/src/components/containers/EventsBrowser.tsx +++ b/src/components/containers/EventsBrowser.tsx @@ -139,6 +139,7 @@ class EventsBrowser extends React.Component { search_text: query, cursor, length: this.state.resultsPerPage, + skipViewLogEvent: this.props.skipViewLogEvent, }; this.props.requestEventSearch(queryObj); } diff --git a/src/dev/LogsViewerWrapper.tsx b/src/dev/LogsViewerWrapper.tsx index 089eb4f6..d9e3f9f3 100644 --- a/src/dev/LogsViewerWrapper.tsx +++ b/src/dev/LogsViewerWrapper.tsx @@ -69,6 +69,7 @@ const LogsViewerWrapper = (props) => { host={`${endpoint}/viewer/v1`} fields={props.fields ? (Array.isArray(props.fields) ? props.fields : defaultFields) : defaultFields} disableShowRawEvent={props.disableShowRawEvent ? props.disableShowRawEvent : false} + skipViewLogEvent={true} /> ); }; diff --git a/src/index.tsx b/src/index.tsx index 494d70eb..7073bdd2 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -27,6 +27,7 @@ export default class RetracedEventsBrowser extends React.Component { mount: PropTypes.bool, disableShowRawEvent: PropTypes.bool, fields: PropTypes.arrayOf(eventField), + skipViewLogEvent: PropTypes.bool, }; static defaultProps = { header: "Events", @@ -35,6 +36,7 @@ export default class RetracedEventsBrowser extends React.Component { searchHelpURL: "https://boxyhq.com/docs/retraced/apis/graphql#search", mount: true, fields: [], + skipViewLogEvent: false, }; render() { return ( @@ -53,6 +55,7 @@ export default class RetracedEventsBrowser extends React.Component { searchHelpURL={this.props.searchHelpURL} fields={this.props.fields} disableShowRawEvent={this.props.disableShowRawEvent} + skipViewLogEvent={this.props.skipViewLogEvent} /> diff --git a/src/redux/data/events/thunks.js b/src/redux/data/events/thunks.js index dc9139c6..52d1779e 100644 --- a/src/redux/data/events/thunks.js +++ b/src/redux/data/events/thunks.js @@ -6,9 +6,10 @@ export function requestEventSearch(query) { return async (dispatch, getState) => { dispatch(loadingData("eventFetch", true)); let data; + const skipViewLogEvent = query.skipViewLogEvent ? "?skipViewLogEvent=true" : ""; const state = getState(); const host = state.data.sessionData.host; - const url = `${host}/graphql`; + const url = `${host}/graphql${skipViewLogEvent}`; try { const response = await fetch(url, { method: "POST",