-
-
Notifications
You must be signed in to change notification settings - Fork 658
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: add usage of segment in list #3853
Conversation
sjaanus
commented
May 24, 2023
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -402,6 +402,8 @@ export interface ISegment { | |||
description?: string; | |||
project?: string; | |||
constraints: IConstraint[]; | |||
usedInProjects?: number; |
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.
does it have to be optional? Is there any scenario where we don't know the number?
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.
Yes, only case when we know the number is the when we load the list. Throughout app, other places, we dont know it about segment
src/lib/db/segment-store.ts
Outdated
@@ -97,8 +99,29 @@ export default class SegmentStore implements ISegmentStore { | |||
|
|||
async getAll(): Promise<ISegment[]> { | |||
const rows: ISegmentRow[] = await this.db | |||
.select(this.prefixColumns()) | |||
.select( |
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.
do we have any backend test that will tell us when this query breaks?
@@ -56,6 +65,10 @@ export const SegmentTable = () => { | |||
return segments; | |||
}, [segments, projectId]); | |||
|
|||
const columns = useMemo( |
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.
Is this part fine?