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

626 save advanced searches #629

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

626 save advanced searches #629

wants to merge 23 commits into from

Conversation

elevchyt
Copy link
Contributor

@elevchyt elevchyt commented Oct 21, 2024

Saved searches added to the advanced searches modal.

Members can crud searches for themselves and can read organizational searches.
Operators and org admins are the only ones who may create/update/delete organizational searches.

closes #565

@elevchyt elevchyt linked an issue Oct 21, 2024 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Oct 21, 2024

Copy link
Collaborator

@trixobird trixobird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that the saved searches will be outside so they can apply different searches fast. Probably too late to make the change?

"groupUser": "User",
"groupOrganization": "Organization",
"save": "Save",
"saveTooltip": "Save / Save as",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"saveTooltip": "Save / Save as",
"saveTooltip": "Rename / Save / Save as",

You can update the name as well

if (values.saveType === SaveTypes.Update) isOrganization = props.isSelectedSearchOrganization;
const idToUpdate = values.saveType === SaveTypes.Update ? props.selectedSearchID : null;
props.handleSave(name, isOrganization, idToUpdate);
form.reset();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when the type is Update, we may want to order the searches again, since this is the current behavior. For example if I rename aaa to zzz, I would expect the updated entry to be on the bottom (which it does if you refresh)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem to behave that way (this is the fetched data withou updating).

image

value={selectedSearchID}
onChange={handleChange}
/>
<Save
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should save be enabled if there is no query?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, fixed!

});
return;
}
const responseID = res.data.upsertSearchQueryString.id;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Id instead of ID maybe? :)

@elevchyt
Copy link
Contributor Author

I was thinking that the saved searches will be outside so they can apply different searches fast. Probably too late to make the change?

Can do it in a different task if @dennis-adsviewer thinks that's better.

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

Successfully merging this pull request may close these issues.

Save advanced searches 'Save' advanced search strings as custom 'pre-loads'
2 participants