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

feat: ability to filter ILC Routes in registry by route string #295

Merged
merged 1 commit into from
May 12, 2021

Conversation

StyleT
Copy link
Contributor

@StyleT StyleT commented May 12, 2021

No description provided.

@StyleT StyleT requested a review from nightnei May 12, 2021 14:40
@@ -72,6 +73,11 @@ const ListFilter = ({ routerDomain, ...props }) => {
/>
: null
}
{
!props.filterValues.showSpecial
? <TextInput label="Route prefix" source="routePrefix" alwaysOn resettable/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
? <TextInput label="Route prefix" source="routePrefix" alwaysOn resettable/>
? <TextInput label="Route" source="route" alwaysOn resettable/>

Copy link
Contributor

@nightnei nightnei May 12, 2021

Choose a reason for hiding this comment

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

why do you use word "prefix"? I think label can be just "Route" and source="route" or "routePath"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To emphasise that it is a prefix based search. Ex:
/foo maches: /foo, /foo/ & /foo/bar but doesn't match /test/foo

@@ -16,6 +16,10 @@ const getAppRoutes = async (req: Request, res: Response) => {
query.where('routes.route', 'like', `${SPECIAL_PREFIX}%`);
} else {
query.whereNot('routes.route', 'like', `${SPECIAL_PREFIX}%`);

if (filters.routePrefix !== undefined) {
query.where('routes.route', 'like', `${filters.routePrefix}%`)
Copy link
Contributor

Choose a reason for hiding this comment

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

and here it's better to allow whole search with "%" at the beginning

Suggested change
query.where('routes.route', 'like', `${filters.routePrefix}%`)
query.where('routes.route', 'like', `%${filters.route}%`)

@nightnei nightnei self-requested a review May 12, 2021 14:51
@StyleT StyleT merged commit a523457 into master May 12, 2021
@StyleT StyleT deleted the feature/filter_routes_by_route_string branch May 12, 2021 15:04
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