Skip to content

Commit 0b4e0b3

Browse files
Jessica WangJessica Wang
authored andcommitted
BUG-ID: CS-17733 - make detailView widget to pass jsonObj to tagger widget, so dataProvider in tagger widget is able to pass projectid to listTags API.
Reviewed-by: Brian
1 parent f7b1d3d commit 0b4e0b3

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

ui/scripts/sharedFunctions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,10 @@ cloudStack.api = {
821821
data.projectid=args.context.projects[0].id;
822822
}
823823

824+
if(args.jsonObj != null && args.jsonObj.projectid != null && data.projectid == null) {
825+
data.projectid = args.jsonObj.projectid;
826+
}
827+
824828
$.ajax({
825829
url: createURL('listTags'),
826830
data: data,

ui/scripts/ui/widgets/detailView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,8 @@
11781178
!$detailView.data('view-args').compact) {
11791179
$('<div>').tagger(
11801180
$.extend(true, {}, tabs.tags, {
1181-
context: $detailView.data('view-args').context
1181+
context: $detailView.data('view-args').context,
1182+
jsonObj: $detailView.data('view-args').jsonObj
11821183
})
11831184
).appendTo($detailView.find('.main-groups'));
11841185
}

ui/scripts/ui/widgets/tagger.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
$.widget('cloudStack.tagger', {
116116
_init: function(args) {
117117
var context = this.options.context;
118+
var jsonObj = this.options.jsonObj;
118119
var dataProvider = this.options.dataProvider;
119120
var actions = this.options.actions;
120121
var $container = this.element.addClass('tagger');
@@ -209,6 +210,7 @@
209210
$loading.appendTo($container);
210211
dataProvider({
211212
context: context,
213+
jsonObj: jsonObj,
212214
response: {
213215
success: function(args) {
214216
var data = args.data;

0 commit comments

Comments
 (0)