cases on service portal needs to open in new tab

tejaswini666
Tera Contributor

Hi,

There is widget to get the list menu of the case table on the service portal and share the code as below,Now the issue  is whenever user opens SOC  "All open cases", they are getting cases list, but when they click cntl+case,its not opening in new tab.so i have tried by using "if (window.event.ctrlKey) {
window.open(url); "in the end of client controller script , it works like only the list menu "All open cases" or "Action needed " opens in new tab whenever i click cntl+Open.But the requirement is whenever user click on "cntrl+case nuber",it needs to be opened in new tab

 

tejaswini666_0-1690533895508.png

 

Client controller script:

function($scope, $location, $timeout, $window, $document, $rootScope, spUtil, spAriaUtil) {
    var c = this;
    spUtil.getPreference('glide.ui.accessibility', function(value) {
        if (value == "true")
            $scope.tabindex = 0;
        else
            $scope.tabindex = -1;
    });
 
    $scope.caseFilterSelected = function(category) {
        var url = "csm?id=csm_my_lists&table=sn_customerservice_soc_case" + "&view=" + category.view + "&target_page_id" + category.targetPageId + "&filter=" + category.query + "&sel=" + category.selectedFilter;
        $location.url(url);
// $window.open(url,"_blank");
if (window.event.ctrlKey) {
   window.open(url);
}
    };
 
}
 
HTML:
<div class="panel panel-{{::options.color}} category-widget no-border">
<div class="panel-heading">
<h2 class="h4 panel-title">
{{::options.title}}</h2>
</div>
<ul class="list-group category-list" role="list" aria-label="${{{::options.title}}}">
<li role="listitem"
class="list-group-item text-overflow-ellipsis"
ng-include="'category-template.html'"
ng-repeat="category in data.list">
</li>
</ul>
</div>
<script type="text/ng-template" id="category-template.html">
<div ng-click="caseFilterSelected(category)"
sn-focus="category.selectedFilter == data.selectedFilter"
ng-class="{true: 'text-active', false: ''}[category.selectedFilter == data.selectedFilter]"
tabindex="0" class="group-item group-item-primary">
<span class="block text-overflow-ellipsis category"
id="{{::category.myListFilter}}"
uib-tooltip="{{::category.myListFilter}}"
tooltip-placement="top"
tooltip-enable="!isTouchDevice()"
tooltip-append-to-body="true">
{{::category.myListFilter}}
<span class="sr-only">${items}</span>
</span>
</div>
</script>
 
Server script:
(function() {
data.list = [];
data.selectedFilter = $sp.getParameter('sel');
data.list = new sn_customerservice.SpotITCSMPortalService().getMyListsMenu("sn_customerservice_soc_case");
})();
6 REPLIES 6

J McMillan
Tera Expert

Also interested in a solution for this. Seems like it would be nice to have it in the standard right click menu shown here: 

 Screenshot 2023-08-18 140547.png

Debendu
Tera Contributor

Hi @tejaswini666 ,

For this functionality(cntl+case opening in new tab) you need to update the HTML part, instead of using ng-click for navigation use anchor tag (<a>) and provide the dynamic URL using ng-href.

Hope this will solve the issue.