3

Rally が github でカスタム グリッドを利用できるようにしたので、Rally アプリ カタログを github からダウンロードしました。次に、src/apps/grid ディレクトリに移動し、「rally-app-builder build」を実行しました。これにより、app.html に deploy ディレクトリと次のコードが作成されました。

<!DOCTYPE html>
<html>
<head>
<title>Custom Grid</title>
<script type="text/javascript" src="/apps/2.0rc2/sdk.js"></script>
<script type="text/javascript">
    Rally.onReady(function () {
            (function(){var Ext=window.Ext4||window.Ext,appAutoScroll=Ext.isIE7||Ext.isIE8,gridAutoScroll=!appAutoScroll;Ext.define("Rally.apps.grid.GridApp",{extend:"Rally.app.App",layout:"fit",requires:["Rally.data.util.Sorter","Rally.data.QueryFilter","Rally.ui.grid.Grid","Rally.ui.grid.plugin.PercentDonePopoverPlugin"],autoScroll:appAutoScroll,launch:function(){Rally.data.ModelFactory.getModel({type:this.getContext().get("objectType"),success:this._createGrid,scope:this})},_getFetchOnlyFields:function(){return["LatestDiscussionAgeInMinutes"]},_createGrid:function(model){var context=this.getContext(),pageSize=context.get("pageSize"),fetch=context.get("fetch"),columns=this._getColumns(fetch),gridConfig={xtype:"rallygrid",model:model,columnCfgs:columns,enableColumnHide:!1,enableRanking:!0,enableBulkEdit:Rally.environment.getContext().isFeatureEnabled("EXT4_GRID_BULK_EDIT"),autoScroll:gridAutoScroll,plugins:this._getPlugins(columns),storeConfig:{fetch:fetch,sorters:Rally.data.util.Sorter.sorters(context.get("order")),context:context.getDataContext(),listeners:{load:this._updateAppContainerSize,scope:this}},pagingToolbarCfg:{pageSizes:[pageSize]}};pageSize&&(pageSize-=0,isNaN(pageSize)||(gridConfig.storeConfig.pageSize=pageSize)),context.get("query")&&(gridConfig.storeConfig.filters=[Rally.data.QueryFilter.fromQueryString(context.get("query"))]),this.add(gridConfig)},_updateAppContainerSize:function(){if(this.appContainer){var grid=this.down("rallygrid");grid.el.setHeight("auto"),grid.body.setHeight("auto"),grid.view.el.setHeight("auto"),this.setSize({height:grid.getHeight()+_.reduce(grid.getDockedItems(),function(acc,item){return acc+item.getHeight()+item.el.getMargin("tb")},0)}),this.appContainer.setPanelHeightToAppHeight()}},_getColumns:function(fetch){return fetch?Ext.Array.difference(fetch.split(","),this._getFetchOnlyFields()):[]},_getPlugins:function(columns){var plugins=[];return Ext.Array.intersect(columns,["PercentDoneByStoryPlanEstimate","PercentDoneByStoryCount"]).length>0&&plugins.push("rallypercentdonepopoverplugin"),plugins}})})();

        Rally.launchApp('Rally.apps.grid.GridApp', {
            name:"Custom Grid",
            parentRepos:""
        });

    });
</script>
</head>
<body></body>
</html>

...しかし、それをRallyに貼り付けると、空のアプリ(コンテンツのないフレーム)が生成されます。

ここで簡単なものが欠けていますか?これを機能させるために必要な微調整はありますか?

4

2 に答える 2

2

2.0rc2 がカットされた後、カスタム グリッドをかなり修正したことを思い出しました。RallySoftware/app-catalog リポジトリで確認できます(これらのアプリが SDK の最新リビジョン (バージョン x) でのみ動作することを保証しますが、この場合、グリッドは 2.0rc2 でも正しく動作します)。

注: 設定パネルはまだありません。

以下は、いくつかのデフォルト設定が入力された完全な html です。

<!DOCTYPE html>
<html>
<head>
    <title>Custom Grid</title>
    <script type="text/javascript" src="/apps/2.0rc2/sdk.js"></script>
    <script type="text/javascript">
        Rally.onReady(function () {
            (function () {
                var Ext = window.Ext4 || window.Ext;
                var appAutoScroll = Ext.isIE7 || Ext.isIE8;
                var gridAutoScroll = !appAutoScroll;

                Ext.define('Rally.apps.grid.GridApp', {
                    extend: 'Rally.app.App',
                    layout: 'fit',

                    requires: [
                        'Rally.data.util.Sorter',
                        'Rally.data.wsapi.Filter',
                        'Rally.ui.grid.Grid',
                        'Rally.data.ModelFactory',
                        'Rally.ui.grid.plugin.PercentDonePopoverPlugin'
                    ],

                    config: {
                        defaultSettings: {
                            types: 'defect',
                            pageSize: 25,
                            fetch: 'FormattedID,Name,Priority,Severity'
                        }
                    },

                    autoScroll: appAutoScroll,

                    launch: function () {
                        var context = this.getContext(),
                                pageSize = this.getSetting('pageSize'),
                                fetch = this.getSetting('fetch'),
                                columns = this._getColumns(fetch);

                        this.add({
                            xtype: 'rallygrid',
                            columnCfgs: columns,
                            enableColumnHide: false,
                            enableRanking: true,
                            enableBulkEdit: context.isFeatureEnabled("EXT4_GRID_BULK_EDIT"),
                            autoScroll: gridAutoScroll,
                            plugins: this._getPlugins(columns),
                            context: this.getContext(),
                            storeConfig: {
                                fetch: fetch,
                                models: this.getSetting('types').split(','),
                                filters: this._getFilters(),
                                pageSize: pageSize,
                                sorters: Rally.data.util.Sorter.sorters(this.getSetting('order')),
                                listeners: {
                                    load: this._updateAppContainerSize,
                                    scope: this
                                }
                            },
                            pagingToolbarCfg: {
                                pageSizes: [pageSize]
                            }
                        });
                    },

                    onTimeboxScopeChange: function (newTimeboxScope) {
                        this.callParent(arguments);

                        this.down('rallygrid').filter(this._getFilters(), true, true);
                    },

                    _getFilters: function () {
                        var filters = [],
                                query = this.getSetting('query'),
                                timeboxScope = this.getContext().getTimeboxScope();
                        if (query) {
                            try {
                                query = new Ext.Template(query).apply({
                                    user: Rally.util.Ref.getRelativeUri(this.getContext().getUser())
                                });
                            } catch (e) {
                            }
                            filters.push(Rally.data.wsapi.Filter.fromQueryString(query));
                        }

                        if (timeboxScope && _.every(this.getSetting('types').split(','), this._isSchedulableType, this)) {
                            filters.push(timeboxScope.getQueryFilter());
                        }
                        return filters;
                    },

                    _isSchedulableType: function (type) {
                        return _.contains(['hierarchicalrequirement', 'task', 'defect', 'defectsuite', 'testset'], type.toLowerCase());
                    },

                    _getFetchOnlyFields: function () {
                        return ['LatestDiscussionAgeInMinutes'];
                    },

                    _updateAppContainerSize: function () {
                        if (this.appContainer) {
                            var grid = this.down('rallygrid');
                            grid.el.setHeight('auto');
                            grid.body.setHeight('auto');
                            grid.view.el.setHeight('auto');
                            this.setSize({height: grid.getHeight() + _.reduce(grid.getDockedItems(), function (acc, item) {
                                return acc + item.getHeight() + item.el.getMargin('tb');
                            }, 0)});
                            this.appContainer.setPanelHeightToAppHeight();
                        }
                    },

                    _getColumns: function (fetch) {
                        if (fetch) {
                            return Ext.Array.difference(fetch.split(','), this._getFetchOnlyFields());
                        }
                        return [];
                    },

                    _getPlugins: function (columns) {
                        var plugins = [];

                        if (Ext.Array.intersect(columns, ['PercentDoneByStoryPlanEstimate', 'PercentDoneByStoryCount']).length > 0) {
                            plugins.push('rallypercentdonepopoverplugin');
                        }

                        return plugins;
                    }
                });
            })();

            Rally.launchApp('Rally.apps.grid.GridApp', {
                name: "Custom Grid"
            });

        });
    </script>
</head>
<body></body>
</html>

うまくいけば、これで今のところはうまくいきます。次のパブリック SDK リリースと同時に、大幅に改善されたカスタム グリッド アプリを探してください。

于 2014-01-18T14:55:26.970 に答える
1

あなたは何も見逃していません。次のリリースをカットすると動作するようになりますが、現時点ではアプリはオンになっていません。空になるのは、type以下が解決しないことです。

Rally.data.ModelFactory.getModel({
                type: this.getContext().get('objectType'),
                success: this._createGrid,
                scope: this
            });

のように代わりにハードコーディングしない限りtype: 'defect'。残念ながら、これだけでは修正できません。アプリはまだ使用する準備ができていません。

于 2014-01-17T21:06:23.777 に答える