summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fearn <jfearn@redhat.com>2021-04-07 13:48:39 +1000
committerJeff Fearn <jfearn@redhat.com>2021-04-07 13:48:39 +1000
commit036e13365645fc3819b1f9e162c1442603a5d31c (patch)
treef95b786b2f22b5ba7813dd5b3469a86798dd6008
parentBug 1943290 - Cannot distinguish visited and unvisited links (diff)
downloadbugzilla-036e13365645fc3819b1f9e162c1442603a5d31c.tar.gz
bugzilla-036e13365645fc3819b1f9e162c1442603a5d31c.tar.bz2
bugzilla-036e13365645fc3819b1f9e162c1442603a5d31c.zip
Bug 1903845 - Add link to component admin page
Change-Id: Iefb2a6462ce3d375f8513fb640941b23e3f172c4
-rw-r--r--extensions/Workflows/lib/WebService/ManageComponents.pm7
-rw-r--r--extensions/Workflows/template/en/default/pages/workflows/manage_components.html.tmpl12
2 files changed, 18 insertions, 1 deletions
diff --git a/extensions/Workflows/lib/WebService/ManageComponents.pm b/extensions/Workflows/lib/WebService/ManageComponents.pm
index 33fe63332..51cf54291 100644
--- a/extensions/Workflows/lib/WebService/ManageComponents.pm
+++ b/extensions/Workflows/lib/WebService/ManageComponents.pm
@@ -161,6 +161,13 @@ sub _comp_2_hash {
: '';
$out{'can_manage'} = $user->can_manage_comp($component) if ($user);
+ $out{'can_edit'} = $user->can_edit_product($component->can('product')
+ ? $component->product->id
+ : $component->component->product->id) if ($user);
+
+ unless($component->can('product')) {
+ $out{'component'} = $component->component->name;
+ }
# sub components don't have templates
$out{'template'}
diff --git a/extensions/Workflows/template/en/default/pages/workflows/manage_components.html.tmpl b/extensions/Workflows/template/en/default/pages/workflows/manage_components.html.tmpl
index 70f656511..ec6a93abb 100644
--- a/extensions/Workflows/template/en/default/pages/workflows/manage_components.html.tmpl
+++ b/extensions/Workflows/template/en/default/pages/workflows/manage_components.html.tmpl
@@ -712,7 +712,7 @@ $(document).ready(function () {
if(in_bulk_edit != 0) {
classes = classes + " bz_default_hidden";
}
- val = val + '<a title="Save" class="' + classes + '" onclick="update_row(this)"><i class="fas fa-save"></i></a> ';
+ val = val + '<a title="Save" class="' + classes + '" onclick="update_row(this)"><i class="fas fa-save"></i></a>';
}
if (row.default_pool) {
val = val + '<a href="page.cgi?id=agiletools/team/show.html&amp;team_id=' + row.default_pool.team.id + '" title="' + row.default_pool.team.name + '"><i class="fas fa-swimmer"></i></a>';
@@ -723,6 +723,16 @@ $(document).ready(function () {
val = val + '<a href="#editors" title="Show editors" onclick="get_editors(this)"><i class="fa fa-address-book"></i></a>';
+ if (row.can_edit) {
+ if(row.type == "sub_component") {
+ val = val + '<a href="editcomponents.cgi?action=edit&product=' + row.product +'&component=' + row.component + '" title="Edit component"><i class="fas fa-edit"></i></a>';
+
+ val = val + '<a href="page.cgi?id=subcomponents/edit.html&product=' + row.product +'&component=' + row.component + '&sub_component_id=' + row.id + '" title="Edit sub-component"><i class="far fa-edit"></i></a>';
+ } else {
+ val = val + '<a href="editcomponents.cgi?action=edit&product=' + row.product +'&component=' + row.name + '" title="Edit component"><i class="fas fa-edit"></i></a>';
+ }
+ }
+
return val;
},
}