Rally rallyaddnew with Portfolio Items - rally

I have been trying to use a rallyaddnew to add Features and Rollups, which will then be rendered in a grid/cardboard. I got it to work and display, but I cannot customize the text to say create a new "Feature" or "Rollup", rather it says create a new "PortfolioItem/Feature" and "PortfolioItem/Rollup"
{
xtype: 'rallyaddnew',
recordTypes: ['PortfolioItem/Feature', 'PortfolioItem/Rollup'],
listeners: {
recordAdd: function() {
//
},
beforeRecordAdd: function() {
//
}
}
I couldn't find anything in the SDK on how to customize this.

This is a defect. It should be using the display name of the type instead of its type path. I'll file a defect for this. FYI there is also an existing defect around PI types and adding with details that has been fixed but has not been released in an SDK version yet.

Related

Why does a custom document not show up in the bulk edit mode?

I added a custom document as describied in the documentation. Which worked fine, and I can generate it on a single order.
When I go to the bulk edit mode, the standard documents are there, but not my custom document.
Do I have to do something else besides creating my doucument and type for it?
As of today the document types available in the bulk edit form seem to be hardcoded. You will have to override the component to add your custom document type:
Component.override('sw-bulk-edit-order', {
computed: {
documentsFormFields() {
const formFields = this.$super('documentsFormFields');
formFields.push({
name: 'your_document_technical_name',
labelHelpText: this.$tc('path.to.help-text'),
config: {
componentName: 'plugin-bulk-edit-order-documents-generate-custom-document',
changeLabel: this.$tc('path.to.label'),
},
});
return formFields;
}
},
});
You'll also need register a custom component like plugin-bulk-edit-order-documents-generate-custom-document to set the data for the document like a date or add a comment like for invoices. Have a look at the existing sw-bulk-edit-order-documents-generate-invoice for reference.

How can I make a field visible in Rally App builder

I have a Rally grid that I'm creating using the Rally app builder. Standard grid using the defect model. One of the fields in the defect model is set to hidden in the field setup in the Rally Workspaces and Projects setup. I'd like to dynamically make the field visible in my grid so that it only appears on my grid and not on the defect page when entering a defect. Any ideas on how to do that? Thanks.
This was a pretty tricky one. The grid and board components are hard wired to not show data from hidden fields by default and unfortunately there are not any config properties exposed to turn this behavior off. Here's what I came up with:
this.add({
xtype: 'rallygrid',
columnCfgs: [
'FormattedID',
'Name',
'Owner',
{
text: 'Hidden Field', //set column header text
renderer: function(value, meta, record) {
//return the rendered field data
return record.get('c_HiddenField');
}
}
],
context: this.getContext(),
storeConfig: {
model: 'userstory',
fetch: ['c_HiddenField'] //need to explicitly fetch
}
});
Basically you include a column in your columnCfgs without a dataIndex specified. Set the text and renderer to work with your field.
You'll also need to manually fetch your field in the storeConfig since the grid won't understand how to do it otherwise.

viewConfig for getRowClass broken in rc1/2?

I've got an app that I was upgrading to SDK version rc2 from p5. It overrides the getRowClass() function in the viewConfig to change the row color setting the class if there is a tool tip displayed as per the code below...but this code for some reason seems to be broken in rc1 and rc2.
In p5, this function is called once per row (which I can see when it hits the console.log), but does not seeem to be called in rc1/rc2.
Can anybody confirm whether this is a defect is rc2, or a feature that is no longer being supported?
var grid = {
xtype: 'rallygrid',
showPagingToolbar: false,
disableColumnMenus: false,
store: this.gridDataStore,
viewConfig: {
getRowClass: function(record) {
var toolTip = record.get('ToolTip');
console.log('checking tooltip', record);
return toolTip !== null ? 'special-row' : 'normal-row';
},
listeners: { render: this._createToolTip }
},
columnCfgs: this.columnCfgs,
border: 1
};
This is due to a defect in the grid where we are blindly overriding the getRowClass function on the viewConfig w/o checking to make sure there wasn't one there already. Hopefully this defect will be fixed soon. Check out my answer to this other, very similar question: https://stackoverflow.com/a/17891138/728184
You should be able to have your getRowClass function win out by setting it in the beforerender event listener (thereby re-clobbering the one that we put on there, which is really only useful for automated testing anyway and not required in any way for the grid to function correctly).
UPDATE:
I just fixed this in the nightly build, so this should no longer be an issue in public sdk builds beginning with the next public release after 2.0rc2.

Setting card owner 2.0p5

I am updating my custom kanban boards, and running into an issue with the newer API. This worked in 2.0p2, but not working in 5.
I have some code that is trying to set the current card to the current user. This is on the method beforecarddroppedsave.
card.record.set('Owner', con.context.user);
I can set other fields, that seems ok, but when trying to save the User, it isnt working. I have tried just setting the name to the owner, and that doesnt work either.
I looked in the documentation, but cant seem to find it yet, any help would be much appreciated!!
Please try the current App SDK 2.0rc1. This code should set the Owner on the card when the car is moved from one column to another:
var cardBoardConfig = {
xtype: 'rallycardboard',
types: ['Defect', 'User Story'],
attribute: 'ScheduleState',
storeConfig: {
filters: [this.iterationCombobox.getQueryFromSelected()]
},
listeners: {
beforecarddroppedsave: this._onMove,
scope: this
}
};
//..........
_onMove: function(cardboard, card){
var con = Rally.environment.getContext();
card.record.set('Owner', con.context.user);
console.log('ok');
},

sencha touch - custom html template ported from another framework

Previous attempt at this app was done in jqtouch and this effect worked perfectly. Im having a really hard time wrapping my head on how best to do this with sencha touch.
My situation is best described in this image
This is just one item that should populate a carousel so reusing it with different data is paramount (no hard coded html).
thank you
Finally solved it thought I should update it here
Ext.define('mobuy.view.myCarousel', {
extend: 'Ext.carousel.Carousel',
alias: 'widget.myCarousel',
config: {
myitems: 0,
},
updateMyItems: function(newItem) {
var localCarouselItems = [];
Ext.each(newItems, function(item){
localCarouselItems.push({
xtype:'localItem',
data:item.data
});
});
this.setItems(localCarouselItems);
this.setActiveItem(0);
}
})
what this does is basically create an array of new items of type localItem from the store when one calls setMyItems and sets the data (to be used with xtemplate or whatever) for each of those items.
If anybody needs more details please ask and I'll update my answer.