Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix datetime picker and plugin dropdown #2820

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

PradyumnChauhan
Copy link

Commit message:
Advanced Search improvements (#2764): Fix datetime picker in Firefox & enhance plugin selection UX

@drosetti
Copy link
Contributor

drosetti commented Apr 4, 2025

I suggest to rebase you branch from develop branch. it's not updated, the last commit of the develop branch is older than a month and it has some old dependencies.

Talking about your message:

so i used modified formik fields and now its working fine
<AnalyzersMultiSelectDropdownInput
formik={{
...formik,
values: {
...formik.values,
type: "", // override type to a falsey value
},
}}
fieldName="analyzers"
/>

can you verify it

I used the dropdown to select the Classic_DNS and when I press "search" and error Query failed! is shown. Did you check it works ?

However it's not needed to send the code, I can view it from the draft 😄

@PradyumnChauhan
Copy link
Author

ok let me check

@PradyumnChauhan
Copy link
Author

TypeError: Cannot read properties of undefined (reading 'config')
at AxiosLoadingBar.jsx:28:1
at async Axios.request (Axios.js:40:1)
at async pluginReportQueries (searchApi.jsx:14:1)
at async onSubmit (Search.jsx:118:1)

getting this config error ??

@drosetti
Copy link
Contributor

drosetti commented Apr 8, 2025

There is no config in axios. In fact the error is here:

...
at async pluginReportQueries (searchApi.jsx:14:1)
at async onSubmit (Search.jsx:118:1)

This means onSubmit function in Search.jsx call pluginReportQueries function in searchApi.jsx and the error is here. I suppose you have changed something here and the request is malformed

@PradyumnChauhan
Copy link
Author

i didnt change anything in the pluginreportqueries also checked those files... cant find the error ... it is working fine with the regular input box in the name field but when im using the multiselectdropdown its giving me this error

@drosetti
Copy link
Contributor

drosetti commented Apr 8, 2025

pluginreportqueries is called with the data in the Search as params, if you change the ui component you change the way the data are memorized in the component and the data send in the request

@PradyumnChauhan
Copy link
Author

The issue is in the queryparams im parsing to the api .
whenever i pass these params

observableType: JobTypes.OBSERVABLE, classification: ObservableClassifications.GENERIC, type: [], name: "", status: "", fromStartTime: defaultStartDateStr, toStartTime: format(new Date(), isoFormatString), fromEndTime: defaultStartDateStr, toEndTime: format(new Date(), isoFormatString), errors: "", report: "", analyzers: [] , connectors: [], pivots:[]

i get this config error above
but whenever i pass all the params instead of these three analyzers: [] , connectors: [], pivots:[]

then its working fine
but the problem in the second approach we cannot send multiple plugin names at a time

solution is --> we can extract all the plugin names selected from the analyzersmultiselectdropdown and then parse to the name field in the queryparams ( by making it an object )... i think still it doesnt work because backend is expecting only one plugin name at a time ... so what to do now??

also correct me if i am wrong

@drosetti
Copy link
Contributor

drosetti commented Apr 9, 2025

but whenever i pass all the params instead of these three analyzers: [] , connectors: [], pivots:[]
You cannot pass only these parameter or won't be possible to do filters on other params and the UX is worst.

I think the best thing to do is extract the plugin names from the multiple dropdown element and pass the list of string to the method and the backend should accept a list of string instead of a single one

@PradyumnChauhan
Copy link
Author

Screen.Recording.2025-04-09.181533.mp4

now im able to send the pluginreportqueries with multiple plugins here the queryparams structure:
{ "start_start_time": "2025-03-10T12:49:00.000Z", "end_start_time": "2025-04-09T12:49:00.000Z", "start_end_time": "2025-03-10T12:49:00.000Z", "end_end_time": "2025-04-09T12:49:00.000Z", "observableType": "observable", "classification": "generic", "plugin_name": [ "CRXcavator", "CriminalIp", "AbuseSubmitter", "AbuseIpToSubmission" ], "name": "", "status": "", "errors": "", "report": "", "page": 1, "page_size": 10 }

but im seeing the Service not supported error ... i think its because PermissionDenied: If the requesting user does not belong to any organization. in the backend
but i also created an org and then try it .. still not working
but the main issue is to send multiple plugin request at once can you check it now

@drosetti
Copy link
Contributor

Is elastic correctly configured (containers are running if you are using the local instance and the env var in any case)? I think the org is not a related problem, even if you don't create and org, it has to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants