Реализация единого входа по всей организации, но этот трюк работал для меня. я обнаружить хост:
this._host = window.location.hostname;
, а затем я использую хозяин при построении возвращаемого значения renderer
, так как в результате URL в SSO и не-SSO сценариях в моей среде различается только в принимающей части.
{
text: 'Formatted ID', dataIndex: 'UnformattedID',
renderer: function(val, meta, record) {
return '<a href="https://' + that._host + '/#/detail/userstory/' + record.get('ObjectID') + '" target="_blank">US' + record.get('UnformattedID') + '</a>';
}
}
.
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
this._host = window.location.hostname;
console.log('host', this._host);
var iterationComboBox = Ext.create('Rally.ui.combobox.IterationComboBox',{
listeners:{
ready: function(combobox){
this._iterationOid = combobox.getRecord().get('ObjectID');
this._loadStories(this._iterationOid);
},
select: function(combobox){
this._iterationOid = combobox.getRecord().get('ObjectID');
this._loadStories(this._iterationOid);
},
scope: this
}
});
this.add(iterationComboBox);
},
_loadStories:function(iterationOid){
console.log('loading stories for ', iterationOid);
var myStore = Ext.create('Rally.data.lookback.SnapshotStore', {
autoLoad:true,
fetch : ['Name','_UnformattedID','ScheduleState','_TypeHierarchy'],
filters : [{
property : '__At',
value : 'current'
},
{
property : '_TypeHierarchy',
value : 'HierarchicalRequirement'
},
{
property : 'Iteration',
value : iterationOid
}
],
hydrate: ['_TypeHierarchy'],
listeners: {
load: function(store,records,success){
console.log("loaded %i records", records.length);
this._onDataLoaded(myStore, records);
},
scope:this
}
});
},
_onDataLoaded: function(store,data){
console.log('count',store.getCount());
var that = this;
var records = [];
Ext.Array.each(data, function(record) {
records.push({
Name: record.get('Name'),
ObjectID: record.get('ObjectID'),
UnformattedID: record.get('_UnformattedID')
});
});
var myStore = Ext.create('Rally.data.custom.Store', {
data: records
});
if (!this.down('#grid')) {
this.add({
xtype: 'rallygrid',
id: 'grid',
store: myStore,
columnCfgs: [
{
text: 'Name', dataIndex: 'Name', flex: 1
},
{
text: 'Formatted ID', dataIndex: 'UnformattedID',
renderer: function(val, meta, record) {
return '<a href="https://' + that._host + '/#/detail/userstory/' + record.get('ObjectID') + '" target="_blank">US' + record.get('UnformattedID') + '</a>';
}
}
]
});
}
else{
console.log(store);
this.down('#grid').reconfigure(myStore);
}
}
});
Отлично работает Ник, спасибо вам за помощь! –
Коннер, вас больше всего приветствуют. – nickm