Hiding Activity and Attachment tabs within JNY Journey Details Tabs widget

aguanci
Tera Expert

Hello,

 

Our goal is to hide the Activity and Attachment tabs on the JNY Journey Details Tabs widget for anyone other than the Employee of the Journey. Currently, anyone that is part of the Journey can see the 3 tabs. We would like to limit the use of the Activity and Attachment tabs due to sensitive data. 

 

Would we have to code for this to be possible or is this something that can be achieved in a no-code scenario? 

 

Here is our Client Controller script for the JNY Journey Details Tabs (jny_journey_details_tabs):

 

api.controller = function($scope, jny_journeyDetailsConfigService, $window) {
    /* widget controller */
    var c = this;
    c.data.editMode = false;
    c.data.hasLECase = false;

    var MOBILE_DEVICE_SCREEN_WIDTH = 767;
    c.data.mobileDevice = c.data.isMobile || ($window.innerWidth < MOBILE_DEVICE_SCREEN_WIDTH);

    c.data.canRead = true;
    c.data.loaded = false;

    c.tabs = [{
        name: "${Journey_overview}",
        label: "${Journey overview}",
        aria: "${Journey overview}",
        widget: c.data.journey_details_widget,
        display: true
    }, {
        name: "${Activity}",
        label: "${Activity}",
        aria: "${Activity}",
        widget: null,
        display: true
    }, {
        name: "${Attachments}",
        label: "${Attachments}",
        aria: "${Attachments}",
        widget: null,
        display: true
    }];

    c.currentTab = c.tabs[0].name;

    c.selectTab = function() {
        $("#button-journey-header-more").click();
    };

    c.clickTab = function(tab) {
        c.currentTab = tab.name;
    };

    $scope.$on('jny_journey_details_header.editingStarted', function() {
        c.data.editMode = true;
    });

    $scope.$on('jny_journey_details_header.editingCompleted', function() {
        c.data.editMode = false;
    });

    $scope.$on('store.journey_info.no_access', function() {
        c.data.canRead = false;
    });

    $scope.$on('store.journey_info', function() {
        var journeyInfo = $rootScope.store.journey_info;
        if (!journeyInfo)
            return;

        if (journeyInfo.journey.journey_data.state === 'cancelled') {
            c.data.canRead = false;
            return;
        }

        if (journeyInfo.hr_case && journeyInfo.hr_case.sys_id) {
            c.data.hasLECase = true;
            c.data.action = "render_widgets";
            c.data.leCaseSysId = journeyInfo.hr_case.sys_id;
            c.data.isMobile = c.data.mobileDevice;
            c.server.update().then(function () {
                c.tabs[1].widget = c.data.activity_widget;
                c.tabs[2].widget = c.data.attachment_widget;
            });
        }
        c.data.loaded = true;
        c.data.editMode = jny_journeyDetailsConfigService.isJourneyInEditMode(journeyInfo, c.data.journeyId);

    });
};
0 REPLIES 0