0

ストーリー数と計画見積もりの​​色分けアルゴリズムによって行われたラリー率に関連していますが、ここで未回答の部分を尋ねます。

SDK 2.0のPercent Done UI コンポーネントは、rally で使用されるアルゴリズムに従ってカードを色付けしません (パーセンテージに基づいて色分けするだけです)。この機能を Rally の機能に合わせて変更するためのカラー コーディング機能またはレンダリング機能を提供する方法はありますか? ありがとう!

[編集] - 既存の機能をオーバーライドして、UI コンポーネントを生成するために行われたパーセントではなくレコードを使用しようとしています

Ext.define('Custom.PercentDone', {
    requires: ['Rally.ui.renderer.template.progressbar.PortfolioItemPercentDoneTemplate', 'Rally.util.HealthColorCalculator'],
    extend  : 'Rally.ui.PercentDone',
    alias   : 'widget.cpercentdone',


    config: {
        record: null
    },

    constructor: function(config) {
        this.initConfig(config);
        config = this.config;
        this.renderTpl = Ext.create('Custom.renderer.template.progressbar.PercentDoneTemplate', {
            calculateColorFn: Ext.bind(function(recordData) {
                console.log('called my custom coloring fn');
                var colorObject = Rally.util.HealthColorCalculator.calculateHealthColorForPortfolioItemData(config.record, config.percentDoneName);
                return colorObject.hex;
            }, this)
        });
        this.renderData = config;
        this.mergeConfig(config);
        this.callParent([this.config]);
    }
});

App.down('#subContainer').add({
    xtype: 'cpercentdone',
    record: item,
    useStoryCount: !App.estimate
});

正しく動作させることができません - calculateHealthColorForPortfolioItemData関数に情報を渡したいのですが、どのパラメーターがどこに渡されているのかがよくわからないため、何をどこに設定すればよいかわかりません。

私も Ext.override を使ってみました:

            var percentDone = Ext.create('Rally.ui.PercentDone', {
                record: item,
                percentDoneName: 'PercentDoneByStoryCount'
            });
            var tpl = percentDone.renderTpl;
            tpl.calculateColorFn = function(recordData) {
                var colorObject = Rally.util.HealthColorCalculator.calculateHealthColorForPortfolioItemData(percentDone.record, percentDone.percentDoneName);
                return colorObject.hex;
            };

            Ext.override(percentDone, {
                renderTpl: tpl
            });
            App.down('#subContainer').add(percentDone);
4

1 に答える 1

0

完了率コンポーネントは、実稼働環境で Rally と同じ方法でどの色になるかを決定します (SDK と製品は同じコードを共有するため)。コンポーネントが使用するテンプレート(ここにあります) を見ると、HealthColorCalculator を使用していることがわかります。

コンポーネントがツールチップに色を付ける方法を変更したい場合は、Ext Overrideを使用して、そのクラスの機能を変更して好きなように色を計算できます。

于 2013-08-21T21:15:12.973 に答える