Status
Built, and appears to match requirements. This issue is mainly a verification/close-out pass, not new implementation,
unless the checks below turn up a real gap.
What's there
Implemented as an in-screen confirmation dialog on OrgDetailScreen (OrgDetailDialogState.ConfirmLeave), not a
separate screen — this matches edifikana/mockups/organization-detail.html, whose leave confirmation is an inline
modal, not a dedicated route.
- UI:
OrgDetailContent's LeaveButton is disabled when uiState.isSoleOwner, with caption "Transfer ownership
before leaving" (OrgDetailScreen.kt).
- Sole-owner detection: computed client-side in
OrgDetailViewModel.initialize() from the member list
(ownerCount == 1 && myMembership.role == OWNER).
- Confirm flow:
confirmLeaveOrganization() calls MembershipManager.leaveOrganization(orgId), navigates to
SettingsDestination.MyOrganizationsDestination (clearing the back stack) on success, shows a snackbar on failure.
- Backend independently enforces the same rule server-side (defense in depth, not just a client check):
MembershipService.leaveOrganization() throws if isSoleOwner(orgId, callerId)
(edifikana/back-end/.../service/MembershipService.kt).
Verification pass
Files
edifikana/front-end/app/src/commonMain/.../features/settings/organizations/orgdetail/{OrgDetailScreen,OrgDetailViewModel,OrgDetailUIState}.kt
edifikana/front-end/app/src/commonMain/.../features/settings/organizations/myorganizations/MyOrganizationsScreen.kt
edifikana/back-end/src/main/kotlin/com/cramsan/edifikana/server/service/MembershipService.kt
Related
Parent: #392.
Status
Built, and appears to match requirements. This issue is mainly a verification/close-out pass, not new implementation,
unless the checks below turn up a real gap.
What's there
Implemented as an in-screen confirmation dialog on
OrgDetailScreen(OrgDetailDialogState.ConfirmLeave), not aseparate screen — this matches
edifikana/mockups/organization-detail.html, whose leave confirmation is an inlinemodal, not a dedicated route.
OrgDetailContent'sLeaveButtonis disabled whenuiState.isSoleOwner, with caption "Transfer ownershipbefore leaving" (
OrgDetailScreen.kt).OrgDetailViewModel.initialize()from the member list(
ownerCount == 1 && myMembership.role == OWNER).confirmLeaveOrganization()callsMembershipManager.leaveOrganization(orgId), navigates toSettingsDestination.MyOrganizationsDestination(clearing the back stack) on success, shows a snackbar on failure.MembershipService.leaveOrganization()throws ifisSoleOwner(orgId, callerId)(
edifikana/back-end/.../service/MembershipService.kt).Verification pass
OrgDetailViewModelTestcovers: sole-owner disables the button, non-sole-owner leave success path,leave API failure path
confirmLeaveOrganization()currently always navigates toMyOrganizationsDestinationon success, regardless of how many organizations remain. Decide whether a user with zero remaining
organizations after leaving should instead land on a Create/Join Organization flow — and check whether
MyOrganizationsScreeneven has an empty-state UI today (a scan ofMyOrganizationsScreen.ktfound none).Files
edifikana/front-end/app/src/commonMain/.../features/settings/organizations/orgdetail/{OrgDetailScreen,OrgDetailViewModel,OrgDetailUIState}.ktedifikana/front-end/app/src/commonMain/.../features/settings/organizations/myorganizations/MyOrganizationsScreen.ktedifikana/back-end/src/main/kotlin/com/cramsan/edifikana/server/service/MembershipService.ktRelated
Parent: #392.