autocompletion-customer.ts 820 B

123456789101112131415161718192021222324252627
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { FieldResolverModule } from '#shared/entities/object-attributes/types/resolver.ts'
  3. import { camelize } from '#shared/utils/formatter.ts'
  4. import FieldResolver from '../FieldResolver.ts'
  5. export class FieldResolverAutocompletionCustomer extends FieldResolver {
  6. fieldType = 'customer'
  7. public fieldTypeAttributes() {
  8. return {
  9. props: {
  10. clearable: this.attributeConfig.nulloption ?? true,
  11. noOptionsLabelTranslation: !this.attributeConfig.translate,
  12. belongsToObjectField: camelize(
  13. (this.attributeConfig.belongs_to as string) || '',
  14. ),
  15. },
  16. }
  17. }
  18. }
  19. export default <FieldResolverModule>{
  20. type: 'user_autocompletion',
  21. resolver: FieldResolverAutocompletionCustomer,
  22. }