<commit_before>define([
    'underscore',
    'backgrid',
    'orodatagrid/js/datagrid/editor/select-cell-radio-editor',
    'oroui/js/tools/text-util'
], function(_, Backgrid, SelectCellRadioEditor, textUtil) {
    'use strict';

    var SelectCell;

    /**
     * Select column cell. Added missing behaviour.
     *
     * @export  oro/datagrid/cell/select-cell
     * @class   oro.datagrid.cell.SelectCell
     * @extends Backgrid.SelectCell
     */
    SelectCell = Backgrid.SelectCell.extend({
        /**
         * @inheritDoc
         */
        initialize: function(options) {
            if (this.expanded && !this.multiple) {
                this.editor = SelectCellRadioEditor;
            }

            if (options.column.get('metadata').choices) {
                this.optionValues = [];
                _.each(options.column.get('metadata').choices, function(value, key) {
                    this.optionValues.push([textUtil.prepareText(value), key]);
                }, this);
            } else {
                throw new Error('Column metadata must have choices specified');
            }<commit_msg>BAP-11747: XSS vulnerability in the enum grid column<commit_after>define([
    'underscore',
    'backgrid',
    'orodatagrid/js/datagrid/editor/select-cell-radio-editor',
    'oroui/js/tools/text-util'
], function(_, Backgrid, SelectCellRadioEditor, textUtil) {
    'use strict';

    var SelectCell;

    /**
     * Select column cell. Added missing behaviour.
     *
     * @export  oro/datagrid/cell/select-cell
     * @class   oro.datagrid.cell.SelectCell
     * @extends Backgrid.SelectCell
     */
    SelectCell = Backgrid.SelectCell.extend({
        /**
         * @inheritDoc
         */
        initialize: function(options) {
            if (this.expanded && !this.multiple) {
                this.editor = SelectCellRadioEditor;
            }

            if (options.column.get('metadata').choices) {
                this.optionValues = [];
                _.each(options.column.get('metadata').choices, function(value, key) {
                    this.optionValues.push([_.escape(textUtil.prepareText(value)), key]);
                }, this);
            } else {
                throw new Error('Column metadata must have choices specified');
            }
{'fraction_non_alphanumeric': 0.12603576101177497, 'fraction_numerical': 0.002180549498473615, 'mean_word_length': 1.971502590673575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4444602', 'n_tokens_mistral': 667, 'n_tokens_neox': 635, 'n_words': 113}