data-privacy-task.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { DataPrivacyTask } from '#shared/graphql/types.ts'
  3. import { i18n } from '#shared/i18n.ts'
  4. import type { ActivityMessageBuilder } from '../types.ts'
  5. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  6. const path = (metaObject: DataPrivacyTask) => {
  7. return '#'
  8. }
  9. const messageText = (
  10. type: string,
  11. authorName: string,
  12. metaObject?: DataPrivacyTask,
  13. ): Maybe<string> => {
  14. if (!metaObject) {
  15. return i18n.t('You can no longer see the data privacy task.')
  16. }
  17. const objectTitle = metaObject.deletableId || '-'
  18. switch (type) {
  19. case 'create':
  20. return i18n.t(
  21. '%s created data privacy task to delete user ID |%s|',
  22. authorName,
  23. objectTitle,
  24. )
  25. case 'update':
  26. return i18n.t(
  27. '%s updated data privacy task to delete user ID |%s|',
  28. authorName,
  29. objectTitle,
  30. )
  31. case 'completed':
  32. return i18n.t(
  33. '%s completed data privacy task to delete user ID |%s|',
  34. authorName,
  35. objectTitle,
  36. )
  37. default:
  38. return null
  39. }
  40. }
  41. export default <ActivityMessageBuilder>{
  42. messageText,
  43. path,
  44. model: 'DataPrivacyTask',
  45. }