ticket-object-attributes.ts 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { ObjectManagerFrontendAttributesPayload } from '#shared/graphql/types.ts'
  3. export default (): ObjectManagerFrontendAttributesPayload => ({
  4. attributes: [
  5. {
  6. name: 'title',
  7. display: 'Title',
  8. dataType: 'input',
  9. dataOption: {
  10. type: 'text',
  11. maxlength: 200,
  12. null: false,
  13. translate: false,
  14. },
  15. isInternal: true,
  16. screens: {
  17. create_top: {
  18. null: false,
  19. },
  20. edit: {},
  21. },
  22. __typename: 'ObjectManagerFrontendAttribute',
  23. },
  24. {
  25. name: 'customer_id',
  26. display: 'Customer',
  27. dataType: 'user_autocompletion',
  28. dataOption: {
  29. relation: 'User',
  30. autocapitalize: false,
  31. multiple: false,
  32. guess: true,
  33. null: false,
  34. limit: 200,
  35. placeholder: 'Enter Person or Organization/Company',
  36. minLengt: 2,
  37. translate: false,
  38. permission: ['ticket.agent'],
  39. belongs_to: 'customer',
  40. },
  41. isInternal: true,
  42. screens: {
  43. create_top: {
  44. null: false,
  45. },
  46. edit: {},
  47. },
  48. __typename: 'ObjectManagerFrontendAttribute',
  49. },
  50. {
  51. name: 'organization_id',
  52. display: 'Organization',
  53. dataType: 'autocompletion_ajax_customer_organization',
  54. dataOption: {
  55. relation: 'Organization',
  56. autocapitalize: false,
  57. multiple: false,
  58. null: true,
  59. translate: false,
  60. permission: ['ticket.agent', 'ticket.customer'],
  61. belongs_to: 'organization',
  62. },
  63. isInternal: true,
  64. screens: {
  65. create_top: {
  66. null: false,
  67. },
  68. edit: {},
  69. },
  70. __typename: 'ObjectManagerFrontendAttribute',
  71. },
  72. {
  73. name: 'group_id',
  74. display: 'Group',
  75. dataType: 'select',
  76. dataOption: {
  77. default: '',
  78. relation: 'Group',
  79. relation_condition: {
  80. access: 'full',
  81. },
  82. nulloption: true,
  83. multiple: false,
  84. null: false,
  85. translate: false,
  86. only_shown_if_selectable: true,
  87. permission: ['ticket.agent', 'ticket.customer'],
  88. maxlength: 255,
  89. belongs_to: 'group',
  90. },
  91. isInternal: true,
  92. screens: {
  93. create_middle: {
  94. null: false,
  95. item_class: 'column',
  96. },
  97. edit: {
  98. null: false,
  99. },
  100. },
  101. __typename: 'ObjectManagerFrontendAttribute',
  102. },
  103. {
  104. name: 'owner_id',
  105. display: 'Owner',
  106. dataType: 'select',
  107. dataOption: {
  108. default: '',
  109. relation: 'User',
  110. relation_condition: {
  111. roles: 'Agent',
  112. },
  113. nulloption: true,
  114. multiple: false,
  115. null: true,
  116. translate: false,
  117. permission: ['ticket.agent'],
  118. maxlength: 255,
  119. belongs_to: 'owner',
  120. },
  121. isInternal: true,
  122. screens: {
  123. create_middle: {
  124. null: true,
  125. item_class: 'column',
  126. },
  127. edit: {
  128. null: true,
  129. },
  130. },
  131. __typename: 'ObjectManagerFrontendAttribute',
  132. },
  133. {
  134. name: 'state_id',
  135. display: 'State',
  136. dataType: 'select',
  137. dataOption: {
  138. relation: 'TicketState',
  139. nulloption: true,
  140. multiple: false,
  141. null: false,
  142. default: 2,
  143. translate: true,
  144. filter: [2, 1, 3, 4, 6, 7],
  145. maxlength: 255,
  146. belongs_to: 'state',
  147. },
  148. isInternal: true,
  149. screens: {
  150. create_middle: {
  151. null: false,
  152. item_class: 'column',
  153. filter: [2, 1, 3, 4, 7],
  154. },
  155. edit: {
  156. nulloption: false,
  157. null: false,
  158. filter: [2, 3, 4, 7],
  159. },
  160. },
  161. __typename: 'ObjectManagerFrontendAttribute',
  162. },
  163. {
  164. name: 'pending_time',
  165. display: 'Pending till',
  166. dataType: 'datetime',
  167. dataOption: {
  168. future: true,
  169. past: false,
  170. diff: null,
  171. null: true,
  172. translate: true,
  173. permission: ['ticket.agent'],
  174. },
  175. isInternal: true,
  176. screens: {
  177. create_middle: {
  178. null: false,
  179. item_class: 'column',
  180. },
  181. edit: {
  182. null: false,
  183. },
  184. },
  185. __typename: 'ObjectManagerFrontendAttribute',
  186. },
  187. {
  188. name: 'priority_id',
  189. display: 'Priority',
  190. dataType: 'select',
  191. dataOption: {
  192. relation: 'TicketPriority',
  193. nulloption: false,
  194. multiple: false,
  195. null: false,
  196. default: 2,
  197. translate: true,
  198. maxlength: 255,
  199. belongs_to: 'priority',
  200. },
  201. isInternal: true,
  202. screens: {
  203. create_middle: {
  204. null: false,
  205. item_class: 'column',
  206. },
  207. edit: {
  208. null: false,
  209. },
  210. },
  211. __typename: 'ObjectManagerFrontendAttribute',
  212. },
  213. {
  214. name: 'tags',
  215. display: 'Tags',
  216. dataType: 'tag',
  217. dataOption: {
  218. type: 'text',
  219. null: true,
  220. translate: false,
  221. },
  222. isInternal: true,
  223. screens: {
  224. create_bottom: {
  225. null: true,
  226. },
  227. edit: {},
  228. },
  229. __typename: 'ObjectManagerFrontendAttribute',
  230. },
  231. ],
  232. screens: [
  233. {
  234. name: 'create_top',
  235. attributes: ['title', 'customer_id', 'organization_id'],
  236. __typename: 'ObjectManagerScreenAttributes',
  237. },
  238. {
  239. name: 'edit',
  240. attributes: [
  241. 'group_id',
  242. 'owner_id',
  243. 'state_id',
  244. 'pending_time',
  245. 'priority_id',
  246. ],
  247. __typename: 'ObjectManagerScreenAttributes',
  248. },
  249. {
  250. name: 'create_middle',
  251. attributes: [
  252. 'group_id',
  253. 'owner_id',
  254. 'state_id',
  255. 'pending_time',
  256. 'priority_id',
  257. ],
  258. __typename: 'ObjectManagerScreenAttributes',
  259. },
  260. {
  261. name: 'create_bottom',
  262. attributes: ['tags'],
  263. __typename: 'ObjectManagerScreenAttributes',
  264. },
  265. ],
  266. __typename: 'ObjectManagerFrontendAttributesPayload',
  267. })