fix(ui): sessions listings settings filter
This commit is contained in:
parent
f88ff53e15
commit
30dd123f29
3 changed files with 20 additions and 4 deletions
|
|
@ -58,7 +58,7 @@ function ListingVisibility() {
|
|||
</div>
|
||||
<div className="col-span-3">
|
||||
<Select
|
||||
defaultValue={periodOptions[1].value}
|
||||
defaultValue={durationSettings.countType || periodOptions[0].value}
|
||||
options={periodOptions}
|
||||
onChange={({ value }) => {
|
||||
changeSettings({ countType: value.value })
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ const projectStore = new ProjectsStore();
|
|||
const sessionStore = new SessionStore();
|
||||
const searchStore = new SearchStore();
|
||||
const searchStoreLive = new SearchStoreLive();
|
||||
const settingsStore = new SettingsStore();
|
||||
|
||||
function copyToClipboard(text: string) {
|
||||
const textArea = document.createElement('textarea');
|
||||
|
|
@ -114,7 +115,7 @@ export class RootStore {
|
|||
this.dashboardStore = new DashboardStore();
|
||||
this.metricStore = new MetricStore();
|
||||
this.funnelStore = new FunnelStore();
|
||||
this.settingsStore = new SettingsStore();
|
||||
this.settingsStore = settingsStore;
|
||||
this.userStore = userStore;
|
||||
this.roleStore = new RoleStore();
|
||||
this.auditStore = new AuditStore();
|
||||
|
|
@ -168,4 +169,4 @@ export const withStore = (Component: any) => (props: any) => {
|
|||
return <Component {...props} mstore={useStore()} />;
|
||||
};
|
||||
|
||||
export { userStore, sessionStore, searchStore, searchStoreLive, projectStore, client };
|
||||
export { userStore, sessionStore, searchStore, searchStoreLive, projectStore, client, settingsStore };
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import { searchService } from 'App/services';
|
|||
import Search from 'App/mstore/types/search';
|
||||
import { checkFilterValue } from 'App/mstore/types/filter';
|
||||
import FilterItem from 'App/mstore/types/filterItem';
|
||||
import { sessionStore } from 'App/mstore';
|
||||
import { sessionStore, settingsStore } from 'App/mstore';
|
||||
import SavedSearch, { ISavedSearch } from 'App/mstore/types/savedSearch';
|
||||
import { iTag } from '@/services/NotesService';
|
||||
import { issues_types } from 'Types/session/issue';
|
||||
|
|
@ -374,6 +374,21 @@ class SearchStore {
|
|||
filter.filters = filter.filters.concat(tagFilter);
|
||||
}
|
||||
|
||||
if (!filter.filters.some((f: any) => f.type === FilterKey.DURATION)) {
|
||||
const { durationFilter } = settingsStore.sessionSettings;
|
||||
if (durationFilter?.count > 0) {
|
||||
const multiplier = durationFilter.countType === 'sec' ? 1000 : 60000;
|
||||
const amount = durationFilter.count * multiplier;
|
||||
const value = durationFilter.operator === '<' ? [amount, 0] : [0, amount];
|
||||
|
||||
filter.filters.push({
|
||||
type: FilterKey.DURATION,
|
||||
value,
|
||||
operator: 'is',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this.latestRequestTime = Date.now();
|
||||
this.latestList = List();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue