VSTS/TFS Extension - Reflect changes in Grid/Board without refreshing entire page - tfs

I've written an extension for VSTS/TFS which adds a context menu for creating child work items.
The creation of the work items works well, but the change is not reflected in the Grid/Board until I perform a Refresh of the entire page.
Is there a way to refresh just the affected work items (somewhat similar to the refresh performed by the '+' menu item)?

There isn't any way to achieve this. If you open two pages and click "+" button to add two different child workitems from the two pages in the same time, you will find that the affected work item is not real refreshed, it just show the new added one. And you cannot control the behavior on Grid/Board either since the VSTS extensions are hosted in iframe which is cross-origin.

As far as I know this is currently not possible.
I struggled with that question for quite some time before I gave up and just told my users to hit F5 after creating the new work items. The NavigationService is the best alternative i know of.

For your specific case, this doesn't help you. However, if anyone runs across this question looking for ways to refresh a work item, you can use the work item form service method "refresh":
https://www.visualstudio.com/en-us/docs/integrate/extensions/reference/client/api/tfs/workitemtracking/services/workitemformservice#refresh
This service is a means to interact with the currently active work item form. So, this refresh will work on a work item that the user has opened.

Related

How can we make a Work Item Creator automatically a Follower?

I am running Azure DevOps 2019 RC1 with an Inheritance Collection and a new Agile project.
I have a requirement that when a user creates a work item (task/issue), they must automatically be added as a follower of this work item. How can I achieve this? I have look in the rules for the work item under process customisation but it doesn't appear to be possible this way.
We are using the tickets to track issues. Whoever discovers the issue raises the ticket. The basic requirement is that anyone who raises a ticket should be automatically notified of its progress, even though they are not responsible for the development or testing.
Currently the work around is telling the user that when they create an issue they must click the Follow button, but it is easy for them to forget and then lose their updates. It seems like a very simple customisation so maybe I'm missing the obvious.
Thanks
I think you can't auto follow things currently, but you can add notification setting that will send automatically emails when work item is updated. To do this, go to Project Settings > Notifications page and create new subscription. Select "Work/A work item is changed" and put "Members of ... team by role" in Deliver to selection. Set roles to "Created by" and untick the "Skip initiator".
Your problem would be addressed precisely with the feature requested in the official Azure DevOps' feedback platform here:
479189 - Automatically follow work items I interact with
(That page also mentions workarounds, including per-team one answered here, and a per-person alternative. See this comment. The shortcoming of both is that they don't allow to you to unsubscribe for selected tickets.)

How to Manage state between tabs in Flutter App

I am using TabBar in my application where I need to get Input in first tab and show
output based on some calculation on other tab.
I am able to get input in first tab but when I click on second tab, my state is lost. I am not sure if I have to make it a Stateful widget at root level.
I am relatively new in Mobile App. Can someone help me out here?
EDIT:
Now I am able to achieve what I said above, but when I am trying to access the list of items from first tab, it throws null exception in second tab?
I solved the above problem using AutomaticKeepAliveClientMixin as described in the answer below.
I think what you may be after is AutomaticKeepAliveClientMixin. I always add that to my screen widgets within TabBarView. This way when a user enters data into fields in one tab and navigates to other tabs and back the data is still there as you would expect.
Then when the user performs an action like "save" I deal with state management (BLoC etc).
You may want to use architecture for managing and sharing states. There are many approaches to manage state:
InheritedWidget to pass app state down the widget hierarchy
Scoped model library to hold app state and notify Widgets of Updates
Redux library to manage app state and update Widgets
Business Logic Components (BLoC)
Check out this article. Check this GitHub repository with different architecture examples

jquery tablesorter issue with page number

I am developing an ASP.NET MVC 4 application using jquery.tablesorter.js, jquery.tablesorter.pager.js and jquery.tablesorter.widget.js. Now I get an issue with this tablesorter, that is, the page number is saved in the local storage.
I understand it is saved for some reasons. The problem is, for example, I last open the 3rd page of the table and leave the session, then re-open a session, it goes to the 3rd page automatically. If, for some reasons, there is not enough items for any item to go to the 3rd page, it simply shows an empty table and pager, and confuses the user.
Any idea is highly appreciated.
Thanks,
A. Zhang
If you don't want the pager to save the page & size, then set the savePages option to false.
If you do want the page to get saved, but you only want to use session storage, then set the storage_useSessionStorage widget option to true.
Please note: the above options only work with my fork of tablesorter.

How to create rules between parent and child work items

We are trying to impose couple of rules on our project , can you tell us if it is possible to do? and if yes where should I start on this?
One of the example rule is
Deliverable can’t be closed with non-closed children.
This means that even in resolved state a child item would block closing the deliverable.
This should apply to parent child link types only
This would only apply to deliverable parent and any type of valid child
There are two ways you can do this.
Server-side:
You can add a plugin to tfs, that changes workitems. A good example would be TFSAggregator. It won't have the solution for your specific problem, but I can show you how to change work items on the server side. Shouldn't be a big problem to add your case.
The problem with this solution is, that it only changes a workitem after it has been saved. So user will still be able to close the child, but the server will re-open it.
Client-side:
The second solution would be a custom control, which can be implemented in the WITD of your work item. It can be just an invisible control, that adds some validation. You can find some examples here.
The downside of this solution? You have to install the custom control on every single client that uses Visual Studio and you may have to develop a specific version for web-access.

How to have previous and next button in the django admin (change_form)

I want to modify the django admin for a particular model to provide the following behaviour.
A user make a search on the change_list page. The the user click a specific entry and he lands on the change_form for that entry. Nothing different to the usual.
Now, what I want is a mean to navigate the former search results. Basically next and previous buttons on the edit page.
What would be the best approach to implement this feature without modifying the admin site too much?
I will need to memorize the search in the user session, then when an entry is clicked I will need to known which place it has within the results to place my "cursor" accordingly. But I'm a bit in the cloud as the implementation side.
One way is to just put the next and previous button in the template for that particular model.
This can be implemented using simple javascript.
I ended writing a fully custom admin for that.

Resources