diff --git a/frontend/packages/ux-editor/src/components/config/SelectDataFieldComponent.test.tsx b/frontend/packages/ux-editor/src/components/config/SelectDataFieldComponent.test.tsx
deleted file mode 100644
index cb9ec37877d..00000000000
--- a/frontend/packages/ux-editor/src/components/config/SelectDataFieldComponent.test.tsx
+++ /dev/null
@@ -1,214 +0,0 @@
-import React from 'react';
-import { screen } from '@testing-library/react';
-import { renderWithProviders } from '../../testing/mocks';
-import { SelectDataFieldComponent } from './SelectDataFieldComponent';
-import { textMock } from '@studio/testing/mocks/i18nMock';
-import userEvent from '@testing-library/user-event';
-import { ComponentType } from 'app-shared/types/ComponentType';
-import { getDataModelFieldsFilter } from '../../utils/dataModelUtils';
-import { queryClientMock } from 'app-shared/mocks/queryClientMock';
-import { QueryKey } from 'app-shared/types/QueryKey';
-import { app, org } from '@studio/testing/testids';
-import { layoutSet1NameMock } from '@altinn/ux-editor/testing/layoutSetsMock';
-
-const dataModelName = undefined;
-
-const dataModelMetadataMock = [
- {
- id: 'testModel',
- type: 'ComplexType',
- dataBindingName: 'testModel',
- displayString: 'testModel',
- isReadOnly: false,
- isTagContent: false,
- jsonSchemaPointer: '#/definitions/testModel',
- maxOccurs: 1,
- minOccurs: 1,
- name: 'testModel',
- parentElement: null,
- restrictions: [],
- texts: [],
- xmlSchemaXPath: '/testModel',
- xPath: '/testModel',
- },
- {
- id: 'testModel.field1',
- type: 'SimpleType',
- dataBindingName: 'testModel.field1',
- displayString: 'testModel.field1',
- isReadOnly: false,
- isTagContent: false,
- jsonSchemaPointer: '#/definitions/testModel/properties/field1',
- maxOccurs: 1,
- minOccurs: 1,
- name: 'testModel/field1',
- parentElement: null,
- restrictions: [],
- texts: [],
- xmlSchemaXPath: '/testModel/field1',
- xPath: '/testModel/field1',
- },
- {
- dataBindingName: 'multipleAnswers',
- maxOccurs: 10,
- name: 'multipleAnswers',
- xsdValueType: 'String',
- },
- {
- dataBindingName: 'repGroupField',
- maxOccurs: 10,
- minOccurs: 1,
- name: 'repGroupField',
- },
-];
-
-const user = userEvent.setup();
-
-const render = async ({
- dataModelMetadata = dataModelMetadataMock,
- componentType = ComponentType.Input,
- label = undefined,
- handleComponentChange = jest.fn(),
-} = {}) => {
- queryClientMock.setQueryData(
- [QueryKey.DataModelMetadata, org, app, layoutSet1NameMock, dataModelName],
- dataModelMetadata,
- );
- renderWithProviders(
- ,
- );
-};
-
-describe('SelectDataModelComponent', () => {
- it('should show select with no selected option by default', async () => {
- await render();
-
- expect(
- screen.getByLabelText(textMock(`ux_editor.component_title.${ComponentType.Input}`)),
- ).toBeInTheDocument();
- const selector = screen.getByRole('combobox') as HTMLSelectElement;
- expect(selector.value).toEqual('');
- });
-
- it('renders when dataModelData is undefined', async () => {
- await render({ dataModelMetadata: undefined });
-
- const bindingTitle = screen.getByLabelText(
- textMock(`ux_editor.component_title.${ComponentType.Input}`),
- );
- expect(bindingTitle).toBeInTheDocument();
- });
-
- it('should show select with provided value', async () => {
- await render();
- const select = screen.getByRole('combobox', {
- name: textMock(`ux_editor.component_title.${ComponentType.Input}`),
- });
- await user.click(select);
- expect(screen.getByText('testModel.field1')).toBeInTheDocument();
- });
-
- it('should call onChange when a new option is selected', async () => {
- const handleComponentChange = jest.fn();
- await render({
- handleComponentChange,
- });
-
- const selectElement = screen.getByRole('combobox', {
- name: textMock(`ux_editor.component_title.${ComponentType.Input}`),
- });
- const optionElement = screen.getByRole('option', { name: 'testModel.field1' });
- await user.selectOptions(selectElement, optionElement);
-
- expect(handleComponentChange).toHaveBeenCalled();
- expect(handleComponentChange).toHaveBeenCalledWith('testModel.field1');
- });
-
- it('should render repGroupField and multipleAnswers fields for RepeatingGroup component', async () => {
- await render({
- componentType: ComponentType.RepeatingGroup,
- });
- const selectElement = screen.getByRole('combobox', {
- name: textMock(`ux_editor.component_title.${ComponentType.RepeatingGroup}`),
- });
- await user.click(selectElement);
- const optionElement1 = screen.queryByText('testModel.field1');
- const optionElement2 = screen.getByText('multipleAnswers');
- const optionElement3 = screen.getByText('repGroupField');
- expect(optionElement1).not.toBeInTheDocument();
- expect(optionElement2).toBeInTheDocument();
- expect(optionElement3).toBeInTheDocument();
- });
-
- it('should render only multipleAnswers field for FileUpload component with multiple attachments enabled', async () => {
- await render({
- componentType: ComponentType.FileUpload,
- label: 'list',
- });
- const selectElement = screen.getByRole('combobox', {
- name: textMock(`ux_editor.component_title.${ComponentType.FileUpload}`),
- });
- await user.click(selectElement);
- const optionElement1 = screen.queryByText('testModel.field1');
- const optionElement2 = screen.getByText('multipleAnswers');
- const optionElement3 = screen.queryByText('repGroupField');
- expect(optionElement1).not.toBeInTheDocument();
- expect(optionElement2).toBeInTheDocument();
- expect(optionElement3).not.toBeInTheDocument();
- });
-
- it('should render only multipleAnswers field for FileUploadWithTag component with multiple attachments enabled', async () => {
- await render({
- componentType: ComponentType.FileUploadWithTag,
- label: 'list',
- });
- const selectElement = screen.getByRole('combobox', {
- name: textMock(`ux_editor.component_title.${ComponentType.FileUploadWithTag}`),
- });
- await user.click(selectElement);
- const optionElement1 = screen.queryByText('testModel.field1');
- const optionElement2 = screen.getByText('multipleAnswers');
- const optionElement3 = screen.queryByText('repGroupField');
- expect(optionElement1).not.toBeInTheDocument();
- expect(optionElement2).toBeInTheDocument();
- expect(optionElement3).not.toBeInTheDocument();
- });
-
- it('should render only simple fields for FileUpload component without multiple attachments enabled', async () => {
- await render({
- componentType: ComponentType.FileUpload,
- });
- const selectElement = screen.getByRole('combobox', {
- name: textMock(`ux_editor.component_title.${ComponentType.FileUpload}`),
- });
- await user.click(selectElement);
- const optionElement1 = screen.getByText('testModel.field1');
- const optionElement2 = screen.queryByText('multipleAnswers');
- const optionElement3 = screen.queryByText('repGroupField');
- expect(optionElement1).toBeInTheDocument();
- expect(optionElement2).not.toBeInTheDocument();
- expect(optionElement3).not.toBeInTheDocument();
- });
-
- it('should render only simple fields for FileUploadWithTag component without multiple attachments enabled', async () => {
- await render({
- componentType: ComponentType.FileUploadWithTag,
- });
- const selectElement = screen.getByRole('combobox', {
- name: textMock(`ux_editor.component_title.${ComponentType.FileUploadWithTag}`),
- });
- await user.click(selectElement);
- const optionElement1 = screen.getByText('testModel.field1');
- const optionElement2 = screen.queryByText('multipleAnswers');
- const optionElement3 = screen.queryByText('repGroupField');
- expect(optionElement1).toBeInTheDocument();
- expect(optionElement2).not.toBeInTheDocument();
- expect(optionElement3).not.toBeInTheDocument();
- });
-});
diff --git a/frontend/packages/ux-editor/src/components/config/SelectDataFieldComponent.tsx b/frontend/packages/ux-editor/src/components/config/SelectDataFieldComponent.tsx
deleted file mode 100644
index e4dfb8a1d83..00000000000
--- a/frontend/packages/ux-editor/src/components/config/SelectDataFieldComponent.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import React, { useEffect } from 'react';
-import { StudioNativeSelect } from '@studio/components';
-import { useDataModelMetadataQuery } from '../../hooks/queries/useDataModelMetadataQuery';
-import { FormField } from '../FormField';
-import type { Option } from '@altinn/text-editor/types';
-import { useStudioEnvironmentParams } from 'app-shared/hooks/useStudioEnvironmentParams';
-import type { DataModelFieldElement } from 'app-shared/types/DataModelFieldElement';
-import { useAppContext } from '../../hooks';
-
-export interface ISelectDataFieldProps {
- inputId?: string;
- selectedElement: string;
- label: string;
- onDataModelChange: (dataModelField: string) => void;
- hideRestrictions?: boolean;
- dataModelFieldsFilter?: (dataModelField: DataModelFieldElement) => boolean;
- componentType?: string;
- propertyPath?: string;
- helpText?: string;
- dataModelName?: string;
-}
-
-export const SelectDataFieldComponent = ({
- inputId,
- selectedElement,
- label,
- onDataModelChange,
- dataModelFieldsFilter,
- componentType,
- helpText,
- propertyPath,
- dataModelName,
-}: ISelectDataFieldProps) => {
- const { org, app } = useStudioEnvironmentParams();
- const { selectedFormLayoutSetName } = useAppContext();
- const { data } = useDataModelMetadataQuery({
- org,
- app,
- layoutSetName: selectedFormLayoutSetName,
- dataModelName,
- });
- const [dataModelElementNames, setDataModelElementNames] = React.useState