-
Notifications
You must be signed in to change notification settings - Fork 22
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
Create data model and transformers for Organization type #9152
Conversation
…create-organization-data-model
@@ -46,7 +46,7 @@ export type SharingType = | |||
export type SharingSource = { | |||
type: SharingType; | |||
label: string; | |||
organization?: Nullishable<Organization>; | |||
organization?: Nullishable<AuthUserOrganization>; |
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 was just the wrong type. Fixing the types revealed that
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9152 +/- ##
==========================================
+ Coverage 74.24% 74.84% +0.59%
==========================================
Files 1332 1355 +23
Lines 40817 41809 +992
Branches 7634 7802 +168
==========================================
+ Hits 30306 31291 +985
- Misses 10511 10518 +7 ☔ View full report in Codecov by Sentry. |
Playwright test resultsDetails Open report ↗︎ Flaky testschrome › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod Skipped testschrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor |
.filter( | ||
(organization) => | ||
organization.members?.some( | ||
(member) => | ||
// If the current user is an admin of the organization, then all of the members are listed for the organization | ||
// Otherwise, only the current user is listed for the organization | ||
// So if any listed member is an admin, the current user is an admin | ||
member.role === UserRole.admin, | ||
), | ||
) |
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.
Removes the need for the lifted role. See: https://github.com/pixiebrix/pixiebrix-extension/pull/9152/files#r1759350434
export type Organization = components["schemas"]["Organization"] & { | ||
// The `role` property is added in the Redux RTK definition for getOrganizations (see api.ts) | ||
// WARNING: currently this role is only accurate for Admin. All other users are passed as Restricted even if they have | ||
// a Member or Developer role on the team | ||
role: UserRole; | ||
}; | ||
|
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 type was never useful/accurate. See: https://github.com/pixiebrix/pixiebrix-extension/pull/9152/files#r1759349672
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.
Ready to approve once changes are made to OrganizationMember -> OrganizationMembership prefix
No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack. Do not edit this comment manually. |
What does this PR do?
Discussion
For more information on our expectations for the PR process, see the
code review principles doc