ugent-library/deliver

Postpone button (extend folder expiration date by one month)

mietcls opened this issue · 1 comments

Enhancement

I can postpone the expiration date of a folder by one month
Screenshot 2023-12-08 at 10 30 59
https://biblio-backend-ugent-prototype.vercel.app/deliver/spaces/folders/folder-name.html

Scenario & success criteria

I create a folder. A little before the deadline, I see no downloads have happened yet...

  • In the folder, I can ask to postpone the expiration date of that folder for a month
    • The current expiration date is the creation date + 30 days
    • The new expiration date is the expiration date + 30 days
    • You can repeat this process if needed
      This case is needed for holidays and anticipated issues
  • I am asked to confirm whether I want to do this
  • The expiration date is adapted (up with one month), and toaster confirms that it happened, and disappears after 3000ms
  • This is also reflected in the table and sorting of the table #73

Implementation

Add a button to the header inside a folder

Screenshot 2023-12-08 at 10 23 37

<button class="btn btn-link btn-link-muted">
    <i class="if if-arrow-go-back"></I>
    <span class="btn-text">Postpone expiration</span>
</button>

https://biblio-backend-ugent-prototype.vercel.app/deliver/spaces/folders/folder-name.html

Open a modal to confirm

Screenshot 2023-12-08 at 10 23 41

<div class="modal show" tabindex="-1" role="dialog" aria-modal="true" style="display: block;">
    <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-body">
                <div class="c-blank-slate c-blank-slate-muted">
                    <div class="bc-avatar bc-avatar--medium">
                        <i class="if if-arrow-go-back"></i>
                    </div>
                    <h1 class="h3">Postpone the expiration date of
                        <br>Folder name by one month
                    </h1>
                    <p>Current expiration date: 2023-12-21
                        <br>Expiration date after postponing: 2024-01-21
                    </p>
                </div>
            </div>
            <div class="modal-footer">
                <div class="bc-toolbar">
                    <div class="bc-toolbar-left">
                        <div class="bc-toolbar-item">
                            <button class="btn btn-link" data-bs-dismiss="modal">Cancel</button>
                        </div>
                    </div>
                    <div class="bc-toolbar-right">
                        <div class="bc-toolbar-item">
                            <button class="btn btn-primary">Postpone</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

Confirm with toaster (disappears after 300ms)

Screenshot 2023-12-08 at 10 31 30
<div class="toast-body">
    <i class="if if--success if-check-circle-fill mt-1"></i>
    <div class="toast-content">
        <p>New expiration date for Folder Name: 2024-01-21</p>
    </div>
    <button class="btn-close"></button>
</div>

https://biblio-backend-ugent-prototype.vercel.app/deliver/spaces/folders/folder-name--postponed.html

Context

Sometimes, especially during holidays or during busy periods, people don't pick up their files in time. We can see this by the download count. Librarians have asked to keep it alive for a little longer (BKT + PPW – Amber).

Got some feedback and refined together with @verheyenkoen, reopening for a small adjustment.