Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Admin] Manage Activity Categories in Admin Panel #992

Open
mehalyna opened this issue Dec 1, 2024 · 0 comments
Open

[Admin] Manage Activity Categories in Admin Panel #992

mehalyna opened this issue Dec 1, 2024 · 0 comments
Assignees
Milestone

Comments

@mehalyna
Copy link
Collaborator

mehalyna commented Dec 1, 2024

As an Admin,
I want to manage activity categories through the admin panel,
So that I can add, edit, or organize categories for company profiles efficiently.


Acceptance Criteria:

Category Management Interface:

  1. Category List Display:

    • A paginated table displays all existing activity categories.
    • Each row in the list shows the category name.
    • Pagination controls allow navigation between pages of categories (e.g., Next, Previous, specific page numbers).
  2. Edit Category:

    • When an admin clicks on a category name (e.g., Категорія 2):
      • A modal window opens with the following UI elements:
        • Editable text field pre-filled with the current category name.
        • "Зберегти" (Save) button: Saves the updated category name.
        • "Скасувати" (Cancel) button: Closes the modal without saving changes.
    • Upon saving:
      • The category name in the list updates dynamically.
      • A success message is displayed:
        "Категорію успішно оновлено!" (Category successfully updated!).
    • If an error occurs while saving, an error message appears:
      "Не вдалося оновити категорію. Спробуйте ще раз." (Failed to update the category. Please try again.).
  3. Add New Category:

    • A section at the bottom of the page allows adding a new category.
      • UI elements:
        • Input field labeled "Додайте категорію діяльності" (Add Activity Category) for entering the category name.
        • "Зберегти" (Save) button: Adds the new category.
        • "Скасувати" (Cancel) button: Clears the input field without saving.
    • Upon saving:
      • The new category is added to the top of the current list.
      • A success message appears:
        "Категорію успішно додано!" (Category successfully added!).
    • Validation ensures:
      • The category name is not empty.
      • Duplicate category names are not allowed.

Validation Rules:

  • The category name must:
    • Contain only valid characters (letters, numbers, and basic symbols like spaces or hyphens).
    • Be between 2 and 50 characters long.
  • The system checks for duplicates before saving:
    • If a duplicate exists, an error message is displayed:
      "Категорія з такою назвою вже існує." (A category with this name already exists.).

Pagination:

  • The page displays a maximum of 10 categories per page.
  • Pagination controls are available at the top and bottom of the list:
    • Next and Previous buttons.
    • Direct links to specific pages.

Audit Logging:

  • Every action performed by the admin (add, edit) is logged in the system, including:
    • The admin user performing the action.
    • The action type (add/edit).
    • Timestamp of the action.
    • Old and new category names (for edits).

Error Handling:

  • If the system cannot save or retrieve categories (e.g., database connection issue):
    • An error message is displayed:
      "Сталася помилка під час завантаження категорій. Спробуйте пізніше." (An error occurred while loading categories. Please try again later.).

UI Notes:

  1. Modal Window for Editing:

    • Centralized modal with a clear title (e.g., "Редагувати категорію" - Edit Category).
    • Buttons styled for easy distinction between Save and Cancel actions.
  2. Category Addition Field:

    • Input field is pre-cleared after saving.
    • Error or success messages are displayed inline below the input field.
  3. Real-Time Updates:

    • Any changes to categories (additions, edits) are immediately reflected in the list without requiring a page refresh.

Link to mockup:
https://www.figma.com/design/MFmFKJ2Qz8Sg78Jl5AuLh8/Forum-(Copy)?node-id=7579-30611&node-type=frame&t=y4XvNUcbLs4H0QXv-0


image

Epic link

@mehalyna mehalyna changed the title Manage Activity Categories in Admin Panel [Admin] Manage Activity Categories in Admin Panel Dec 1, 2024
@romanmyko romanmyko self-assigned this Dec 2, 2024
@romanmyko romanmyko added this to the Sprint 2 milestone Dec 3, 2024
@romanmyko romanmyko changed the title [Admin] Manage Activity Categories in Admin Panel [Admin] Manage Activity Categoryes in Admin Panel Dec 8, 2024
@romanmyko romanmyko changed the title [Admin] Manage Activity Categoryes in Admin Panel [Admin] Manage Activity Categories in Admin Panel Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants