Skip to content

Added ability to remove timelogs

What does this MR do and why?

#356796

This MR adds the possibility to delete a timelog using a GraphQL mutation.

Only the user who added the timelog and maintainers of the project can actually delete it, all the other users will get an unauthorized error.

Screenshots or screen recordings

delete-timelog

How to set up and validate locally

  1. Add a timelog to either an issue or a merge request
  2. Try to delete the timelog entry using the new timelogDelete mutation from the GraphiQL explorer
    mutation {
     deleteTimelog(input:
     {
       id: "gid://gitlab/Timelog/7"
     }) {
      timelog {
       id
       timeSpent
       spentAt
       summary
      }
     errors
     }
    }
    
    • If the logged in user is the one who added the timelog (or a maintainer of the project) the request will succeed returning the informations of the deleted timelog
    • Otherwise the request will fail providing an unauthorized error message
    • If the timelog for the provided id doesn't exist the request fails with the appropriate error message

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marco Zille

Merge request reports

Loading