diff --git a/src/openforms/js/components/form/iotype-select.js b/src/openforms/js/components/form/iotype-select.js deleted file mode 100644 index 88d61cec71..0000000000 --- a/src/openforms/js/components/form/iotype-select.js +++ /dev/null @@ -1,56 +0,0 @@ -import SelectField from './select'; - -class InformatieObjectTypeSelectField extends SelectField { - setItems(items, fromSearch) { - const groups = {}; - for (const item of items) { - const choice = { - value: item.informatieobjecttype.url, - label: item.informatieobjecttype.omschrijving, - }; - const groupLabel = [item.backendLabel, item.catalogus.domein].filter(Boolean).join(' > '); - if (!(groupLabel in groups)) { - groups[groupLabel] = []; - } - groups[groupLabel].push(choice); - } - - const choices = []; - for (const [index, groupName] of Object.keys(groups).entries()) { - const entry = { - label: groupName, - id: index + 1, - disable: false, - choices: groups[groupName], - }; - choices.push(entry); - } - - this.choices.setChoices(choices, 'value', 'label', true); - - this.isScrollLoading = false; - this.loading = false; - - const searching = fromSearch && this.choices?.input?.isFocussed; - - if (!searching) { - // If a value is provided, then select it. - if (!this.isEmpty()) { - this.setValue(this.dataValue, { - noUpdateEvent: true, - }); - } else if (this.shouldAddDefaultValue && !this.options.readOnly) { - // If a default value is provided then select it. - const defaultValue = this.defaultValue; - if (!this.isEmpty(defaultValue)) { - this.setValue(defaultValue); - } - } - } - - // Say we are done loading the items. - this.itemsLoadedResolve(); - } -} - -export default InformatieObjectTypeSelectField; diff --git a/src/openforms/js/formio_module.js b/src/openforms/js/formio_module.js index fff642409b..d57c1c37c0 100644 --- a/src/openforms/js/formio_module.js +++ b/src/openforms/js/formio_module.js @@ -15,7 +15,6 @@ import EmailField from './components/form/email'; import FieldSet from './components/form/fieldset'; import FileField from './components/form/file'; import IbanField from './components/form/iban'; -import InformatieObjectTypeSelectField from './components/form/iotype-select'; import LicensePlate from './components/form/licenseplate'; import Map from './components/form/map'; import NpFamilyMembers from './components/form/np-family-members'; @@ -49,7 +48,6 @@ const FormIOModule = { postcode: PostcodeField, file: FileField, select: SelectField, - iotypeSelect: InformatieObjectTypeSelectField, radio: RadioField, selectboxes: SelectBoxesField, email: EmailField,