-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
1. User Story & Rationale
- Parent Epic Issue: Ability to edit songs #75
- DDD Subdomain: Songs
- User Story: As an Administrator, I want to access an editing interface for any song directly from the song list so that I can quickly make necessary corrections.
- Rationale: This feature provides the primary user interface for administrators to modify song attributes, which is a core capability of the "Ability to Edit Songs" epic.
2. Acceptance Criteria (BDD Scenarios)
Scenario 1: Successful Song Edit
- Scenario Name: Administrator successfully edits and saves a song.
- GIVEN: An administrator is viewing the list of songs.
- WHEN: The administrator clicks the "Edit" button for a specific song.
- AND: They modify the
titleandbodyin the form. - AND: They click the "Save" button.
- THEN: The system saves the changes and redirects the administrator back to the song list.
- AND: The updated
titleis visible in the song list. - AND: A confirmation message like "Song updated successfully" is displayed.
Scenario 2: Unauthorized User Access
- Scenario Name: A non-administrator attempts to access the edit form.
- GIVEN: A user is logged in who is not an administrator.
- WHEN: The user attempts to navigate directly to the "Edit Song" URL.
- THEN: The system denies access and redirects the user to an appropriate error page (e.g., "Unauthorized").
Scenario 3: Cross-Organization Access by Administrator
- Scenario Name: An administrator from one organization attempts to edit a song from another.
- GIVEN: An administrator for "Organization A" is logged in.
- AND: A song exists that belongs to "Organization B".
- WHEN: The administrator from "Organization A" attempts to access the "Edit Song" page for the song belonging to "Organization B".
- THEN: The system denies access and returns a "Not Found" or "Unauthorized" error.
Scenario 4: Invalid Song Edit
- Scenario Name: Administrator attempts to save a song with invalid data.
- GIVEN: An administrator is on the "Edit Song" form.
- WHEN: The administrator clears the
titlefield, leaving it blank. - AND: They click the "Save" button.
- THEN: The system does not save the changes.
- AND: It displays a validation error message, such as "Title can't be blank," next to the
titlefield. - AND: The form remains on the screen with the invalid data entered by the user.
3. UI/UX Flow
- Navigate to Song List: The Administrator navigates to the
/admin/songspage, which displays a table of all songs. - Initiate Edit: The Administrator clicks the "Edit" button next to a song in the list.
- Display Edit Form: The system navigates to
/admin/songs/:id/edit. The page displays a form with the following fields pre-populated with the song's current data:Title(text input)Body(textarea)
- Modify and Save: The Administrator modifies the
Titleand/orBodyand clicks the "Save" button. - Confirm and Redirect: The system saves the changes to the database, displays a flash message saying "Song updated successfully," and redirects the Administrator back to the song list at
/admin/songs. - Cancel Edit: If the Administrator clicks the "Cancel" button, the system discards any changes and redirects them back to the song list at
/admin/songs.
4. Permissions
- Administrator:
- Can access the "Edit Song" page.
- Can view and modify the
titleandbodyfields. - Can save changes to a song within their own organization.
- Congregation Member:
- Cannot access the "Edit Song" page.
- Any attempt to navigate to the edit URL will result in an "Unauthorized" error.
- Unauthenticated User:
- Cannot access the "Edit Song" page.
- Any attempt to navigate to the edit URL will result in a redirection to the login page.
5. Out of Scope
- Creating new songs: This will be handled in a separate feature.
- Deleting songs: This will be handled in a separate feature.
- Displaying a preview of the song's body in the song list: This will be handled in issue Feature: Display song body preview in the song list #87.
Metadata
Metadata
Assignees
Labels
No labels