mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Fixed self-service checkbox appearing when iOS or iPadOS app is selected. (#22287)
This commit is contained in:
parent
631dc6075d
commit
31633148ed
3 changed files with 33 additions and 16 deletions
1
changes/21796-fix-vpp-self-service-checkbox
Normal file
1
changes/21796-fix-vpp-self-service-checkbox
Normal file
|
|
@ -0,0 +1 @@
|
|||
- Fixed self-service checkbox appearing when iOS or iPadOS app is selected.
|
||||
|
|
@ -177,6 +177,9 @@ const AppStoreVpp = ({
|
|||
const onSelectApp = (app: IVppApp) => {
|
||||
setIsSubmitDisabled(false);
|
||||
setSelectedApp(app);
|
||||
if (app.platform === "ios" || app.platform === "ipados") {
|
||||
setIsSelfService(false);
|
||||
}
|
||||
};
|
||||
|
||||
const onAddSoftware = async () => {
|
||||
|
|
@ -209,6 +212,27 @@ const AppStoreVpp = ({
|
|||
onExit();
|
||||
};
|
||||
|
||||
const renderSelfServiceContent = (platform: string) => {
|
||||
if (platform !== "ios" && platform !== "ipados") {
|
||||
return (
|
||||
<Checkbox
|
||||
value={isSelfService}
|
||||
onChange={(newVal: boolean) => setIsSelfService(newVal)}
|
||||
className={`${baseClass}__self-service-checkbox`}
|
||||
tooltipContent={
|
||||
<>
|
||||
End users can install from <b>Fleet Desktop</b> {">"}{" "}
|
||||
<b>Self-service</b>.
|
||||
</>
|
||||
}
|
||||
>
|
||||
Self-service
|
||||
</Checkbox>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const renderContent = () => {
|
||||
if (isLoadingVppInfo || isLoadingVppApps) {
|
||||
return <Spinner />;
|
||||
|
|
@ -238,19 +262,9 @@ const AppStoreVpp = ({
|
|||
apps, head to{" "}
|
||||
<CustomLink url="https://business.apple.com" text="ABM" newTab />
|
||||
</div>
|
||||
<Checkbox
|
||||
value={isSelfService}
|
||||
onChange={(newVal: boolean) => setIsSelfService(newVal)}
|
||||
className={`${baseClass}__self-service-checkbox`}
|
||||
tooltipContent={
|
||||
<>
|
||||
End users can install from <b>Fleet Desktop</b> {">"}{" "}
|
||||
<b>Self-service</b>.
|
||||
</>
|
||||
}
|
||||
>
|
||||
Self-service
|
||||
</Checkbox>
|
||||
{renderSelfServiceContent(
|
||||
(selectedApp && selectedApp.platform) || ""
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,13 +35,15 @@ const generateAlreadyAvailableMessage = (msg: string) => {
|
|||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const getErrorMessage = (e: unknown) => {
|
||||
const reason = getErrorReason(e);
|
||||
|
||||
let reason = getErrorReason(e);
|
||||
// software is already available for install
|
||||
if (reason.toLowerCase().includes("already")) {
|
||||
return generateAlreadyAvailableMessage(reason);
|
||||
}
|
||||
return DEFAULT_ERROR_MESSAGE;
|
||||
if (reason && !reason.endsWith(".")) {
|
||||
reason += ".";
|
||||
}
|
||||
return reason || DEFAULT_ERROR_MESSAGE;
|
||||
};
|
||||
|
||||
export const getUniqueAppId = (app: IVppApp) =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue