Rally SDK 2.0 displaying debug information - rally

I can get simple queries working and displaying using the new 2.0 framework, I want to display some debug type information back to the screen but I am finding the Rally default app is overlaying everything.
App is based on standard i.e.
Ext.define('ReleaseHistory', {
extend: 'Rally.app.App',
componentCls: 'app',
grid: null,
etc...
What is the best way for me to 'dump' information back to the screen using this framework, lets say I have an array of stuff, in the old SDK I can do something like this:
var results = JSON.stringify(dataAddedOrRemoved);
dojo.byId("debug").innerHTML = results;

Usually the easiest way to inspect code or data in an app is through the developer tools provided by your browser. console.log statements can also be useful.
Otherwise, you will probably find the following guide helpful:
https://help.rallydev.com/apps/2.0rc2/doc/#!/guide/add_content
SDK2 is built on top of ExtJS and everything is a component or a container. You will have a bad time directly modifying the DOM without the framework's knowledge. Here is a simple example of how to just add some arbitrary html content to your app body:
this.add({
xtype: 'component',
html: 'content-goes-here'
});

Related

How to support key code function in Vue.js for smart tv app

I am new at Vue.js.i want to support remote key functionality in Vue.js. So please let me know how to do the app for smart tv.
Maybe caph.js can be used, but it is available only in jquery and angular.
vue and jquery don't mix well together.
//you can add your keyboard keycodes as well(in place of 1,2,3,4)
$(document).ready(function() {
$.caph.focus.init(function(nearestFocusableFinderProvider, controllerProvider) {
controllerProvider.setKeyMap({
LEFT: 1,
RIGHT: 2,
UP: 3,
DOWN: 4
});
});
});
You can devlop Web application for TV following the tutorial:
https://docs.tizen.org/application/web/get-started/tv/first-app
Basing on this site you can just import vue.js file in your application with:
<script src="https://cdn.jsdelivr.net/npm/vue#2.6.11"></script>
and use the necessary Vue.js features in Tizen application.
Regarding using a TV-related features, you can check the list of available features here. From your question I cannot guess which module exactly you would like to use.

Use node-webkit to remote control an iframe?

I'm trying to automate a work flow where we have to log in to a website, navigate, get redirected several times and finally have to upload a file into a reporting system.
After failing with phantomjs/casparjs (where we also do not really get visual feedback) I was thinking about using node-webkit.
So basically, what I am trying to do is writing a "controller" that is opening another webpage in an iframe and then manipulating the fields, hitting buttons, ...
Is this something that can be done? If yes, I am struggeling to get a handle on the fields to fill them...
Or is this a classic "wrong tool" approach and we shouldn't be doing that?
Something along the line of
var new_win = gui.Window.get(
window.open('https://remote/login/site/')
);
gui.Window.get(new_win).on('loaded', function () {
//all of this doesn't really work but might help you to understand what I try to do
//window.console.log(new_win.window.document.getElementById("user"));
//window.eval(new_win, "code_to_fill_the_user_field");
//var userField = new_win.window.document.getElementById("user");
//console.log(userField);
});
Update: 2014-08-02:
I understand now that webkit is intended for creating desktop apps with HTML5 and not remote controlling websites, so we forget about this question.
I did solve the problem with phantomjs/casperjs now, BTW.
I understand now that node-webkit is intended for creating desktop apps with HTML5 and not remote controlling websites, so we forget about this question. I did manage to solve the problem with phantomjs/casperjs now.

Sencha Touch 2: Simulating different profiles (phone/tablet) on Desktop OS (Linux/Windows)

I am learning Sench Touch 2. I figured if I want my app to be "responsive" to phone vs tablet platforms, I can use Profiles.
Ext.define('Mail.profile.Phone', {
extend: 'Ext.app.Profile',
config: {
name: 'Phone',
views: ['Main']
},
isActive: function() {
return Ext.os.is.Phone;
},
launch: function() {
Ext.create('Mail.view.phone.Main');
}
});
I am developing on Arch Linux with Chromium. I installed installed user agent switchers to fake running on a tablet/phone OS, but the profiles doesn't appear to change anything. I added console.log() in the launch function
I wonder if I am using Profiles for the right thing? For example, I may want my app to display a list and a details view on tablets, and the list, animating to the details view
on a phone. If so, do I need a real tablet/phone just to test this profiles?
You can append deviceType=Phone or deviceType=Tablet to simulate these different device types.
Example here:
http://dev.sencha.com/deploy/touch/examples/production/kitchensink/index.html?deviceType=Phone
I usually just change the "isActive" function in the Tablet and Phone profiles in order to achieve this. For example, if I want to test the Phone profile on my laptop, I just change it like this:
isActive: function() {
return !Ext.os.is.Phone;
}
that is the exact opposite of what it should be. This is in fact the function I use in my Tablet profile.

Dimensions of a Dashboard App

I know an app can tell if its running in a dashboard or not (using rally.sdk.util.Context), but is there a way for it to know what the dimensions of the dashboard component is?
For example, how many pixels horizontal and vertical do I have to work with?
Thanks...
On SDK 1.0 apps you can use underlying dojo methods to assist in your App creation.
If you want the current size of your App you can use:
dojo.window.getBox();
That will return you an object that looks like this:
{
"w":1626,
"h":372,
"l":0,
"t":0
}
If you want to read up on that function you can do so on dojo's docs here.

Metro Style Apps: WinJS a must?

Yesterday I have started developing my first Metro style App using JavaScript.
I've used one of those templates in Visual Studio 2011. This project template comes with a bunch of generated code which relies heavily on WinJS. The whole structure reminds of the ASP.NET with its Views and corresponding Code Behind files. There is also a navigator.js file which is responsible for the navigation between the Views. The whole data resides in the data.js and can be retrieved using different functions.
I worked with backbone.js and I found its concepts like MVC structure and routing pretty cool. My question is basically if you can implement such a Metro style App using backbone.js?
Can I eliminate WinJS and just start from scratch? Should I try to integrate backbone.js into the current structure? What would it look like then? Are there any restrictions for using third party JavaScript frameworks? Should I leave the generated structure as it is?
What are the best practices and patterns developing Metro Style Apps with JavaScript?
Thanks
You can use any JavaScript framework you like within a Metro-style JavaScript application. See this related question about jQuery:
jQuery and Windows 8 JavaScript Metro Style Apps
The WinJS framework performs a couple of functions, the first is a set of non-UI APIs for managing and manipulating data, making service requests etc ... These are easily replaced with other JavaScript frameworks. The second is the UI layer, here you might struggle a bit. The WinJS UI has been designed to follow the Metro Design Language. If you replace it with your own UI layer (using jQuery UI for example) your application will just not look right.
Personally I would use WinJS for the UI layer and to integrate with the runtime (state persistance, app switching etc...), but use a more standard JavaScript library, such as Backbone or Knockout for the bulk of my code to ensure portability.
I use Knockout js and Require js for MVVM. For visual effects, I use jQuery.
My data-main looks like a bit this:
(function () {
"use strict";
var app = WinJS.Application;
app.onactivated = function (eventObject) {
require(["/scripts/knockout"], function(ko){
// My knockout viewModel and data binding goes here
});
};
app.start();
})();
If you prefer Backbone in stead, I guess the setup would be similar.