Create new Linked Work Item in TFS2010 - can I set default values? - tfs-workitem

When we create a new linked work item New Linked Work Item... or Ctrl+Shift+L, is there a way to copy the title and other data from the original work item ?
Here's the scenario: I have a custom Work Item Type called Code Review which needs to be created for every task. Not every one, but most ones. Sure, one could open both work items and copy, but I'm trying to make it as simple as possible.
What I really want to do is a VS2010 extension with a button to create the code review work items. But before I resort to that, I wanted to know if there is a simpler (and quicker) way to create new linked work items.

If you use the 'Create copy of work item..' & set the WI-type to what you need, all matching fields should get copied.

Related

Replace many components reference kotlin android

I have created an app in kotlin, my very first idea was to avoid creating many activities, instead of doing that, I decided to create many layouts and hide or show them instead of changing between activities.
Late I found I made a mistake coz my code went so large that android couldn´t handle it, so I ended up creating the activities to spare my code among those.
However I decided to copy the code inside the layouts in my new activities, everything worked great but one thing. My code is linked to the activity_main components, instead to the components copied to the new activities (coz I have 2 of each, one in activity_main and one in the new activities).
I started to replace this by deliting two letters of every component and selecting the one that belongs to the new activity, but this will take me like forever.
Example, I had this code in my activity_main:
webView.loadUrl("http://www.url1.com")
webView2.loadUrl(http://www.url2.com")
phone.text = "phoneno"
I´m deleting "ew" from webView so it allows me to choose the webview located in my activity_new, and then the same for webView2 and again and again with all my components.
Is there a faster way to do this?
Regards
My code is linked to the activity_main components, instead to the components copied to the new activities that happened because by copy/paste you had in the other activities this:
import kotlinx.android.synthetic.main.activity_main.*
change it to:
import kotlinx.android.synthetic.main.activity_other.*
Also did you copy/paste setContentView(R.layout.activity_main); in onCreate()? If yes change it too.
Also in the other activity layouts change tools:context=".MainActivity" if it exists

List of News Articles In Sitecore (Best Approach?)

I am creating a Sitecore MVC site for a client and I need to create page that will list news articles for the company.
So far, I have created items that use a shared data template called “Article,” and I also have a sublayout (a view rendering) called “Article” that will display these items.
For the list itself, my plan was to create another component (a sublayout) call “News_List”, and to put a placeholder in it called “List”.
My question is this: can I allow the author to insert articles (e.g., N items of type “Article”) into this placeholder via the page editor?
Will SC allow you to insert multiple instances of the same component into a placeholder? Will this break anything?
I believe this is a pretty common question but I have not found a definitive answer. Thanks in advance…!
You can insert as many components (of the same type) in your placeholder as you want.. Just make sure to put the placeholder settings correctly and give it a decent name (not just "list" ;))
But are you sure you want to do this? Your editors will manually need to create a list of components for each article they want to add on the page. Doesn't sound to be very user (editor) friendly.. Maybe you should consider creating a list component that can get a list of articles as a datasource and show those. Or even select them automatically (but that might be not according to your business case)..
Yes, authors can add multiple instances of the same component into a single placeholder.
Assuming that the code of the component doesn't do any stupid things it's absolutely ok to do this.

Sitecore Custom Multilist

In Sitecore, I built two custom multi-lists, where the second one depends on the first. The only issue is, that after selecting the first one, I have to save the item before the second multi-list filters the items.
My question somebody know how to create a two custom multi-list on Sitecore, where the second one filters automatically after selecting an item in the first (without save event), or which event can I override to do it?
It sounds like what you are looking for is some kind of front end event that you can use in the Sitecore backend to update a list based on another list selection without a save event. I don't think there is really anything out of the box for that..
Really what you should be doing (to do the 'sitecore' thing) would be to have your first selection (be it multi-list or whatever you like) simply point to a datasource item for another template item which is where your user can set the second option(s). I think you would benefit from taking a different approach like this rather than trying to customise Sitecore here.

Qt QTreeWidgetItem - adding children after cleaning old ones

I have a QTreeWidget where upon clicking the expand of an item - when the itemExpanded signal is emitted, I use an algorithm to construct a QList<QTreeWidgetItem*> and add it to the expanded item with QTreeWidgetItem::addChildren.
This works, however if I collapse and expand it again, it adds more children, so I get duplicates. So I have to remove the old children first. For that I use qDeleteAll(item->takeChildren()) and then I add the new ones with addChildren. The thing is, it doesn't work for some reason. It remains empty.
Is there some standart way of performing such an operation?
It sounds like you really want to use a QTreeView with a custom QAbstractItemModel. Yes, that may look a bit scary, if you have never done this before, but the key advantage is that in this approach, the view will ask you for item data, if and when it is needed, without you having to pre-fill it.
Alternatively, do consider the advice given by Michael Boone: Instead of deleting all child items, then re-adding them, why don't you just check whether child items have already been added (optionally updating them, if required)?

Updating model hasMany relationships in UI

I've trying to modify the contents of a hasMany relationship view some UI elements. I have two basic models, container and item. Containers have multiple items and they can have varying numbers of items. For instance:
App.Container.FIXTURES = [
{id:1,name:'Container 1',slots:[0,0]},
{id:2,name:'Container 2',slots:[0,0,0,0]},
{id:3,name:'Container 3',slots:[0,0,0]}
];
I'm using the id 0 as sort of an empty item. It shows that this container can have an item here, but it's currently empty. There are numerous different items that can go into each position.
In my app, I have a custom UI that I've created that allows a user to select a new item to fill each slot. The problem is that for some reason, it's not updating in the container model. No matter what I try, it's just updating in the view, but not on the actual model instance. I thought this would work because the properties would be automatically bound.
I've created a JSBin here displaying the problem. If you click the save button, a json object of the current state of the model will be printed to the console.
What can I do to update the actual model properties? Please keep in mind that the position matters. For instance, if I change the item in the middle position of three, only it should update; not pushed onto the end.
Thanks. Any ideas would be appreciated.
This is a modelling issue.
You have Container, each of which has many Item... except that what's actually happening is you're using the Item class as your options - this is your catalogue, if you will, and you want to put these items into "slots" which you haven't created a model for.
So, depending on what you want to do, you should probably model it like this (using better names - I chose mine for clarity of explanation):
Container hasMany Slots each of which is connected to its Item
So: Container hasMany -> Slots <- belongsTo Item
That is, you have a non-reified "join", which you're sort of calling "slots" and attaching to Container at the moment.
I say depending on what you want to do because I'm not sure if you want to have the simple case I outlined above, which is "here are a bunch of possible items you can choose to put any number of copies of into your containers" or if you want the more complicated to develop case which is "here is a bunch of items which are finite... as you add each item to a container, it disappears from the list of possibilities". To do the latter is much more complicated, but of course it's possible... this is how inventory systems work.
I hope that's answered your question...
To put it another way, you need to build yourself a Slot model, related to each of your other models, and manage the join properly. If you bind the slots properly to each dropdown then Ember will take care of hooking up the data for you.
Let me know if you need further help on how to do this.
I've modified your JSBin to comprehensively show you what I mean. Hope that helps explain it:
http://emberjs.jsbin.com/tenoqimu/5/edit