Mashup for Old UI Entity details form: please help to modify source code for New UI

39 views
Skip to first unread message

Aliaksei Parasiatsyeu

unread,
May 14, 2013, 8:52:36 AM5/14/13
to devtarge...@googlegroups.com, vijaya...@pramata.com
Hi!

We need to run the following Mashup for User Story details page:

If User Story is in "In Development" state, then we need certain fields to be updated. For that we are planning to use mashups. If one of the field is left blank, the Mashup should inform the users with alert and remind them to update those fields.

We have Mashup running in Old Look mode, but we need it for New Look as well. Here is the source code:
tau.mashups
.addDependency('libs/jquery/jquery')
.addMashup(function ($, config) {
impact = $("#ctl00_mainArea_userStoryView_fvUserStoryView_fields_lstCustomFields_ctl00_Text").text();
state = $("#ctl00_mainArea_userStoryView_fvUserStoryView_statePanel").text();
if(state == "In Development"){
if(impact == ""){
alert("Please add Impact");
}
}
});

Is there any convention for mashup placeholders for new look? 

Please assist us! Thanks!

Vladimir Petriko

unread,
May 16, 2013, 1:40:12 PM5/16/13
to devtarge...@googlegroups.com, vijaya...@pramata.com
Hi,

Regarding the mashups for "new look" views I would recommend you to look into the following thread: https://groups.google.com/forum/?fromgroups=&hl=en#!topic/devtargetprocess/VBpP_Zlhf6M
 
As for your concrete case a mashup can look as follows:

tau.mashups
    .addDependency('tp/userStory/view')
    .addMashup(function (view) {

        var CONST_STATE = "in progress";

        var onViewRendered = function($element, context) {
            var $state = $element.find('.entity-progress-box .state-select .attr-item .attr-name');
            var impact = $element.find("").text();
            var state = $state.text();
            if (state.toLocaleLowerCase() == CONST_STATE) {
                if (impact == "") {
                    // do your work here
                    console.log("Please add Impact");
                }
            }
        };

        //sign up here on render event for user story view
        view.onRender(onViewRendered);
});

I didn't check it well locally so let us know if you have any other issues / questions.

Vladimir Petriko
-----------------------------------
TargetProcess DevTeam




вторник, 14 мая 2013 г., 15:52:36 UTC+3 пользователь Aliaksei Parasiatsyeu написал:

Vijaya Gowda

unread,
May 17, 2013, 1:14:02 AM5/17/13
to Vladimir Petriko, devtarge...@googlegroups.com
Hi Vladimir,

Thanks, I am able to create the Mashup for the new UI View too. 
Working Mashup for new View

tau.mashups
    .addDependency('tp/userStory/view')
    .addMashup(function (view) {

        var CONST_STATE = "in development";

        var onViewRendered = function($element, context) {
        var $state = $element.find('.entity-progress-box .state-select .attr-item .attr-name');
//Since there are more customfields
        var impact = $element.find(".ui_custom_field_value_container .ui-customfield__value")[0]
        
        var state = $state.text();
        
        var alrt = ""
            if (state.toLocaleLowerCase() == CONST_STATE) {
                if (impact.innerHTML == "None") {
                   alert("Impact cannot be blank.";
                }
            }
        };

       
        view.onRender(onViewRendered);
});
Thanks,
Vijaya

Reply all
Reply to author
Forward
0 new messages