code4romania / code4romania/vic

Template Management

Open
#359 0 comments 0 reactions 0 assignees View on GitHub
enhancement :rocket: web-app
Dominant language
TypeScript
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## User Story

As user, I want to manage contract templates for volunteers, so that I can ensure consistency in our organizational documents.

## Description

The system should allow users to view, edit, duplicate and delete contract templates.

## Actors

* Web Users

## Preconditions

* User must be logged in and have navigated to the 'Template-uri' tab

## Main Flow 1 (view template)

1. User selects a template and clicks on the kebab menu.
2. The system presents the following options: _Vizualizeaza_, _Editeaza_, _Fa o copie_, _Descarca necompletat_, and _Elimina_.
3. User clicks on the _Vizualizeaza_ option.
4. The system displays the template in view mode.
5. User has the option to download the template as a PDF.

## Main Flow 2 (edit template)

1. User selects a template and clicks on the kebab menu.
2. The system presents the following options: _Vizualizeaza_, _Editeaza_, _Fa o copie_, _Descarca necompletat_, and _Elimina_.
3. User clicks on the _Editeaza_ option.
4. The system displays the template in edit mode
5. User updates the inputs according to preferences and clicks 'Save changes'.
6. The system saves the updated template.

## Alt. Flow 1 (duplicate template)

1. User selects a template and clicks on the kebab menu.
2. The system presents the following options: _Vizualizeaza_, _Editeaza_, _Fa o copie_, _Descarca necompletat_, and _Elimina_.
3. User clicks on the _Fa o copie_ option.
4. The system creates a copy of the template and updates the list to include the new copy.
5. The system displays a toast message confirming the successful operation.

## Alt. Flow 2 (download template)

1. User selects a template and clicks on the kebab menu.
2. The system presents the following options: _Vizualizeaza_, _Editeaza_, _Fa o copie_, _Descarca necompletat_, and _Elimina_.
3. User clicks on the _Fa o copie_ option.
4. The system creates a copy of the template and updates the list to include the new copy.
5. A toast message is displayed confirming the successful operation.

## Alt. Flow 3 (delete template)

1. User selects a template and clicks on the kebab menu.
2. The system presents the following options: _Vizualizeaza_, _Editeaza_, _Fa o copie_, _Descarca necompletat_, and _Elimina_.
3. User clicks on the _Elimina_ option.
4. The system displays a confirmation modal.
5. User confirms the deletion by clicking 'Sterge' button.
6. The system deletes the template.

## Business Rules
1. The _Editeaza_ and _Elimina_ options must only be available for templates that have not been used to generate a contract.
2. Both View mode and Edit mode must include an option for users to download the template.
3. The delete option must trigger a confirmation modal to verify the user's action before proceeding.

## Acceptance Criteria

1. The system must display the following options for each template based on the number of uses:
* For templates with 0 uses: _Vizualizeaza_, _Editeaza_, _Fa o copie_, _Descarca necompletat_, and _Elimina_.
* For templates with more than 0 uses: _Vizualizeaza_, _Fa o copie_, _Descarca necompletat_.
2. The option to download the template must be available in both View mode and Edit mode.
3. Newly created templates using the copy function must be named by appending "_copy" to the original template's name.
4. If multiple copies of the same template are created, subsequent copies will be named with incremental suffixes, such as "_copy(1)", "_copy(2)", and so on.
5. For templates created via the copy function, the 'Creat de' value must reflect the name of the user who made the copy.
6. Upon confirming the deletion by clicking 'Sterge' button, the system must delete the template and update the list accordingly.

## Additional Information

* Figma references: [here](https://www.figma.com/design/fBxQarllPrE9kEt22bIBa1/VIC-(Management-de-voluntari)-%2F-ex.-TEO?node-id=11392-15740&t=Z4lx782XsRhr8NG5-4)

## Subtasks:

- [ ] Pull more data from ONGHub to make it available for template generation (organization cui, legal representative and his role)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.