mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
allow to install VPP apps without scripts (#22365)
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
This commit is contained in:
parent
839106c572
commit
adf3ad6214
2 changed files with 20 additions and 2 deletions
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue