diff --git a/api/chalicelib/core/sessions.py b/api/chalicelib/core/sessions.py index 8dc87c90d..738a5e3d9 100644 --- a/api/chalicelib/core/sessions.py +++ b/api/chalicelib/core/sessions.py @@ -390,14 +390,14 @@ def search2_series(data: schemas.SessionsSearchPayloadSchema, project_id: int, d def __is_valid_event(is_any: bool, event: schemas._SessionSearchEventSchema): return not (not is_any and len(event.value) == 0 and event.type not in [schemas.EventType.request_details, - schemas.EventType.graphql_details] \ + schemas.EventType.graphql] \ or event.type in [schemas.PerformanceEventType.location_dom_complete, schemas.PerformanceEventType.location_largest_contentful_paint_time, schemas.PerformanceEventType.location_ttfb, schemas.PerformanceEventType.location_avg_cpu_load, schemas.PerformanceEventType.location_avg_memory_usage ] and (event.source is None or len(event.source) == 0) \ - or event.type in [schemas.EventType.request_details, schemas.EventType.graphql_details] and ( + or event.type in [schemas.EventType.request_details, schemas.EventType.graphql] and ( event.filters is None or len(event.filters) == 0)) @@ -698,12 +698,12 @@ def search_query_parts(data, error_status, errors_only, favorite_only, issue, pr event_where.append( _multiple_conditions(f"main.{events.event_type.REQUEST.column} {op} %({e_k})s", event.value, value_key=e_k)) - elif event_type == events.event_type.GRAPHQL.ui_type: - event_from = event_from % f"{events.event_type.GRAPHQL.table} AS main " - if not is_any: - event_where.append( - _multiple_conditions(f"main.{events.event_type.GRAPHQL.column} {op} %({e_k})s", event.value, - value_key=e_k)) + # elif event_type == events.event_type.GRAPHQL.ui_type: + # event_from = event_from % f"{events.event_type.GRAPHQL.table} AS main " + # if not is_any: + # event_where.append( + # _multiple_conditions(f"main.{events.event_type.GRAPHQL.column} {op} %({e_k})s", event.value, + # value_key=e_k)) elif event_type == events.event_type.STATEACTION.ui_type: event_from = event_from % f"{events.event_type.STATEACTION.table} AS main " if not is_any: @@ -891,7 +891,7 @@ def search_query_parts(data, error_status, errors_only, favorite_only, issue, pr print(f"undefined FETCH filter: {f.type}") if not apply: continue - elif event_type == schemas.EventType.graphql_details: + elif event_type == schemas.EventType.graphql: event_from = event_from % f"{events.event_type.GRAPHQL.table} AS main " for j, f in enumerate(event.filters): is_any = _isAny_opreator(f.operator) diff --git a/api/schemas.py b/api/schemas.py index bacceea78..f0f20e657 100644 --- a/api/schemas.py +++ b/api/schemas.py @@ -389,7 +389,6 @@ class EventType(str, Enum): request = "REQUEST" request_details = "FETCH" graphql = "GRAPHQL" - graphql_details = "GRAPHQL_DETAILS" state_action = "STATEACTION" error = "ERROR" click_ios = "CLICK_IOS" @@ -568,9 +567,9 @@ class _SessionSearchEventRaw(__MixedSearchFilter): elif values.get("type") == EventType.request_details: assert isinstance(values.get("filters"), List) and len(values.get("filters", [])) > 0, \ f"filters should be defined for {EventType.request_details.value}" - elif values.get("type") == EventType.graphql_details: + elif values.get("type") == EventType.graphql: assert isinstance(values.get("filters"), List) and len(values.get("filters", [])) > 0, \ - f"filters should be defined for {EventType.graphql_details.value}" + f"filters should be defined for {EventType.graphql.value}" return values diff --git a/frontend/app/components/Client/Sites/AddProjectButton/AddUserButton.tsx b/frontend/app/components/Client/Sites/AddProjectButton/AddUserButton.tsx index 078122bb2..7371056fd 100644 --- a/frontend/app/components/Client/Sites/AddProjectButton/AddUserButton.tsx +++ b/frontend/app/components/Client/Sites/AddProjectButton/AddUserButton.tsx @@ -1,29 +1,28 @@ import React from 'react'; -import { Popup, IconButton } from 'UI'; +import { Popup, Button, IconButton } from 'UI'; import { useStore } from 'App/mstore'; import { useObserver } from 'mobx-react-lite'; const PERMISSION_WARNING = 'You don’t have the permissions to perform this action.'; const LIMIT_WARNING = 'You have reached site limit.'; -function AddProjectButton({ isAdmin = false, onClick }: any ) { +function AddProjectButton({ isAdmin = false, onClick }: any) { const { userStore } = useStore(); const limtis = useObserver(() => userStore.limits); const canAddProject = useObserver(() => isAdmin && (limtis.projects === -1 || limtis.projects > 0)); return ( - - + + {/* + /> */} ); } -export default AddProjectButton; \ No newline at end of file +export default AddProjectButton; diff --git a/frontend/app/components/Client/Sites/NewSiteForm.js b/frontend/app/components/Client/Sites/NewSiteForm.js index 57713d981..c6633b73b 100644 --- a/frontend/app/components/Client/Sites/NewSiteForm.js +++ b/frontend/app/components/Client/Sites/NewSiteForm.js @@ -12,7 +12,7 @@ import { confirm } from 'UI'; site: state.getIn([ 'site', 'instance' ]), sites: state.getIn([ 'site', 'list' ]), siteList: state.getIn([ 'site', 'list' ]), - loading: state.getIn([ 'site', 'save', 'loading' ]), + loading: state.getIn([ 'site', 'save', 'loading' ]) || state.getIn([ 'site', 'remove', 'loading' ]), }), { save, remove, @@ -103,9 +103,11 @@ export default class NewSiteForm extends React.PureComponent { > {site.exists() ? 'Update' : 'Add'} - + {site.exists() && ( + + )} { this.state.existsError &&
diff --git a/frontend/app/components/ui/Button/Button.tsx b/frontend/app/components/ui/Button/Button.tsx index 075d95b33..bc71be3a0 100644 --- a/frontend/app/components/ui/Button/Button.tsx +++ b/frontend/app/components/ui/Button/Button.tsx @@ -10,6 +10,7 @@ interface Props { type?: 'button' | 'submit' | 'reset'; loading?: boolean; icon?: string; + rounded?: boolean; [x: string]: any; } export default (props: Props) => { @@ -22,10 +23,12 @@ export default (props: Props) => { disabled = false, children, loading = false, + rounded = false, ...rest } = props; - const classes = ['relative flex items-center h-10 px-3 rounded tracking-wide whitespace-nowrap']; + let classes = ['relative flex items-center h-10 px-3 rounded tracking-wide whitespace-nowrap']; + if (variant === 'default') { classes.push('bg-white hover:bg-gray-lightest border border-gray-light'); } @@ -62,6 +65,10 @@ export default (props: Props) => { iconColor = 'red'; } + if (rounded) { + classes = classes.map((c) => c.replace('rounded', 'rounded-full h-10 w-10 justify-center')); + } + return (