<commit_before>import SimpleSchema from "simpl-schema";
SimpleSchema.extendOptions(["autoform"]);

AutoForm.addInputType("dropdown", {
  template: "quickForm_dropdown",
  valueIsArray: true,
  valueOut() {
    return this.val();
  }
});

const usersEnrollSchema = function(groups) {
  return new SimpleSchema({
    subject: {
      type: String,
      // suggested maximum length of email subject
      // https://stackoverflow.com/a/1592310/1191545
      max: 78
    },
    message: {
      type: String,
      optional: false
    },
    emailAddresses: {
      type: Array,
      optional: false
    },
    "emailAddresses.$": {
      type: String,
      regEx: SimpleSchema.RegEx.Email
    },
    groups: {
      type: Array,
      optional: true,
      label: "Add group",

      autoform: {
        type: "dropdown",
        options: groups
      }
    },
    "groups.$": {
      type: String
    }
  });
};

export default usersEnrollSchema;
<commit_msg>Remove label for groups field<commit_after>import SimpleSchema from "simpl-schema";
SimpleSchema.extendOptions(["autoform"]);

AutoForm.addInputType("dropdown", {
  template: "quickForm_dropdown",
  valueIsArray: true,
  valueOut() {
    return this.val();
  }
});

const usersEnrollSchema = function(groups) {
  return new SimpleSchema({
    subject: {
      type: String,
      // suggested maximum length of email subject
      // https://stackoverflow.com/a/1592310/1191545
      max: 78
    },
    message: {
      type: String,
      optional: false
    },
    emailAddresses: {
      type: Array,
      optional: false
    },
    "emailAddresses.$": {
      type: String,
      regEx: SimpleSchema.RegEx.Email
    },
    groups: {
      type: Array,
      optional: true,
      // Remove field label
      label: undefined,

      autoform: {
        type: "dropdown",
        options: groups
      }
    },
    "groups.$": {
      type: String
    }
  });
};

export default usersEnrollSchema;

{'fraction_non_alphanumeric': 0.12538226299694188, 'fraction_numerical': 0.0163098878695209, 'mean_word_length': 2.3271186440677964, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4325292', 'n_tokens_mistral': 619, 'n_tokens_neox': 594, 'n_words': 136}