I'm currently working with comboboxes and filters to implement an option to select all instances of a desired field. With that said, I know to use the noEntryText attribute to set what originally defaults to "--No Entry--" as "All". However, the changes do not seem to apply when I use this on custom fields provided by my Web Services API (those fields with the "c_" before them).
Strangely enough though, this convention works for other fields that I use that do not have the "c_" before them. So is this a known defect just for custom fields or is there a workaround to this issue?
I filed a defect that replacing noEntryText to a custom value works for rallyfieldvaluecombobox for standard fields, but not custom fields.
If rallyfieldvaluecombobox uses a standard field, e.g. Environment, then no entry can be replaced successfully:
Here is the js file:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
this.add({
xtype: 'rallyfieldvaluecombobox',
itemId: 'aBox',
fieldLabel: 'Filter by filed:',
model: 'defect',
//field: 'c_CustomBox',
field: 'Environment',
noEntryText: 'All',
useNullForNoEntryValue: true,
allowNoEntry: true,
listeners: {
select: this._onSelect,
ready: this._onLoad,
scope: this
}
});
},
_onLoad: function() {
this.add({
xtype: 'rallygrid',
columnCfgs: [
'FormattedID',
'Name',
//'c_CustomBox'
'Environment'
],
context: this.getContext(),
storeConfig: {
model: 'defect',
filters: [this._getStateFilter()]
},
width: 500
});
},
_getStateFilter: function() {
if (!this.down('#aBox').getValue()) {
return 1;
}
else{
return {
//property: 'c_CustomBox',
property: 'Environment',
operator: '=',
value: this.down('#aBox').getValue()
};
}
},
_onSelect: function() {
var grid = this.down('rallygrid'),
store = grid.getStore();
store.clearFilter(true);
store.filter(this._getStateFilter());
}
});
If the same rallyfieldvaluecombobox uses a custom field, then no entry string cannot be replaced:
In both cases the functionality of replacing the filtering behavior works fine.
Related
Question 1: Is it possible to add custom data (Ex: testcase count : 5) to each card in a story board? If so, how? I couldn't find an example or specific information in documentation.
Question 2: Is it possible to get testcase count (including child story testcases)for a highlevel story in one query?
Please let me know. Here's my code
Ext.define('Rally.Story.View', {
extend: 'Rally.app.App',
launch: function() {
this.add({
xtype: 'rallyfieldvaluecombobox',
fieldLabel: 'Filter by Target Release:',
model: 'UserStory',
field: 'c_TargetRelease',
value: '15.0',
listeners: {
select: this._onSelect,
ready: this._onLoad,
scope: this
}
});
},
_onLoad: function() {
this.add({
xtype: 'rallycardboard',
types: ['User Story'],
attribute: 'ScheduleState',
readOnly: true,
fetch: ['Name', 'TestCases', 'c_StoryType', 'c_TargetRelease', 'PlanEstimate', 'Priority', 'TaskEstimateTotal', 'TaskRemainingTotal'],
context: this.getContext(),
cardConfig: {
editable: false,
showIconsAndHighlightBorder: false,
fields: ['Name', 'c_StoryType', 'c_TargetRelease', 'PlanEstimate', 'c_PriorityBin', 'Parent', 'TestCases', 'TaskEstimateTotal', 'TaskRemainingTotal']
},
storeConfig: {
filters: [
{
property: 'c_StoryType',
value: 'SAGA Feature'
},
{
property: 'c_TargetRelease',
operator: '=',
value: this.down('rallyfieldvaluecombobox').getValue()
}
]
}
});
},
_onSelect: function() {
var board = this.down('rallycardboard');
board.refresh({
storeConfig: {
filters: [
{
property: 'c_StoryType',
value: 'SAGA Feature'
},
{
property: 'c_TargetRelease',
operator: '=',
value: this.down('rallyfieldvaluecombobox').getValue()
}
]
}
});
},
});
Here's a sample card I made that contains the test case count:
You can add a field by simply including an object with some rendering information in it instead of just a simple string in the fields array in the cardConfig:
cardConfig: {
fields: [
'Name', //simple string field to show
{
name: 'TCCount', //field name
hasValue: function() {return true;}, //always show this field
renderTpl: Ext.create('Rally.ui.renderer.template.LabeledFieldTemplate', {
fieldLabel: 'Test Case Count', //the field label
valueTemplate: Ext.create('Ext.XTemplate',
['{[this.getTestCaseCount(values)]}',
{getTestCaseCount: function(data) { return data.Summary.TestCases.Count;}}])
})
},
//additional string fields
'PlanEstimate', 'Parent', 'TestCases', 'TaskEstimateTotal', 'TaskRemainingTotal']
}
This ended up being less straightforward than I thought it might be, but at least it is doable. The key part is using the LabeledFieldTemplate, specifying a field label and a value template to actually render the content.
You'll also notice the little beaker status icon in the footer which is automatically rendered because TestCases was included in the fields list.
As for your second question there is no roll up field on story for the total number of test cases included on child stories.
I have a few custom fields on my portfolio item such as c_TrafficLightCost. but when I pass it in the fetch, to create my grid, it doesn't create a columns with the value of the custom field.
Here is my code:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
console.log('Our First App woot!');
this._loadData();
},
// Get data from Rally
_loadData: function() {
var myStore = Ext.create('Rally.data.wsapi.Store', {
model: 'portfolioitem/deliverable',
autoLoad: true,
listeners: {
load: function(myStore, myData, success) {
console.log('got data!', myStore, myData, success);
this._loadGrid(myStore);
},
scope: this
},
fetch: ['FormattedID', 'Name', 'c_TrafficLightCost' ]
});
},
// Create and Show a Grid of given stories
_loadGrid: function(myStoryStore) {
var myGrid = Ext.create('Rally.ui.grid.Grid', {
store: myStoryStore,
columnCfgs: [
'FormattedID', 'Name', 'c_TrafficLightCost'
]
});
this.add(myGrid);
console.log('what is this?', this);
console.log(this.c_TrafficLightCost);
}
});
What I want is for the traffic light to be a column in the grid
Can anyone help me?
Thanks.
Best regards Martin
Remove c_ in front of the custom field name. Try TrafficLightCost and see if that does it. I confirmed that the code posted in this git hub repo does not show values for custom fields (the column is empty) when c_ is prepended to the field name. I think this is a defect.
I have no issues showing the parent for features in my cardboard when the cardboard is only displaying features:
cardConfig: {
xtype: 'rallycard',
listeners: {
fieldclick : function(field, card) {
_loadDetails(card);
}
},
fields: [
'Name',
// 'Parent' - either one of these ways works
{
name: 'Parent',
fetch: ['Parent'],
renderTpl: Ext.create('Ext.XTemplate', 'Parent: {Parent.Name}')
}
]
},
However, when my kanban board is displaying both features and rollups, the parent information does not display on the card. I have tried conditionally setting it, or using a renderer instead of a renderTpl (the renderer was never called) - I cannot find a way to do this correctly in the API docs.
Here is an App.js code where the Theme cards do not show Parent field, but Feature and Initiative cards do:
Ext.define('CustomApp', { extend: 'Rally.app.App', componentCls: 'app',
launch: function() {
var addNewConfig = {
xtype: 'rallyaddnew',
recordTypes: ['PortfolioItem/Feature', 'PortfolioItem/Initiative', 'PortfolioItem/Theme'],
ignoredRequiredFields: ['Name', 'Project'],
showAddWithDetails: false,
};
this.addNew = this.add(addNewConfig);
var myCardConfig = {
xtype: 'rallycard',
fields: ['State','Parent']
}
var cardBoardConfig = {
xtype: 'rallycardboard',
types: ['PortfolioItem/Feature', 'PortfolioItem/Initiative', 'PortfolioItem/Theme'],
attribute: 'InvestmentCategory',
cardConfig: myCardConfig
};
this.cardBoard = this.add(cardBoardConfig);
}
});
Using the 2.0p4 JavaScript SDK, I am trying to recreate a grid app I created previously using 1.30 JavaScript SDK, and am having problems creating a complex filter (with multiple ANDs and ORs).
Here is the query from the 1.30 version:
function itemQuery() {
var queryObject = {
key: 'defect',
type: 'defect',
fetch: 'FormattedID,Name,State,ScheduleState,SupportNumber,OpenedDate,Priority,Rank,Severity,SubmittedBy,Owner,Iteration,Release,Project',
query: '(((((SupportNumber contains "RNT") OR (SupportNumber contains "NS")) OR (SupportNumber contains ":")) OR (SupportNumber contains "CASE")) AND (State != Closed))',
project: null
};
So I querying for items that contains "RNT", ":", "NS", or "CASE" AND are not closed.
(SupportNumber is a custom field, which people have entered data in differently at different points)
And here is my App.js from the new version I am trying to create:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
Rally.data.ModelFactory.getModel({
type: 'Defect',
context: {
workspace: 'workspace/12345',
project: null,
},
success: function(model) {
this.grid = this.add({
xtype: 'rallygrid',
model: model,
columnCfgs: [
'FormattedID',
'Name',
'SupportNumber',
'Priority',
'Severity',
'State',
'Iteration',
'Release',
'Project',
'Owner',
'SubmittedBy'
],
storeConfig: {
filters: [
{
property: 'State',
operator: '!=',
value: 'Closed'
},
{
property: 'SupportNumber',
operator: 'contains',
value: 'RNT'
}
]
}
});
},
scope: this
});
}
});
I can see that just by adding filters to the config, you create ANDs, however I am lost in the documentation with how to create ANDs and ORs filters in the same config.....
Any direction anyone can give on how to create filter configs for App SDK 2.0, that use multiple ANDs and ORs, would be greatly appreciated.
Check out:
Rally.data.QueryFilter
Along with this Stackoverflow Answer:
Rally App SDK 2.0: Cannot modify QueryFilter object after initial creation
Which shows a nice example of using Rally.data.QueryFilter to prepare an array of filters representing multiple conditions.
I'm displaying a link to a defect in a Rally Grid in the simple way:
columnCfgs: ['FormattedID', 'Name', ...]
This creates a link to the defect, just like it should. But the column width is way too big. But if I do the following, I loose the link:
columnCfgs: [{dataIndex: 'FormattedID', width: 50, text:'ID'}', 'Name', ...]
Is there a convenient xtype I can use to adjust the width, but still have a link to my defect?
Unfortunately there is not an easy way to do this right now. We are going to fix this before we GA the SDK 2.0. For now here is a workaround:
Ext.define('DefectGridApp', {
extend: 'Rally.app.App',
launch: function() {
Rally.data.ModelFactory.getModel({
type: 'Defect',
success: function(model) {
//Get the default field config
var field = model.getField('FormattedID');
var fieldConfig = Rally.ui.grid.FieldColumnFactory.getColumnConfigFromField(field);
//Override with your values
fieldConfig.width = 10;
this.grid = this.add({
xtype: 'rallygrid',
model: model,
columnCfgs: [
fieldConfig, //pass your overridden formatted id field here
'Name',
'Owner'
]
});
},
scope: this
});
}
});
For a slightly differnt solution see: this question for how to add the link back to your original try.