group.ts 818 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. import { i18n } from '@shared/i18n'
  3. import type { Group } from '@shared/graphql/types'
  4. import type { ActivityMessageBuilder } from '../types'
  5. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  6. const path = (metaObject: Group) => {
  7. return '#'
  8. }
  9. const messageText = (
  10. messageType: string,
  11. authorName: string,
  12. metaObject: Group,
  13. ): Maybe<string> => {
  14. const objectTitle = metaObject.name || '-'
  15. switch (messageType) {
  16. case 'create':
  17. return i18n.t('%s created group |%s|', authorName, objectTitle)
  18. case 'update':
  19. return i18n.t('%s updated group |%s|', authorName, objectTitle)
  20. default:
  21. return null
  22. }
  23. }
  24. export default <ActivityMessageBuilder>{
  25. messageText,
  26. path,
  27. model: 'Group',
  28. }