feat: add user skills#8
Open
dsh0416 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds “skills” to user profiles end-to-end (DB → API → frontend), while also tightening who can update a user profile (owner or system admin) and reflecting that capability in the UI.
Changes:
- Persist
skillsonusers(migration + model normalization/validation) and expose it via the users API + OpenAPI schema. - Add frontend types + UI for editing and viewing skills in the user profile form/details.
- Enforce profile-update authorization in
UserPolicy#update?and adjust request/OpenAPI specs accordingly.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/views/UserProfileView.vue | Adds canEditProfile gating for edit UI and messaging. |
| frontend/src/views/UserGroupsView.vue | Computes edit capability, updates current-user after profile save, passes can-edit-profile prop. |
| frontend/src/stores/auth.ts | Adds replaceCurrentUser to sync auth store when editing self. |
| frontend/src/stores/tests/userGroups.spec.ts | Updates test fixtures to include skills. |
| frontend/src/services/api/types.ts | Adds UserSkill/UserSkillLevel types and wires skills into User and UserProfileInput. |
| frontend/src/router/tests/access.spec.ts | Updates route-access test user fixture to include skills. |
| frontend/src/components/user-groups/UserProfileForm.vue | Adds skills editor UI and submission mapping to UserProfileInput. |
| frontend/src/components/user-groups/UserProfileDetails.vue | Displays skills list with level badges. |
| backend/spec/requests/api/v1/users_spec.rb | Adds request specs for skills update/validation + update authorization behavior. |
| backend/spec/requests/api/v1/openapi/users_spec.rb | Updates OpenAPI request examples to include skills. |
| backend/spec/openapi_helper.rb | Extends OpenAPI schema with skills and profile_skill. |
| backend/spec/models/user_spec.rb | Adds model specs for skills normalization/validation. |
| backend/spec/factories/users.rb | Ensures users factory includes skills: []. |
| backend/openapi/v1/openapi.yaml | Updates generated OpenAPI YAML with skills and profile_skill. |
| backend/db/schema.rb | Reflects skills column addition. |
| backend/db/migrate/20260709110000_add_skills_to_users.rb | Adds skills JSON column to users. |
| backend/app/views/api/v1/users/_user.json.jbuilder | Includes skills in user JSON payload. |
| backend/app/policies/user_policy.rb | Restricts profile updates to self or system admin. |
| backend/app/models/user.rb | Adds skills normalization, validation, and search indexing content/metadata. |
| backend/app/controllers/api/v1/users_controller.rb | Permits nested skills params for profile update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
57
to
62
| async function saveUserProfile(userId: number, input: UserProfileInput) { | ||
| let updatedUser | ||
|
|
||
| try { | ||
| await userGroupsStore.updateUserProfile(userId, input) | ||
| updatedUser = await userGroupsStore.updateUserProfile(userId, input) | ||
| } catch (err) { |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.