Remove buttons from UI

Lykourgos4 years ago

Hi, i am trying to remove the add/edit/remove device button from the UI. I want to do this so that users can't alter the devices but can still assign geofences to them.

I have tried to edit the app.css file by adding

#button-1027{
    visibility: hidden !important;
}

But there is no change, i also noticed in the element inspector that the buttons id keeps changing!
Is there another way to remove those buttons ?

Thanks for your time

Anton Tananaev4 years ago

Why not just make the user "device readonly"?

Lykourgos4 years ago

I tried that, but it also hides the cog on the devices that allows you to set geofences and notifications for certain devices. And i want my users to be able to do that.

Lykourgos4 years ago

so i tried editing the javascript by modifying the following lines of ToolbarCotnroller.js

onSelectionChange: function (selection, selected) {
        var disabled = selected.length === 0;
        this.lookupReference('toolbarEditButton').setDisabled(disabled);
        this.lookupReference('toolbarRemoveButton').setDisabled(disabled);
    }

I changed value of setDisabled to true, i also tried setting it as enabled. But i saw no changes
i also tried editing DevicesController.js in a similar way, what am i missing ?

Anton Tananaev4 years ago

Are you running a release version? Have you compiled the code?

Lykourgos4 years ago

I am doing the changes on a live install running v4.8.
If i am understanding corectly, i need to run the minify.sh on the server to compile the js ?