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: add usage of segment in list #3853

Merged
merged 5 commits into from
May 26, 2023
Merged

feat: add usage of segment in list #3853

merged 5 commits into from
May 26, 2023

Conversation

sjaanus
Copy link
Contributor

@sjaanus sjaanus commented May 24, 2023

image

@sjaanus sjaanus requested a review from kwasniew May 24, 2023 08:35
@vercel
Copy link

vercel bot commented May 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2023 11:12am
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2023 11:12am

@@ -402,6 +402,8 @@ export interface ISegment {
description?: string;
project?: string;
constraints: IConstraint[];
usedInProjects?: number;
Copy link
Contributor

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?

Copy link
Contributor Author

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 Show resolved Hide resolved
frontend/src/component/segments/SegmentTable.tsx Outdated Show resolved Hide resolved
@@ -97,8 +99,29 @@ export default class SegmentStore implements ISegmentStore {

async getAll(): Promise<ISegment[]> {
const rows: ISegmentRow[] = await this.db
.select(this.prefixColumns())
.select(
Copy link
Contributor

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?

@kwasniew kwasniew self-requested a review May 24, 2023 10:45
@@ -56,6 +65,10 @@ export const SegmentTable = () => {
return segments;
}, [segments, projectId]);

const columns = useMemo(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this part fine?

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

Successfully merging this pull request may close these issues.

None yet

2 participants