objectAttributes.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { defineStore } from 'pinia'
  3. import { useObjectAttributesScreen } from '#shared/entities/object-attributes/composables/useObjectAttributesScreen.ts'
  4. import type { EntityStaticObjectAttributes } from '#shared/entities/object-attributes/types/store.ts'
  5. import { EnumObjectManagerObjects } from '#shared/graphql/types.ts'
  6. export const staticObjectAttributes: EntityStaticObjectAttributes = {
  7. name: EnumObjectManagerObjects.Organization,
  8. attributes: [
  9. {
  10. name: 'created_by_id',
  11. display: __('Created by'),
  12. dataOption: {
  13. relation: 'User',
  14. },
  15. dataType: 'autocomplete',
  16. isStatic: true,
  17. isInternal: true,
  18. },
  19. {
  20. name: 'created_at',
  21. display: __('Created at'),
  22. dataType: 'datetime',
  23. isStatic: true,
  24. isInternal: true,
  25. },
  26. {
  27. name: 'updated_by_id',
  28. display: __('Updated by'),
  29. dataOption: {
  30. relation: 'User',
  31. },
  32. dataType: 'autocomplete',
  33. isStatic: true,
  34. isInternal: true,
  35. },
  36. {
  37. name: 'updated_at',
  38. display: __('Updated at'),
  39. dataType: 'datetime',
  40. isStatic: true,
  41. isInternal: true,
  42. },
  43. ],
  44. }
  45. export const useOrganizationObjectAttributesStore = defineStore(
  46. 'organizationObjectAttributes',
  47. () => {
  48. const { screenAttributes: viewScreenAttributes } =
  49. useObjectAttributesScreen(EnumObjectManagerObjects.Organization, 'view')
  50. return {
  51. viewScreenAttributes,
  52. }
  53. },
  54. )