-
Notifications
You must be signed in to change notification settings - Fork 459
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(ui): list connections refactor, show end user profile #2897
Conversation
async getAllNames(environment_id: number): Promise<string[]> { | ||
const configs = await this.listProviderConfigs(environment_id); | ||
return configs.map((config) => config.unique_key); | ||
} |
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.
Dead code
@@ -50,7 +50,7 @@ export const MultiSelect: React.FC<MultiSelectArgs<any>> = ({ label, options, se | |||
return ( | |||
<Popover open={open} onOpenChange={setOpen}> | |||
<PopoverTrigger asChild> | |||
<Button variant="zombieGray" size={'xs'} className={cn('text-text-light-gray', isDirty && 'text-white')}> | |||
<Button variant="zombieGray" size={'sm'} className={cn('text-text-light-gray', isDirty && 'text-white')}> |
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.
Size were incorrect
subQuery.where(function () { | ||
this.whereRaw('connection_id ILIKE ?', `%${search}%`) | ||
.orWhereRaw('end_users.display_name ILIKE ?', `%${search}%`) | ||
.orWhereRaw('end_users.email ILIKE ?', `%${search}%`); |
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.
This part is not going to scale forever but looks okay for now
public async getAllNames(environment_id: number): Promise<string[]> { | ||
const connections = await this.listConnections(environment_id); | ||
return [...new Set(connections.map((config) => config.connection_id))]; | ||
return await query; |
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.
Check PR desc for query plan
return { total: 0, withError: 0 }; | ||
} | ||
|
||
return { total: Number(res.total_connection), withError: Number(res.with_error) }; |
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.
should this function return a Result instead of 0s when there is an error?
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.
imo this count is not a critical feature, if it fails I don't want to cut the rest of the API call. wdyt?
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.
The result can be handled so Err
is not blocking but at least this function semantic will be stronger. For example differentiating an error to having zero conns
.from(`_nango_connections`) | ||
.select<{ total_connection: string; with_error: string }>( | ||
db.knex.raw('COUNT(_nango_connections.*) as total_connection'), | ||
db.knex.raw('COUNT(_nango_connections.*) FILTER (WHERE _nango_active_logs.type IS NOT NULL) as with_error') |
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.
TIL I learn about pg FILTER :)
## Describe your changes Closes #2920 - Reup search in `GET /connections` This feature was forgotten will moving the endpoint code to the new format in #2897 Note that the behavior is slightly different now, not sure if I should introduce a new `search` prop to filter on everything and keep `connectionId` as it was before (filtering only connectionId)
Describe your changes
Fixes https://linear.app/nango/issue/NAN-1812/ui-for-userorganization-info-connections-screen
Major
Refactor the connections list page
Show end user profile, add avatar, search (connection id, profile display name), filter by integration, filter by errors
Move endpoint to file
GET /api/v1/connections
Move endpoint to file
GET /connections
Minor
Add new endpoint
/connections/count
It was used to display the error mark, since the main endpoints has pagination it was no longer good, it's also a bit more efficient now.
Add Connection button now uses Connect UI by default
We still have the fallback with the old version for a few weeks
Allow Connect UI for all env
Note the fix for self hosting is in a next PR
Screen.Recording.2024-10-29.at.16.57.07.mov
New query seems acceptable (results in prod replica):