Merge branch 'main' of github.com:openreplay/openreplay into dev
This commit is contained in:
commit
e67b62aa43
5 changed files with 30 additions and 14 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState, useEffect } from 'react'
|
||||
import { Duration } from 'luxon';
|
||||
import { durationFormatted, formatTimeOrDate } from 'App/date';
|
||||
import { durationFormatted, convertTimestampToUtcTimestamp } from 'App/date';
|
||||
|
||||
interface Props {
|
||||
startTime: any,
|
||||
|
|
@ -9,7 +9,7 @@ interface Props {
|
|||
|
||||
function Counter({ startTime, className }: Props) {
|
||||
let intervalId;
|
||||
const [duration, setDuration] = useState(new Date().getTime() - startTime)
|
||||
const [duration, setDuration] = useState(new Date().getTime() - convertTimestampToUtcTimestamp(startTime));
|
||||
const formattedDuration = durationFormatted(Duration.fromMillis(duration));
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React from 'react';
|
||||
import { List } from 'immutable';
|
||||
import FilterList from 'Shared/Filters/FilterList';
|
||||
import FilterSelection from 'Shared/Filters/FilterSelection';
|
||||
import SaveFilterButton from 'Shared/SaveFilterButton';
|
||||
|
|
@ -13,7 +12,7 @@ interface Props {
|
|||
edit: typeof edit;
|
||||
addFilter: typeof addFilter;
|
||||
}
|
||||
function SessionSearch(props) {
|
||||
function SessionSearch(props: Props) {
|
||||
const { appliedFilter } = props;
|
||||
const hasEvents = appliedFilter.filters.filter(i => i.isEvent).size > 0;
|
||||
const hasFilters = appliedFilter.filters.filter(i => !i.isEvent).size > 0;
|
||||
|
|
@ -82,7 +81,6 @@ function SessionSearch(props) {
|
|||
<div className="ml-auto flex items-center">
|
||||
<SaveFilterButton />
|
||||
<SaveFunnelButton />
|
||||
{/* <IconButton primaryText label="SAVE FUNNEL" icon="filter" /> */}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -111,3 +111,6 @@ export const checkRecentTime = (date, format) => {
|
|||
|
||||
export const formatMs = (ms: number): string => ms < 1000 ? `${ Math.trunc(ms) }ms` : `${ Math.trunc(ms/100) / 10 }s`;
|
||||
|
||||
export const convertTimestampToUtcTimestamp = (timestamp: number): number => {
|
||||
return DateTime.fromMillis(timestamp).toUTC().toMillis();
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ function chartWrapper(chart = []) {
|
|||
const savedSearchIdKey = 'searchId'
|
||||
const updateItemInList = createListUpdater(savedSearchIdKey);
|
||||
const updateInstance = (state, instance) => state.getIn([ "savedSearch", savedSearchIdKey ]) === instance[savedSearchIdKey]
|
||||
? state.mergeIn([ "savedSearch" ], instance)
|
||||
? state.mergeIn([ "savedSearch" ], SavedFilter(instance))
|
||||
: state;
|
||||
|
||||
const initialState = Map({
|
||||
|
|
@ -63,10 +63,6 @@ function reducer(state = initialState, action = {}) {
|
|||
return action.fromUrl
|
||||
? state.set('instance', Filter(action.filter))
|
||||
: state.mergeIn(['instance'], action.filter);
|
||||
case success(SAVE):
|
||||
return updateItemInList(updateInstance(state, action.data), action.data);
|
||||
case success(REMOVE):
|
||||
return state.update('list', list => list.filter(item => item.searchId !== action.id));
|
||||
case success(FETCH):
|
||||
return state.set("instance", action.data);
|
||||
case success(FETCH_LIST):
|
||||
|
|
@ -136,7 +132,18 @@ export const edit = reduceThenFetchResource((instance) => ({
|
|||
instance,
|
||||
}));
|
||||
|
||||
export const remove = createRemove(name, (id) => `/saved_search/${id}`);
|
||||
export const remove = (id) => (dispatch, getState) => {
|
||||
return dispatch({
|
||||
types: REMOVE.array,
|
||||
call: client => client.delete(`/saved_search/${id}`),
|
||||
id,
|
||||
}).then(() => {
|
||||
dispatch(applySavedSearch(new SavedFilter({})));
|
||||
dispatch(fetchList());
|
||||
});
|
||||
};
|
||||
|
||||
// export const remove = createRemove(name, (id) => `/saved_search/${id}`);
|
||||
|
||||
export const applyFilter = reduceThenFetchResource((filter, fromUrl=false) => ({
|
||||
type: APPLY,
|
||||
|
|
@ -172,15 +179,21 @@ export function fetch(id) {
|
|||
}
|
||||
|
||||
export const save = (id) => (dispatch, getState) => {
|
||||
// export function save(id) {
|
||||
const filter = getState().getIn([ 'search', 'instance']).toData();
|
||||
filter.filters = filter.filters.map(filterMap);
|
||||
const isNew = !id;
|
||||
|
||||
const instance = getState().getIn([ 'search', 'savedSearch']).toData();
|
||||
// instance = instance instanceof SavedFilter ? instance : new SavedFilter(instance);
|
||||
return dispatch({
|
||||
types: SAVE.array,
|
||||
call: client => client.post(!id ? '/saved_search' : `/saved_search/${id}`, { ...instance, filter })
|
||||
call: client => client.post(isNew ? '/saved_search' : `/saved_search/${id}`, { ...instance, filter })
|
||||
}).then(() => {
|
||||
dispatch(fetchList()).then(() => {
|
||||
if (isNew) {
|
||||
const lastSavedSearch = getState().getIn([ 'search', 'list']).last();
|
||||
dispatch(applySavedSearch(lastSavedSearch));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
cd $(dirname $0)
|
||||
|
||||
is_migrate=$1
|
||||
|
||||
# Converting alphaneumeric to number.
|
||||
PREVIOUS_APP_VERSION=`echo $PREVIOUS_APP_VERSION | cut -d "v" -f2`
|
||||
CHART_APP_VERSION=`echo $CHART_APP_VERSION | cut -d "v" -f2`
|
||||
|
||||
function migration() {
|
||||
ls -la /opt/openreplay/openreplay
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue