<commit_before>(function () {
    var Ext = window.Ext4 || window.Ext;

    Ext.define('Rally.apps.roadmapplanningboard.PlanningBoardColumn', {
        extend: 'Rally.ui.cardboard.Column',
        alias: 'widget.planningboardcolumn',

        mixins: {
            maskable: 'Rally.ui.mask.Maskable'
        },
        requires: [
            'Rally.apps.roadmapplanningboard.plugin.OrcaColumnDropController',
            'Rally.ui.filter.view.FilterButton',
            'Rally.ui.filter.view.CustomQueryFilter',
            'Rally.ui.filter.view.ParentFilter'
        ],

        parentFilter: null,
        queryFilter: null,

        config: {
            filterable: false,
            baseQueryFilter: null,
            /**
             * @cfg {Object} Object containing Names and TypePaths of the lowest level portfolio item (eg: 'Feature') and optionally its parent (eg: 'Initiative')
             */
            typeNames: {},
            storeConfig: {
                fetch: ['Value', 'FormattedID', 'Owner', 'Name', 'PreliminaryEstimate', 'DisplayColor']
            },
            dropControllerConfig: {
                ptype: 'orcacolumndropcontroller'
            },
            cardConfig: {
                showIconsAndHighlightBorder: true,
                showPlusIcon: false,
                showColorIcon: true,
                showGearIcon: true,
                showReadyIcon: false,
                showBlockedIcon: false,
                showEditMenuItem: true,
                showCopyMenuItem: false,
                showSplitMenuItem: false,
                showDeleteMenuItem: true,
                showAddChildMenuItem: false,
                showRankMenuItems: false
            }
        },

        constructor: function (config) {
            this.mergeConfig(config);
            this.context = this.context || Rally.environment.getContext();
            if(!this.config.context) {
                this.config.context = this.context;
            }
            this.config.storeConfig.autoLoad = !this.filterable;
            if (this.config.baseFilter) {
                this.config.baseFilter = this._createBaseFilter(this.config.baseFilter);
            }
            this.callParent([this.config]);
        },

        _createBaseFilter: function (bf) {
            var baseFilter;
            if (Ext.isArray(bf)) {
                baseFilter = _.reduce(bf, function(result, extFilter) {
                    var filter = new Rally.data.QueryFilter.fromExtFilter(extFilter);
                    return result ? result.and(filter) : filter;
                }, undefined);
            } else {
                baseFilter = new Rally.data.QueryFilter(bf);
            }
            return baseFilter;
        },

        initComponent: function () {
            if(!this.typeNames.child || !this.typeNames.child.name) {
                throw 'typeNames must have a child property with a name';
            }

            if (this.filterable) {
                this.filterButton = this._createFilterButton();
            }

            this.callParent(arguments);

            return this.on('beforerender', function () {
                var cls = 'planning-column';
                this.getContentCell().addCls(cls);
                return this.getColumnHeaderCell().addCls(cls);
            }, this, {
                single: true
            });
        },

        _createFilterButton: function () {
            return Ext.create('Rally.ui.filter.view.FilterButton', {
                cls: 'small columnfilter',
                stateful: true,
                stateId: this.context.getScopedStateId('filter.' + this.getColumnIdentifier() + '.' + this.context.getWorkspace()._refObjectUUID),
                items: this._getFilterItems(),
                listeners: {
                    filter: {
                        fn: this._initialFilter,
                        single: true,
                        scope: this
                    }
                }
            });
        },

        _getFilterItems: function () {
            var filterItems = [];

            if(this.typeNames.parent) {
                filterItems.push({
                    xtype: 'rallyparentfilter',
                    modelType: this.typeNames.parent.typePath,
                    modelName: this.typeNames.parent.name,
                    storeConfig: {
                        context: {
                            project: null<commit_msg>S60084 - Changed filter button back to a medium button<commit_after>(function () {
    var Ext = window.Ext4 || window.Ext;

    Ext.define('Rally.apps.roadmapplanningboard.PlanningBoardColumn', {
        extend: 'Rally.ui.cardboard.Column',
        alias: 'widget.planningboardcolumn',

        mixins: {
            maskable: 'Rally.ui.mask.Maskable'
        },
        requires: [
            'Rally.apps.roadmapplanningboard.plugin.OrcaColumnDropController',
            'Rally.ui.filter.view.FilterButton',
            'Rally.ui.filter.view.CustomQueryFilter',
            'Rally.ui.filter.view.ParentFilter'
        ],

        parentFilter: null,
        queryFilter: null,

        config: {
            filterable: false,
            baseQueryFilter: null,
            /**
             * @cfg {Object} Object containing Names and TypePaths of the lowest level portfolio item (eg: 'Feature') and optionally its parent (eg: 'Initiative')
             */
            typeNames: {},
            storeConfig: {
                fetch: ['Value', 'FormattedID', 'Owner', 'Name', 'PreliminaryEstimate', 'DisplayColor']
            },
            dropControllerConfig: {
                ptype: 'orcacolumndropcontroller'
            },
            cardConfig: {
                showIconsAndHighlightBorder: true,
                showPlusIcon: false,
                showColorIcon: true,
                showGearIcon: true,
                showReadyIcon: false,
                showBlockedIcon: false,
                showEditMenuItem: true,
                showCopyMenuItem: false,
                showSplitMenuItem: false,
                showDeleteMenuItem: true,
                showAddChildMenuItem: false,
                showRankMenuItems: false
            }
        },

        constructor: function (config) {
            this.mergeConfig(config);
            this.context = this.context || Rally.environment.getContext();
            if(!this.config.context) {
                this.config.context = this.context;
            }
            this.config.storeConfig.autoLoad = !this.filterable;
            if (this.config.baseFilter) {
                this.config.baseFilter = this._createBaseFilter(this.config.baseFilter);
            }
            this.callParent([this.config]);
        },

        _createBaseFilter: function (bf) {
            var baseFilter;
            if (Ext.isArray(bf)) {
                baseFilter = _.reduce(bf, function(result, extFilter) {
                    var filter = new Rally.data.QueryFilter.fromExtFilter(extFilter);
                    return result ? result.and(filter) : filter;
                }, undefined);
            } else {
                baseFilter = new Rally.data.QueryFilter(bf);
            }
            return baseFilter;
        },

        initComponent: function () {
            if(!this.typeNames.child || !this.typeNames.child.name) {
                throw 'typeNames must have a child property with a name';
            }

            if (this.filterable) {
                this.filterButton = this._createFilterButton();
            }

            this.callParent(arguments);

            return this.on('beforerender', function () {
                var cls = 'planning-column';
                this.getContentCell().addCls(cls);
                return this.getColumnHeaderCell().addCls(cls);
            }, this, {
                single: true
            });
        },

        _createFilterButton: function () {
            return Ext.create('Rally.ui.filter.view.FilterButton', {
                cls: 'medium columnfilter',
                stateful: true,
                stateId: this.context.getScopedStateId('filter.' + this.getColumnIdentifier() + '.' + this.context.getWorkspace()._refObjectUUID),
                items: this._getFilterItems(),
                listeners: {
                    filter: {
                        fn: this._initialFilter,
                        single: true,
                        scope: this
                    }
                }
            });
        },

        _getFilterItems: function () {
            var filterItems = [];

            if(this.typeNames.parent) {
                filterItems.push({
                    xtype: 'rallyparentfilter',
                    modelType: this.typeNames.parent.typePath,
                    modelName: this.typeNames.parent.name,
                    storeConfig: {
                        context: {
                            project: null
{'fraction_non_alphanumeric': 0.09991089329472043, 'fraction_numerical': 0.0007796836711962575, 'mean_word_length': 1.4156577885391444, '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': '2647087', 'n_tokens_mistral': 2280, 'n_tokens_neox': 2168, 'n_words': 403}