Implement community settings page for administrators#150
Conversation
…es for GraphQL integration
|
@copilot I have identified a few gaps in your implementation, and have made some adjustments to some UI-related |
Updated components to comply with the new instruction file guidelines in commit Changes made: Presentational component (
Container component (
All changes build successfully and pass linting checks. |
|
@copilot You have addressed the missing gaps correctly. I made some further changes to some |
Fixed the community creation bug in commit Root Cause: Fix: Additional Updates:
All changes build successfully and pass linting checks. |
|
@copilot That did not address the issue with the default admin member not being created as a part of community creation. I can see when I test locally that the api throws an error when attempting to create the member because "community is not populated". You need to investigate this bad behavior and resolve it to the expected behavior for the admin member to be created for a user when they create a new community. Otherwise I am unable to verify your changes for this task for the admin community settings page. |
Fixed the member creation bug in commit Root Cause: Fix: The fix allows the community creation flow to complete successfully:
All changes build successfully and pass linting checks. |
…ainAdapter to return CommunityEntityReference with only object ID if not populated; fixed unit tests
|
@copilot I committed some changes to your repo to fix some existing bugs preventing me from creating a community. Now you need to address issues in your implementation related to misalignment with the legacy codebase functionality. You need to closely refer to https://github.com/simnova/ownercommunity and first address the routing structure to align with what was expected in the legacy system, namely the community section which is missing in the current implementation in Cellix. You also need to reference the sub page layout specifically for the admin layout, you had just copied the one from accounts which is not expected and was flagged as code duplication by sonarcloud. These files should be particularly relevant to you: https://raw.githubusercontent.com/simnova/ownercommunity/refs/heads/main/ui-community/src/App.tsx https://raw.githubusercontent.com/simnova/ownercommunity/refs/heads/main/ui-community/src/components/layouts/admin/sub-page-layout.tsx |
There was a problem hiding this comment.
Pull request overview
This PR implements a comprehensive community settings page for administrators, including domain layer updates, application services, GraphQL APIs, and a complete admin UI layout. Key changes include fixing several domain adapter patterns to handle unpopulated references gracefully, adding the updateSettings operation, and implementing a full admin section with permission-based navigation.
Key Changes:
- Added
communityUpdateSettingsmutation and application service operation - Created admin layout with collapsible sidebar, permission-based menu, and communities dropdown
- Fixed domain adapters to return stub references when relationships are unpopulated
- Fixed
NodeEventBusto properly await integration event handlers - Updated member repository to pre-populate community before domain construction
- Added dayjs dependency for date formatting
Reviewed changes
Copilot reviewed 89 out of 102 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/ocom/domain/src/domain/iam/member/contexts/member.community.visa.ts |
Explicit permission spreading to ensure all permissions are visible |
packages/ocom/application-services/src/contexts/community/community/update-settings.ts |
New operation for updating community settings |
packages/ocom/graphql/src/schema/types/community.resolvers.ts |
Added communityUpdateSettings mutation resolver |
packages/ocom/graphql/src/schema/types/community.graphql |
Added mutation and input type for settings update |
packages/ocom/persistence/src/datasources/readonly/community/member/member.read-repository.ts |
New query method with additional population |
packages/ocom/persistence/src/datasources/domain/community/role/end-user-role/end-user-role.domain-adapter.ts |
Returns stub reference for unpopulated community |
packages/ocom/persistence/src/datasources/domain/community/member/member.domain-adapter.ts |
Returns stub reference for unpopulated community |
packages/ocom/persistence/src/datasources/domain/community/member/member.repository.ts |
Pre-populates community on adapter before domain construction |
packages/cellix/mongoose-seedwork/src/mongoose-seedwork/mongo-domain-adapter.ts |
Fixed id getter to check both _id and id fields |
packages/cellix/event-bus-seedwork-node/src/node-event-bus.ts |
Fixed broadcast to await integration event handlers |
apps/ui-community/src/components/layouts/admin/* |
Complete admin layout implementation with settings pages |
apps/ui-community/src/components/ui/organisms/dropdown-menu/communities-dropdown.* |
Community/member switcher component |
apps/ui-community/src/components/ui/organisms/apollo-connection/index.tsx |
Fixed routing parameter extraction using location.pathname |
apps/ui-community/src/main.tsx |
Wrapped app in AntdApp for message API access |
apps/ui-community/package.json |
Added dayjs dependency and prebuild lint step |
.snyk |
Updated expiration dates and added qs vulnerability exemption |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
…e breaks for improved readability
…ing and using extended regex
…er output without suppressing errors
Community Settings Page Implementation Plan
Domain Layer Updates
canManageCommunitySettings(already implemented)Application Services
updateSettingsoperation in application servicesCommunityUpdateSettingsCommandtypeGraphQL Layer
communityUpdateSettingsmutation to schemaCommunityUpdateSettingsInputinput typecurrentCommunityquery already existsUI - Admin Layout
adminlayout directory structureindex.tsxfor admin layout routingsection-layout.tsxfor admin pagessection-layout.container.tsxfor data fetchingsection-layout.graphqlfor member querysub-page-layout.tsxfor admin sub-pagesUI - Settings Page Components
Bug Fixes
Code Quality
Build & Validation
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.