JSDoc3 & DocStrap: Global menu is missing in the navigation - jsdoc3

The Global menu missing in the navigation while:
The global.html file exists
The Global entry is present in the right TOC when no template is used
Is there a special setup to use in order to ask DocStrap Template to add the Global menu to the navigation?
Hereinafter is my setup:
Gruntfile.js
jsdoc: {
all: {
src: [
'./src/main/js/**/*.js',
'./README.md',
],
options: {
destination: 'doc',
tutorials: './src/main/js/tut',
configure : "jsdocconf.json",
template: 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template',
},
}
},
jsdocconf.json
{
"tags": {
"allowUnknownTags" : true
},
"plugins" : ["plugins/markdown"],
"templates": {
"cleverLinks" : true,
"monospaceLinks" : true,
"dateFormat" : "ddd MMM Do YYYY",
"outputSourceFiles" : false,
"outputSourcePath" : false,
"systemName" : "Name",
"footer" : "",
"copyright" : "Copyright",
"navType" : "vertical",
"theme" : "spacelab",
"linenums" : true,
"collapseSymbols" : false,
"inverseNav" : false,
"highlightTutorialCode" : true
},
"markdown" : {
"parser" : "gfm",
"hardwrap" : false
}
}

You need to make sure that your documentation comments are specifying things that exist at the global level. #typedef is a good example of a thing that ends up being global. Here's an example:
/**
* One of the following:
* <code>'css'</code>, <code>'hbs'</code>, <code>'img'</code>, <code>'js'</code>
* #typedef {String} SupportedAssetType
*/
EDIT: I'm assuming the downvote means the asker does indeed have global entries such as at least one #typedef.

Related

Get from jenkins list of nodes by label - by REST API

I need to GET list of nodes that contains certain label.
I know how to do that by getting entire nodes list by using Jenkins REST API and then getting node by node also REST API and checking its labels - but its to many API calls.
I also can create some job that writing to some place nodes list by label as parameter - but its bad way as Jenkins job that triggered remotely have no return value and I cant know it finished and will need read results from some other place the job saved it there.
I need some way that by one API call I will get nodes list contains a given label.
You can run a single API call to <JENKINS_URL>/computer/api/json (or <JENKINS_URL>/computer/api/python for a python api) which return a list of all nodes and their properties.
One of the properties is the label - so just go over all nodes and extract the ones that contain your needed label.
Here is an example for the returned object:
{
"_class" : "hudson.model.ComputerSet",
"busyExecutors" : 0,
"computer" : [
{
"_class" : "hudson.model.Hudson$MasterComputer",
"actions" : [
],
"assignedLabels" : [
{
"name" : "built-in"
}
],
"description" : "the Jenkins controller's built-in node",
"displayName" : "Built-In Node",
"executors" : [
{
},
{
}
],
"icon" : "symbol-computer",
"iconClassName" : "symbol-computer",
"idle" : true,
"jnlpAgent" : false,
"launchSupported" : true,
"loadStatistics" : {
"_class" : "hudson.model.Label$1"
},
"manualLaunchAllowed" : true,
"monitorData" : {
"hudson.node_monitors.SwapSpaceMonitor" : {
"_class" : "hudson.node_monitors.SwapSpaceMonitor$MemoryUsage2",
"availablePhysicalMemory" : 6938730496,
"availableSwapSpace" : 6906019840,
"totalPhysicalMemory" : 16885276672,
"totalSwapSpace" : 21046026240
},
"hudson.node_monitors.TemporarySpaceMonitor" : {
"_class" : "hudson.node_monitors.DiskSpaceMonitorDescriptor$DiskSpace",
"timestamp" : 1653907906021,
"path" : "C:\\Windows\\Temp",
"size" : 426696622080
},
"hudson.node_monitors.DiskSpaceMonitor" : {
"_class" : "hudson.node_monitors.DiskSpaceMonitorDescriptor$DiskSpace",
"timestamp" : 1653907905929,
"path" : "C:\\ProgramData\\Jenkins\\.jenkins",
"size" : 426696622080
},
"hudson.node_monitors.ArchitectureMonitor" : "Windows 10 (amd64)",
"hudson.node_monitors.ResponseTimeMonitor" : {
"_class" : "hudson.node_monitors.ResponseTimeMonitor$Data",
"timestamp" : 1653907905941,
"average" : 0
},
"hudson.node_monitors.ClockMonitor" : {
"_class" : "hudson.util.ClockDifference",
"diff" : 0
}
},
"numExecutors" : 2,
"offline" : false,
"offlineCause" : null,
"offlineCauseReason" : "",
"oneOffExecutors" : [
],
"temporarilyOffline" : false
}
],
"displayName" : "Nodes",
"totalExecutors" : 2
}
You are interested in the assignedLabels object - notice that it can contain multiple labels.

How to query for all Artifacts of a Milestone

I am attempting to create reports on Milestones using App SDK 2.0 and would like to find all User Stories that have been assigned to the Milestone.
I tried pulling out the Artifacts from a Milestone using getCollection.
Ext.create('Rally.data.wsapi.Store', {
model : 'Milestone',
filters : [ {
property : 'ObjectID',
operator : '=',
value : milestone.get("ObjectID")
} ],
fetch : [ 'Artifacts' ],
limit : Infinity,
autoLoad : true,
listeners : {
load : function(store, records) {
var record = records[0];
var info = record.get('Artifacts');
var count = info.Count;
record.getCollection('Artifacts').load({
fetch : [ 'ObjectID' ],
callback : function(records, operation, success) {
Ext.Array.each(records, function(artifact) {
console.log(artifact.get('ObjectID'));
});
}
});
}
}
});
I get the following error:
Uncaught Rally.data.ModelFactory.getModel(): Could not find registered
factory for type: Artifact sdk-debug.js:7078
From https://rally1.rallydev.com/slm/doc/webservice/, it doesn't seem that Milestones is query able on the User Story or PortfolioItem. I tried it anyway using Tasks syntax and it nothing was returned.
Ext.create('Rally.data.wsapi.Store', {
model : 'UserStory',
filters : [ {
property : 'Milestones',
operator : 'contains',
value : milestone.get("_ref")
} ],
fetch : [ 'ObjectID' ],
limit : Infinity,
autoLoad : true,
listeners : {
load : function(store, records) {
console.log(records);
}
}
});
There is a defect in AppSDK2 that it does not work with abstract types, e.g. Artifact, UserPermissions.
Your first code example ran into that defect.
But your second code example must work. I suspect if it does not work for you it is a matter of scoping. Perhaps the milestone you filter by is not in the project you are scoped to. You may hard code a project ref in the context of the store to make sure it is looking in the right project. I initially tested your code in my default project and it worked as is, and then I modified it as follows to make sure it finds a milestone in a non-default project:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
Ext.create('Rally.data.wsapi.Store', {
model : 'UserStory',
context:{
project: '/project/16662089077'
},
filters : [
{
property : 'Milestones',
operator : 'contains',
value : "/milestone/33215216897"
}
],
fetch : [ 'ObjectID' ],
limit : Infinity,
autoLoad : true,
listeners : {
load : function(store, records) {
console.log(records);
}
}
});
}
});

Hydrate object fields

I want to get Feature object for User Stories that I got from lookback API.
But when I try to hydrate Feature I get only UnFormatted feature ID.
Can I get real Feature objects for User Stories from lookback result set?
Below the example of code that I use for retrieving data:
storeConfig: {
find: {
"_TypeHierarchy": { '$in' : [-51038] },
"Children": null
},
fetch: ["ScheduleState", "PlanEstimate", "ObjectID", "_ValidFrom", "_ValidTo", "c_BaselineDeliveryConfidence", "Name", "Feature"],
hydrate: ["ScheduleState", "c_BaselineDeliveryConfidence", "Name", "Feature"],
sort: {
"_ValidFrom": 1
},
compress: true,
useHttpPost: true
It is not possible to hydrate objects straight out of the LBAPI. However, I have been working on a helper class to do just that, using a method similar to what Nick suggested.
https://github.com/ConnerReeves/RallyHelpers/blob/master/RecordHydrator/RecordHydrator.js
Here's an example of how it's used. I'm gathering all leaf User Stories (that have an iteration assignment) and then hydrating that Initiative field:
launch: function() {
var self = this;
Ext.create('Rally.data.lookback.SnapshotStore', {
limit : Infinity,
fetch : ['Name','Iteration'],
filters : [{
property : '__At',
value : 'current'
},{
property : '_TypeHierarchy',
value : 'HierarchicalRequirement'
},{
property : 'Iteration',
operator : '!=',
value : null
},{
property : 'Children',
value : null
}]
}).load({
params : {
compress : true,
removeUnauthorizedSnapshots : true
},
callback : function(records, operation, success) {
self._hydrateRecords(records);
}
});
},
_hydrateRecords: function(records) {
Ext.create('CustomApp.RecordHydrator', {
fields: [{
name : 'Iteration',
hydrate : ['Name','StartDate','EndDate']
}]
}).hydrate(records).then({
success: function(hydratedRecords) {
console.log(_.groupBy(hydratedRecords, function(record) {
return record.get('Iteration') && record.get('Iteration').get('Name');
}));
}
});
}
Feature is a full object to which a user story has a reference to (via Feature attribute).
Your code which is similar to this query:
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/111/artifact/snapshot/query.js?find={"_TypeHierarchy":"HierarchicalRequirement"}&fields=["Name","ScheduleState","PlanEstimate","Feature"]&hydrate=["ScheduleState"]
will return something like this:
{
Feature: 12483739639,
Name: "my story",
ScheduleState: "Defined",
PlanEstimate: 3
}
where 12483739639 is ObjectID of the Feature. Adding "Feature" to the hydrate will not make a difference.
If you want to get the full Feature object or some of its attributes, in your code you may use the OID of the feature and issue a separate query. You may also push those OIDs into an array and use $in operator in that second query.

Using a proxy in a store in Sencha Touch 2

My goal with this project is to load Json that's outputted by a script on a web server so that I can display data in a List in Sencha Touch 2.
I've looked at countless examples including answers from other people's questions on this website and I still can't seem to figure out what the problem is with my code. I'm sure it's something very small or perhaps some rule that I'm unaware of, but I hope someone can point me in the right direction.
Here's my Model:
Ext.define('Sencha.model.Location', {
extend: 'Ext.data.Model',
config: {
fields: ['name','location','open','details']
}
});
Here's my Store:
Ext.define('Sencha.store.Locations',{
extend: 'Ext.data.Store',
requires:[
'Sencha.model.Location',
],
config: {
model: 'Sencha.model.Location',
storeId: 'Locations',
proxy: {
type: 'ajax',
url : 'http://url/to/locations.php?filetype=.json',
reader: {
type: 'json',
},
autoLoad: 'true'
}
}
});
Here's the view where I want it to show up:
Ext.define('Sencha.view.LocationList',{
extend: 'Ext.List',
alias: 'widget.LocationList',
xtype: 'locationlist',
config: {
title: 'What\'s Open #CU',
disableSelection: true,
itemTpl: '<img src="http://localhost/{open}.png" style="width:16px;height:16px;margin-right:8px;" />{name}<span style="font-size:9pt;margin-left:8px;color:#888;">{location}</span>',
store: 'Locations',
onItemDisclosure: true
}
});
Here's the JSON that's outputted(maybe it's a formatting problem that causes it to fail silently?)
{
"businesses":
{
"name" : "Baker's"
"location" : "4th Floor Uni Centre"
"open" : "open"
"details" : "This is some information."
}
}
You JSON is not valid. You forgot the commas :
{
"businesses":
{
"name" : "Baker's",
"location" : "4th Foor Uni Centre",
"open" : "open",
"details" : "This is some information."
}
}
Also, if you intend to send more than one business, you might want to change the JSON format to something like this :
{
"businesses":[
{
"name" : "Baker's",
"location" : "4th Foor Uni Centre",
"open" : "open",
"details" : "This is some information."
},
{
"name" : "Baker's",
"location" : "4th Foor Uni Centre",
"open" : "open",
"details" : "This is some information."
}
...
]
}
and then add the rootProperty: 'businesses' to you're proxy's reader like nuthan said.
Hope this helps
Add rootProperty:'businesses' in the reader: {
type: 'json',
rootProperty:'businesses'
} of your Store.
Is
http://url/to/locations.php
the same Location as your sencha touch app?
If not, than JsonP Proxy is needed. JsonP wraps Json data into function like context to make useable.

node.updateInfo is not a function while appending node in extjs

I am trying to load data into an extjs 4 TreeStore but while appending node, I am getting node.updateInfo is not a function error.
My model classes are as follows :
Dimension.js
Ext.define('ilp.model.Dimension', {
extend : 'Ext.data.Model',
require : [
'ilp.model.DimensionLevel'
],
fields : [
'actualName',
'displayName'
],
hasMany : {model : 'ilp.model.DimensionLevel', name : 'dimensionLevels'}
});
DimensionLevel.js
Ext.define('ilp.model.DimensionLevel', {
extend : 'Ext.data.Model',
fields : [
{name : 'name', type : 'string'},
{name : 'totalTrainees', type : 'int'}
]
});
and tree store code is as follows :
Ext.define('ilp.store.DimensionTree', {
extend : 'Ext.data.TreeStore',
requires : [
'ilp.model.Dimension',
'ilp.model.DimensionLevel'
],
model : 'ilp.model.Dimension',
root: {
name: 'Dimensions'
},
proxy: {
type: 'ajax',
url: 'http://localhost:8080/pentaho/content/cda/doQuery',
reader: {
type: 'pentahoReader',
root: 'resultset'
},
extraParams: {
path: 'RINXDashboards%2FCDAs%2FILP_Employee_Qeries.cda',
dataAccessId:'Get_All_Levels_From_All_Dimensions',
userid : 'joe',
password : 'password'
}
},
listeners: {
append : function(parentNode, newNode, index, options) {
if(newNode.get('text') != 'Root') {
console.log('newNode text value = ' + newNode.get('text'));
newNode.set('checked', null);
newNode.set('expandable', true);
if(Ext.ClassManager.getName(newNode) == "ilp.model.Dimension") {
newNode.set('expanded', true);
newNode.set('text', newNode.get('displayName'));
if(newNode.dimensionLevels().getCount() > 0) {
newNode.dimensionLevels().each(function(level) {
newNode.appendChild(level);
});
} else {
newNode.set('leaf', true);
}
}else if(Ext.ClassManager.getName(newNode) == "ilp.model.DimensionLevel") {
newNode.set('leaf', true);
newNode.set('text', newNode.get('name'));
}
}
}
}
});
I am getting above error on following line :
newNode.dimensionLevels().each(function(level) {
while debugging I have found that updateInfo() method of newNode is undefined.
Can anyone please tell me why this error is coming? I am totally clueless now !!!
May this is caused by the bug EXTJSIV-6051
see Sencha Forum for further infos
I think your problem comes from :
root: {
name: 'Dimensions'
},
root attribute must be of type: Ext.data.Model/Ext.data.NodeInterface/Object. So try to replace 'root' attribute by this:
root: {
text: "Dimensions",
leaf: false
}
Check Sencha doc for more information: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tree.Panel-cfg-root