Ember "select" View deadlocks platform.js when content array provided by Controller? - ember.js

I'm working on migrating a non-CLI Ember app to 1.10 with HTMLBars. In a View Template I have a select list rendered by Ember.Select View where it's content is obtained from an array property in the Controller (adultsSelect: (1).upto(4)). I changed 'Ember.Select' to '"select"' as the updated docs suggest. As soon as I setup the 'view select' with 'content=adultsSelect', the browser deadlocks, I'm prompted to stop, debug or continue line 13 in 'platform.js'. If I go into 'debug', I don't know what I'm debugging, but I see a sort of infinite recursion of calls or references to 'platform.js'. If I change the array assignment to just 'adultsSelect: ["1","2"]', there's no improvement. 'Platform.js' is a product of the Polymer project which has something to do with upcoming web components technologies which Ember is using in advance. However, Polymer now says that 'web components polyfills' were released in the past as 'platform.js' so seems I'm already out-of-date with this. It's funny that something as simple as a select list with 4 options can be so complex in Ember that when you go to migrate to a new version, your browser locks up, doesn't tell you why, there's no docs to say this will happen and what to do about it, but that an obsolete version of an upcoming technology being used in advance is somehow involved in it. Should I look for a bower dependency related to web components and update that so I get a compatible version?

For this, I simply removed 'platform.js' as a script linked into 'index.html' and now select lists work, at least in the development build running on node express.

Related

Internal autolinking in Ember.js

I've tasked myself with implementing a twitter clone in Ember.js in order to get more familiar with the framework. I've hit a bit of a snag however when it comes to implementing autolinking in the tweet.
There is an existing plugin that does external links (ex. http://www.google.com) well but doesn't work well for internal links (like #handle or #hashtags) which should as it should be implemented as a LinkComponent but I can't figure out how to insert one from a helper.
source code: autolink helper (relevant unit test)
For now I have just had the helper insert a <a/> tag but this sucks as it unloads the page and fetches everything fresh from the server.
Anyone have any suggestions about how best to implement this part of my Ember app?
Figured it out myself - I converted the helper into a component and added a click listener for bubbled click events from the child links which then get passed to the router:
https://github.com/whoward/ember-twitter-clone/commit/93af68d9f504b8b8972487e6c09851d3523a3678

ember.js: prepare code to move from ember 1.x to ember 2.0

My question is: Can someone direct me in moving from controller based application to component base application?
I am building a map application for my dog training club. We are specialized in helping finding missing people.
In order to organize our training, we need an application to draw trails and add items on them etc.
I've started an app using Ember-Cli and OpenLayers-3. The application is working nicely, but I would like to move the code from controller based to component base approach.
I would like also to use more routing as at the moment, I have only one route and all user interactions are handled using actions.
I've setup a repository on github for those who would be kind enough to help me:
https://github.com/mylen/mantrailling
if you want to checkout the code and test the app localy, you'll need to modify the referer using a header mod in your navigator to use http://demo.melard.fr
You can see a beta of the website at that page :
http://recherche.utilitaire.melard.fr/beta/map
Thank you in advance,
First, we should clarify the intended uses of components, controllers and routes in ember.js.
Components are similar to Views, but they are isolated and therefore used to create reusable pieces of code, that handle the visual representation of your models.
Controllers are mainly used to decorate your models, but also to hold application state.
Routes represent you current application state. They are responsible for loading your models and to initialize your controllers.
To solve your first problem (controllers -> components), you only need to move all view related stuff, and only this, into components. Your code that decorate your model, for example the active flag of a way-point, remains in the controller. You only need to bind the data of your models/controllers to the components, via embers data binding. (http://guides.emberjs.com/v1.11.0/components/passing-properties-to-a-component)
Your second problem (use routes) is a bit harder to solve, I think. First you need to find all of the states your app currently have. After that, you should move your model loading and saving stuff into this routes.
Edit
Some references describing the problem.
https://github.com/ef4/rfcs/blob/routeable-components/active/0000-routeable-components.md
https://www.youtube.com/watch?v=QgycDZjOnIg
Edit 2
Your question is highly related to How to move ember from 1.x to 2.0, because the changes you mentioned will come along with ember 2.0.
Here are some additional links that describe how to prepare best for this upgrade.
https://gist.github.com/samselikoff/1d7300ce59d216fdaf97
https://speakerdeck.com/tomdale/ember-2-dot-0-in-practice
http://discuss.emberjs.com/t/what-is-a-good-way-to-do-this-in-ember-2-0-no-itemcontroller-no-arraycontroller/6649
You can find a lot of resources if you search for ember 2.0.
Edit 3
Here is I think the most informative source for keeping up with new Ember releases:
https://www.youtube.com/watch?v=wsydQzQF4Ww

How to add custom menu in Sitecore menu list

i want to add my custom application name in Sitecore Start Menu List, i'm following this article :
Adding Application Shortcut
it saying use Core database i'm using this, i couldn't find Layout studio, can any sitecore developer suggest me how to find this and finish my job. Thanks in advance.
I think the instructions you've linked to there are out of date. I've not seen that bit of UI in recent releases of Sitecore.
Working in Sitecore 6.6 I've successfully made custom applications using these instructions:
http://sdn.sitecore.net/Articles/Customizing%20Sitecore%20Client/Adding%20an%20Application%20Shortcut/Creating%20an%20Application.aspx
But beware the issue that I've blogged about here. The recent revisions of Sitecore subtly break the configuration defined above, and you have to manually edit out a file extension to make everything work:
https://jermdavis.wordpress.com/2014/10/20/a-gotcha-with-custom-applications/
-- Edited to add --
Based on the "it doesn't work in 7.5" comment below, I've tried these instructions on a test instance of Sitecore 7.5 rev 141003. It seems 7.5 behaves slightly differently - but I can still make it work.
Create the item under /sitecore/content/Applications using the external link button for the "Application" field. With raw values displayed, it should look something like:
And then create your application shortcut under /sitecore/content/Documents and settings/All users/Start menu using an internal link for the Application field. I found this still added the '.aspx' extension mentioned in my blog post, but I also found that editing it out again didn't work - it reappeared as soon as I hit save. I needed to edit out the extension from the link data using the Raw Values view in order to get the data shown below:
With those things set up, refreshing the page caused the test item to appear on my start menu:
Hopefully that works for you too?
-- Further edited to add --
New blog post covering this problem in Sitecore 7.5:
https://jermdavis.wordpress.com/2015/01/19/gotchas-with-custom-apps-v2/
Which version of Sitecore are you using? The Layout Studio is probably one of the least features in Sitecore, and personally not something I have ever used.
Instead you should create the the layout in Visual Studio - which then means your layout can be added to your Source Control System. Then follow the instructions in the link in Jeremy's answer.
If you do need to access the Layout Studio for some reason you can find it under: Sitecore menu > Development Tools > Developer Center. From there you can create new files/open existing files.

How to make basic ember setup in jsFiddle

I'm trying to test my ember code in my jsFiddle
I set framework to Ember 1.0.0-rc1 and onDomReady
and I added jQuery as a resource.
and I setup basic application template in html and declare application in js.
I think I set very basic of an ember app. but it doesn't work.
What am I missing here?
There is an up to date fiddle/jsbin link in the Ember Contributing document:
https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md
It is always up to date with the master version of ember.
Two things are going wrong here.
There is a bug in the way jsFiddle has implemented ember support. First off it should be including jQuery, and also it is loading ember before handlebars. You can see what's going on by right-clicking on the output frame and selecting view-source. As a workaround, manually add references to these libraries.
You've got a typo. Instead of type="type/handlebars" you should specify type="text/handlebars"
Working fiddle here
You should definitely use emberjs.jsbin.com. It has everything already setup.

TFS2010 - How can you change the "State" for a Task?

We are using Tasks to track individual development items and the "out of the box" configuration gives us only 2 states - Active and Closed. We would like to change it to:
Assigned
In Development
In Test
Ready for Production
Closed (In Production)
Any ideas on how to accomplish this? We've been through everything in the Admin site. I fine changing it in the DB if necessary but am not sure what should be changed - or if it is even in the DB.
Those are defined by the project template you selected when you created your project (MSF Agile for instance).
To customize, you can export your existing template(s), modify as needed, then import them back in.
Here is the MSDN link for customizing work item types. And here is the link for changing the workflow of a work item type (seems like you'd need to do this too).