data-privacy-task.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { i18n } from '#shared/i18n.ts'
  3. import type { DataPrivacyTask } from '#shared/graphql/types.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. }