Skip to content

[FEATURE] Organization Detail #542

Description

@CRamsan

Status

Partially built — the screen exists but has drifted from the current mockup. This is a targeted fix, not a rewrite.

What's already there

OrgDetailScreen.kt + OrgDetailViewModel.kt + OrgDetailUIState.kt + OrgDetailEvent.kt + preview + test at
edifikana/front-end/app/src/commonMain/.../features/settings/organizations/orgdetail/, registered as
SettingsDestination.OrganizationDetailDestination(orgId), reached from MyOrganizationsScreen.

It renders the org name + "Active" badge, an info card (role, members, joined), a "Transfer Ownership" row (Owner only,
navigates to #545), and a "Leave Organization" button (dialog handled by #544).

Gap vs. mockup (edifikana/mockups/organization-detail.html)

The mockup's info card has four rows: Your Role, Members, Properties, Joined. The built InfoCard
(OrgDetailScreen.kt) only has three — property count is missing: no field in OrgDetailUIState, not fetched in
OrgDetailViewModel.initialize().

This is a known, solved pattern elsewhere in the codebase: MyOrganizationsViewModel already computes a per-org
property count via PropertyManager.getPropertyList() grouped by organizationId (see
propertyCountsByOrg in MyOrganizationsViewModel.kt, used to render "Admin · 3 properties" on each org card).
OrgDetailViewModel.initialize() should do the equivalent for the single orgId it's loading.

Open question

No mockup currently shows an entry point into the new Organization Edit screen (#543). Decide where that action goes on
this screen (e.g. a top-bar edit icon, gated to ADMIN/OWNER to match the backend's hasRoleOrHigher(..., UserRole.ADMIN)
check) — this likely needs a mockup update done alongside #543, plus a SettingsDestination.OrganizationEditDestination
navigation call added here.

Acceptance criteria

  • OrgDetailUIState gains a propertyCount: Int field
  • OrgDetailViewModel.initialize() fetches and populates it via PropertyManager.getPropertyList() filtered to orgId
  • InfoCard renders a "Properties" row between Members and Joined, matching the mockup's row order
  • OrgDetailViewModelTest covers the new field (happy path + fetch failure)
  • Entry point to Organization Edit ([FEATURE] Organization Edit screen #543) is decided and wired

Files

  • edifikana/front-end/app/src/commonMain/kotlin/com/cramsan/edifikana/client/lib/features/settings/organizations/orgdetail/{OrgDetailScreen,OrgDetailViewModel,OrgDetailUIState}.kt
  • edifikana/front-end/app/src/jvmTest/kotlin/com/cramsan/edifikana/client/lib/features/settings/organizations/orgdetail/OrgDetailViewModelTest.kt
  • Reference pattern: edifikana/front-end/app/src/commonMain/.../features/settings/organizations/myorganizations/MyOrganizationsViewModel.kt

Related

Parent: #392. Loosely coordinated with #543 (entry-point + mockup decision) — not a hard blocker, the property-count fix
is self-contained.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions