Skip to content

Commit

Permalink
allow to install VPP apps without scripts (#22365)
Browse files Browse the repository at this point in the history
for #22352

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
  • Loading branch information
roperzh authored Sep 25, 2024
1 parent 839106c commit adf3ad6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,21 @@ describe("generateActions", () => {
const actions = generateActions(props);
expect(actions.find((a) => a.value === "uninstall")).toBeUndefined();
});

it("allows to install VPP apps even if scripts are disabled", () => {
const props: generateActionsProps = {
...defaultProps,
hostScriptsEnabled: false,
app_store_app: {
app_store_id: "1",
self_service: false,
icon_url: "",
version: "",
last_install: { command_uuid: "", installed_at: "" },
},
};
const actions = generateActions(props);
expect(actions.find((a) => a.value === "install")?.disabled).toBe(false);
expect(actions.find((a) => a.value === "uninstall")).toBeUndefined();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ export const generateActions = ({
actions.splice(indexUninstallAction, 1);
actions.splice(indexInstallAction, 1);
} else {
// if host's scripts are disabled, disable install/uninstall with tooltip
if (!hostScriptsEnabled) {
// if host's scripts are disabled, and this isn't a VPP app, disable
// install/uninstall with tooltip
if (!hostScriptsEnabled && !app_store_app) {
actions[indexInstallAction].disabled = true;
actions[indexUninstallAction].disabled = true;

Expand Down

0 comments on commit adf3ad6

Please sign in to comment.