so that I can tailor them to better suit my family's requirements
Description
Acceptance Criteria
Each category in a categories list has an "Edit" button.
Clicking "Edit" opens a modal window:
with a confirmation dialog, if the categorie is used in any active tasks or
with a form pre-filled with the categorie's existing values for modification with the heading "Edit a category" and "Update" button to submit the form, if the categorie is not used in any active tasks
The confirmation dialog includes options for both confirming the intention to edit and cancelling the action.
Upon confirmation, a pre-filled form for editing opens in a modal window.
The edit window includes options for both saving by clicking on the "Update" button and cancelling the action by clicking the background.
After saving the changes, the modal window with the form closes and the user sees a categories list with the updated categorie.
Tasks
create a branch feature/edit-category.
add a button with edit-icon to each category in the categories list page.
create a variable to check if the category to edit is used in any active tasks.
implement the logic to handle clicking on edit button to display a modal window with an appropriate message with confirmation prompt with "No" and "Yes" buttons, if the category is used, or a modal window with a component CategoryForm if not.
implement the logic to close a modal window upon clicking on "No" button.
pass the values of the editing categorie to the form field and set the appropriate text for the heading and submit button.
create a function handleEditCategory in _app.js and use it in CategoryForm to handle form submission.
Edit Category
Value Proposition
As a family member,
I want to modify category names for tasks ,
so that I can tailor them to better suit my family's requirements
Description
Acceptance Criteria
button
.button
to submit the form, if the categorie is not used in any active tasksbutton
and cancelling the action by clicking the background.Tasks
button
with edit-icon to each category in the categories list page.button
to display a modal window with an appropriate message with confirmation prompt with "No" and "Yes" buttons, if the category is used, or a modal window with a componentCategoryForm
if not.button
.form
field and set the appropriate text for the heading and submitbutton
.handleEditCategory
in _app.js and use it inCategoryForm
to handle form submission.