user-object-attributes.ts 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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: 'firstname',
  7. display: 'First name',
  8. dataType: 'input',
  9. isInternal: true,
  10. dataOption: {
  11. type: 'text',
  12. maxlength: 150,
  13. null: true,
  14. item_class: 'formGroup--halfSize',
  15. },
  16. screens: {},
  17. __typename: 'ObjectManagerFrontendAttribute',
  18. },
  19. {
  20. name: 'lastname',
  21. display: 'Last name',
  22. dataType: 'input',
  23. isInternal: true,
  24. dataOption: {
  25. type: 'text',
  26. maxlength: 150,
  27. null: true,
  28. item_class: 'formGroup--halfSize',
  29. },
  30. screens: {},
  31. __typename: 'ObjectManagerFrontendAttribute',
  32. },
  33. {
  34. name: 'email',
  35. display: 'Email',
  36. dataType: 'input',
  37. isInternal: true,
  38. dataOption: {
  39. type: 'email',
  40. maxlength: 150,
  41. null: true,
  42. item_class: 'formGroup--halfSize',
  43. },
  44. screens: {
  45. signup: {
  46. '-all-': {
  47. null: false,
  48. },
  49. },
  50. invite_agent: {
  51. '-all-': {
  52. null: false,
  53. },
  54. },
  55. invite_customer: {
  56. '-all-': {
  57. null: false,
  58. },
  59. },
  60. },
  61. __typename: 'ObjectManagerFrontendAttribute',
  62. },
  63. {
  64. name: 'web',
  65. display: 'Web',
  66. dataType: 'input',
  67. isInternal: true,
  68. dataOption: {
  69. type: 'url',
  70. maxlength: 250,
  71. null: true,
  72. item_class: 'formGroup--halfSize',
  73. },
  74. screens: {},
  75. __typename: 'ObjectManagerFrontendAttribute',
  76. },
  77. {
  78. name: 'phone',
  79. display: 'Phone',
  80. dataType: 'input',
  81. isInternal: true,
  82. dataOption: {
  83. type: 'tel',
  84. maxlength: 100,
  85. null: true,
  86. item_class: 'formGroup--halfSize',
  87. },
  88. screens: {},
  89. __typename: 'ObjectManagerFrontendAttribute',
  90. },
  91. {
  92. name: 'mobile',
  93. display: 'Mobile',
  94. dataType: 'input',
  95. isInternal: true,
  96. dataOption: {
  97. type: 'tel',
  98. maxlength: 100,
  99. null: true,
  100. item_class: 'formGroup--halfSize',
  101. },
  102. screens: {},
  103. __typename: 'ObjectManagerFrontendAttribute',
  104. },
  105. {
  106. name: 'fax',
  107. display: 'Fax',
  108. dataType: 'input',
  109. isInternal: true,
  110. dataOption: {
  111. type: 'tel',
  112. maxlength: 100,
  113. null: true,
  114. item_class: 'formGroup--halfSize',
  115. },
  116. screens: {},
  117. __typename: 'ObjectManagerFrontendAttribute',
  118. },
  119. {
  120. name: 'organization_id',
  121. display: 'Organization',
  122. dataType: 'autocompletion_ajax',
  123. isInternal: true,
  124. dataOption: {
  125. multiple: false,
  126. nulloption: true,
  127. null: true,
  128. relation: 'Organization',
  129. item_class: 'formGroup--halfSize',
  130. },
  131. screens: {},
  132. __typename: 'ObjectManagerFrontendAttribute',
  133. },
  134. {
  135. name: 'organization_ids',
  136. display: 'Secondary organizations',
  137. dataType: 'autocompletion_ajax',
  138. isInternal: true,
  139. dataOption: {
  140. multiple: true,
  141. nulloption: true,
  142. null: true,
  143. relation: 'Organization',
  144. item_class: 'formGroup--halfSize',
  145. display_limit: 3,
  146. },
  147. screens: {},
  148. __typename: 'ObjectManagerFrontendAttribute',
  149. },
  150. {
  151. name: 'department',
  152. display: 'Department',
  153. dataType: 'input',
  154. isInternal: false,
  155. dataOption: {
  156. type: 'text',
  157. maxlength: 200,
  158. null: true,
  159. item_class: 'formGroup--halfSize',
  160. },
  161. screens: {},
  162. __typename: 'ObjectManagerFrontendAttribute',
  163. },
  164. {
  165. name: 'address',
  166. display: 'Address',
  167. dataType: 'textarea',
  168. isInternal: false,
  169. dataOption: {
  170. type: 'text',
  171. maxlength: 500,
  172. rows: 4,
  173. null: true,
  174. item_class: 'formGroup--halfSize',
  175. },
  176. screens: {},
  177. __typename: 'ObjectManagerFrontendAttribute',
  178. },
  179. {
  180. name: 'note',
  181. display: 'Note',
  182. dataType: 'richtext',
  183. isInternal: true,
  184. dataOption: {
  185. type: 'text',
  186. maxlength: 5000,
  187. null: true,
  188. note: 'Notes are visible to agents only, never to customers.',
  189. no_images: true,
  190. },
  191. screens: {},
  192. __typename: 'ObjectManagerFrontendAttribute',
  193. },
  194. {
  195. name: 'role_ids',
  196. display: 'Roles',
  197. dataType: 'user_permission',
  198. isInternal: true,
  199. dataOption: {
  200. null: false,
  201. item_class: 'checkbox',
  202. permission: ['admin.user'],
  203. relation: 'Role',
  204. },
  205. screens: {
  206. invite_agent: {
  207. '-all-': {
  208. null: false,
  209. },
  210. },
  211. },
  212. __typename: 'ObjectManagerFrontendAttribute',
  213. },
  214. {
  215. name: 'group_ids',
  216. display: 'Group permissions',
  217. dataType: 'group_permissions',
  218. isInternal: true,
  219. dataOption: {
  220. null: true,
  221. item_class: 'checkbox',
  222. permission: ['admin.user'],
  223. },
  224. screens: {
  225. invite_agent: {
  226. '-all-': {
  227. null: true,
  228. },
  229. },
  230. },
  231. __typename: 'ObjectManagerFrontendAttribute',
  232. },
  233. ],
  234. screens: [
  235. {
  236. name: 'view',
  237. attributes: [
  238. 'firstname',
  239. 'lastname',
  240. 'email',
  241. 'web',
  242. 'phone',
  243. 'mobile',
  244. 'fax',
  245. 'organization_id',
  246. 'organization_ids',
  247. 'department',
  248. 'address',
  249. 'note',
  250. ],
  251. },
  252. {
  253. name: 'edit',
  254. attributes: [
  255. 'firstname',
  256. 'lastname',
  257. 'email',
  258. 'web',
  259. 'phone',
  260. 'mobile',
  261. 'fax',
  262. 'organization_id',
  263. 'organization_ids',
  264. 'department',
  265. 'address',
  266. 'note',
  267. ],
  268. },
  269. {
  270. name: 'invite_agent',
  271. attributes: ['firstname', 'lastname', 'email', 'role_ids', 'group_ids'],
  272. },
  273. ],
  274. })