-
Notifications
You must be signed in to change notification settings - Fork 46
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
Conversation
@@ -72,6 +73,11 @@ const ListFilter = ({ routerDomain, ...props }) => { | |||
/> | |||
: null | |||
} | |||
{ | |||
!props.filterValues.showSpecial | |||
? <TextInput label="Route prefix" source="routePrefix" alwaysOn resettable/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? <TextInput label="Route prefix" source="routePrefix" alwaysOn resettable/> | |
? <TextInput label="Route" source="route" alwaysOn resettable/> |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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}%`) |
There was a problem hiding this comment.
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
query.where('routes.route', 'like', `${filters.routePrefix}%`) | |
query.where('routes.route', 'like', `%${filters.route}%`) |
No description provided.