Jump to content
Welcome to our new Citrix community!

Storefront 1912 feel


DECLAN BYRNE

Recommended Posts

Upgraded  Storefront to latest 1912 version as part  of our move to Citrix Virtual Apps & Desktop 1912. Everything went smoothly however the new look and feel was a surprise.

 

Is there anyway to stop the box popping up on storefront when clicking on a published app . It makes no sense for another box to pop up and then having click open button

Untitled.jpg

Link to comment
Share on other sites

This theme change to storefront was first made in 1811. We just recently upgraded to 1909 and noticed the same "issue". It looks just to be a difference in functionality. The old layout had a Details link/button per app, but that is gone in the new interface. If you click the app name or the drop down arrow, this now performs the same function as clicking the detail link in the old interface. Instead of going to a new page like before it opens in a drop down box. If you want to just open the app without having to click open in the drop down section, you can just click on the app icon directly instead. There may be a way to restore launch functionality to the app name, but it would probably require custom javascript/css work to intercept the current functionality and redirect it to launch the app instead.

Link to comment
Share on other sites

I have some code written up that works if run within the Chrome Dev Tools Console, but I am currently unable to get it working in the custom script.js on the Storefront, it always loads too fast I assume to make any changes to the HTML DOM. I'll post it below so that maybe some better at javascript/jquery than me (knows enough to do some common customizations) might be able to figure it out.

function filteredArray(arr, key, value) {
    for(i=0, l=arr.length; i<l; i++) {
        if(arr[i][key] === value) {
            return arr[i];
        }
    }
};

$("a.storeapp-details-container").off("click");
$("a.storeapp-details-container").on("click", function(event) {
    event.stopImmediatePropagation();
    CTXS.ExtensionAPI.launch(filteredArray(CTXS.Store.getAllApps(), "encodedName", $(this).text()));
});

I've tried using all the common Citrix JS ExtensionAPI entry points like beforeDisplayHomeScreen(), afterDisplayHomeScreen(), onViewChange() found in https://www.citrix.com/content/dam/citrix/en_us/citrix-developer/documents/receiver-apis.html. None of them seem to be at the right point to change the click handler for this div class, unless I'm doing something wrong.

 

I have one other idea, but it'll have to wait till tomorrow so I can do more testing. Hope this helps someone get on the right track or maybe Citrix can chime in with a better solution.

Link to comment
Share on other sites

I think I finally got it to work using the above code with a few modifications.

 

function filteredArray(arr, key, value) {
    for(i=0, l=arr.length; i<l; i++) {
        if(arr[i][key] === value) {
            return arr[i];
        }
    }
};

function setClickBypass(){
    var id = setInterval(clickBypass, 1000);

    function clickBypass(){
        if($("a").hasClass("storeapp-details-container")){
            $("a.storeapp-details-container").off("click");
            $("a.storeapp-details-container").on("click", function(event) {
                event.stopImmediatePropagation();
                var apps = CTXS.Store.getAllApps().concat(CTXS.Store.getDesktops());
                CTXS.ExtensionAPI.launch(filteredArray(apps, "encodedName", $(this).children(".storeapp-name").text()));
            });
            clearInterval(id);
        };
    };
};

CTXS.Extensions.onViewChange = function(viewname){
    setClickBypass();
};

So the bypass click code runs in a timer that waits until the "storeapp-details-container" class is present within the HTML DOM. There is one limitation to the code, if you have any apps or desktops that have the same exact name (this is technically possible), it will only launch the first one it finds in the app list. So make sure that each of your published apps or desktops have a unique name.

Link to comment
Share on other sites

Ok, one last update to the code that makes it production worthy. This should fix that limitation I mentioned. Turns out there is a unique id in the html code for each app that corresponds to the App object. This should allow apps or desktops that may share same names to launch the correct app when clicked on using this code.

 

Here's the one line that needs to be updated in the previously provided code:

CTXS.ExtensionAPI.launch(filteredArray(apps, "shortid", parseInt($(this.closest("li")).attr("data-shortid"))));

 If you need any explanations on how the javascript code works, just let me know and I can try to explain it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...