<commit_before>const { assign } = require('lodash')
const { globalFields } = require('../../macros')

const eventFormConfig = ({
  eventId,
  advisers,
  eventTypes,
  locationTypes,
  countries,
  teams,
  services,
  programmes,
  ukRegions,
}) => {
  return {
    method: 'post',
    buttonText: eventId ? 'Save and return' : 'Add event',
    returnText: eventId ? 'Return without saving' : 'Cancel',
    returnLink: eventId ? `/events/${eventId}` : '/events',
    hiddenFields: {
      id: eventId,
    },
    children: [
      {
        macroName: 'TextField',
        name: 'name',
        label: 'Event name',
      },
      assign({}, globalFields.eventTypes, {
        options: eventTypes,
      }),
      {
        macroName: 'DateFieldset',
        name: 'start_date',
        label: 'Event start date',
      },
      {
        macroName: 'DateFieldset',
        name: 'end_date',
        label: 'Event end date',
      },
      assign({}, globalFields.locationTypes, {
        label: 'Event location type',
        optional: true,
        options: locationTypes,
      }),
      {
        macroName: 'TextField',
        name: 'address_1',
        label: 'Business and street',
      },
      {
        macroName: 'TextField',
        name: 'address_2',
        label: 'Second line of address',
        isLabelHidden: true,
        optional: true,
      },
      {
        macroName: 'TextField',
        name: 'address_town',
        label: 'Town or city',
      },
      {
        macroName: 'TextField',
        name: 'address_county',
        label: 'County',
      },
      {
        macroName: 'TextField',
        name: 'postcode',
        label: 'Postcode',
        class: 'u-js-hidden',
      },
      assign({}, globalFields.countries, {
        name: 'address_country',
        options: countries,
      }),
      assign({}, globalFields.ukRegions, {
        condition: {
          name: 'address_country',
          value: '80756b9a-5d95-e211-a939-e4115bead28a',
        },
        options: ukRegions,
      }),
      {
        macroName: 'TextField',
        type: 'textarea',
        name: 'notes',
        label: 'Event notes',
        optional: true,
      },
      assign({}, globalFields.teams, {
        name: 'lead_team',
        label: 'Team hosting the event',
        optional: true,
        options: teams,
      }),
      assign({}, globalFields.serviceDeliveryServices, {
        options: services,
      }),
      {
        macroName: 'MultipleChoiceField',
        name: 'organiser',
        label: 'Organiser',
        optional: true,
        initialOption: '-- Select organiser --',
        options: advisers,
      },
      {
        macroName: 'MultipleChoiceField',
        type: 'radio',
        name: 'event_shared',<commit_msg>Update event team label to make required<commit_after>const { assign } = require('lodash')
const { globalFields } = require('../../macros')

const eventFormConfig = ({
  eventId,
  advisers,
  eventTypes,
  locationTypes,
  countries,
  teams,
  services,
  programmes,
  ukRegions,
}) => {
  return {
    method: 'post',
    buttonText: eventId ? 'Save and return' : 'Add event',
    returnText: eventId ? 'Return without saving' : 'Cancel',
    returnLink: eventId ? `/events/${eventId}` : '/events',
    hiddenFields: {
      id: eventId,
    },
    children: [
      {
        macroName: 'TextField',
        name: 'name',
        label: 'Event name',
      },
      assign({}, globalFields.eventTypes, {
        options: eventTypes,
      }),
      {
        macroName: 'DateFieldset',
        name: 'start_date',
        label: 'Event start date',
      },
      {
        macroName: 'DateFieldset',
        name: 'end_date',
        label: 'Event end date',
      },
      assign({}, globalFields.locationTypes, {
        label: 'Event location type',
        optional: true,
        options: locationTypes,
      }),
      {
        macroName: 'TextField',
        name: 'address_1',
        label: 'Business and street',
      },
      {
        macroName: 'TextField',
        name: 'address_2',
        label: 'Second line of address',
        isLabelHidden: true,
        optional: true,
      },
      {
        macroName: 'TextField',
        name: 'address_town',
        label: 'Town or city',
      },
      {
        macroName: 'TextField',
        name: 'address_county',
        label: 'County',
      },
      {
        macroName: 'TextField',
        name: 'postcode',
        label: 'Postcode',
        class: 'u-js-hidden',
      },
      assign({}, globalFields.countries, {
        name: 'address_country',
        options: countries,
      }),
      assign({}, globalFields.ukRegions, {
        condition: {
          name: 'address_country',
          value: '80756b9a-5d95-e211-a939-e4115bead28a',
        },
        options: ukRegions,
      }),
      {
        macroName: 'TextField',
        type: 'textarea',
        name: 'notes',
        label: 'Event notes',
        optional: true,
      },
      assign({}, globalFields.teams, {
        name: 'lead_team',
        label: 'Team hosting the event',
        optional: false,
        options: teams,
      }),
      assign({}, globalFields.serviceDeliveryServices, {
        options: services,
      }),
      {
        macroName: 'MultipleChoiceField',
        name: 'organiser',
        label: 'Organiser',
        optional: true,
        initialOption: '-- Select organiser --',
        options: advisers,
      },
      {
        macroName: 'MultipleChoiceField',
        type: 'radio',
        name: 'event_shared',
{'fraction_non_alphanumeric': 0.13691756272401434, 'fraction_numerical': 0.008243727598566309, 'mean_word_length': 1.8430973000509425, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5541226', 'n_tokens_mistral': 1657, 'n_tokens_neox': 1632, 'n_words': 371}