2023-03-14 22:23:20 +00:00
|
|
|
import React, { useContext } from "react";
|
2023-03-31 17:40:14 +00:00
|
|
|
|
2023-03-14 22:23:20 +00:00
|
|
|
import { AppContext } from "context/app";
|
2023-03-31 17:40:14 +00:00
|
|
|
|
|
|
|
|
import OperatingSystems from "pages/DashboardPage/cards/OperatingSystems";
|
|
|
|
|
import useInfoCard from "pages/DashboardPage/components/InfoCard";
|
|
|
|
|
|
2023-03-14 22:23:20 +00:00
|
|
|
import PremiumFeatureMessage from "components/PremiumFeatureMessage";
|
2023-03-31 17:40:14 +00:00
|
|
|
|
2023-01-27 22:25:53 +00:00
|
|
|
import OsMinVersionForm from "./components/OsMinVersionForm";
|
|
|
|
|
import NudgePreview from "./components/NudgePreview";
|
|
|
|
|
|
|
|
|
|
const baseClass = "mac-os-updates";
|
|
|
|
|
|
2023-04-09 16:48:35 +00:00
|
|
|
interface IMacOSUpdates {
|
|
|
|
|
teamIdForApi: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const MacOSUpdates = ({ teamIdForApi }: IMacOSUpdates) => {
|
|
|
|
|
const { isPremiumTier } = useContext(AppContext);
|
2023-01-27 22:25:53 +00:00
|
|
|
|
|
|
|
|
const OperatingSystemCard = useInfoCard({
|
|
|
|
|
title: "macOS versions",
|
|
|
|
|
children: (
|
|
|
|
|
<OperatingSystems
|
2023-04-09 16:48:35 +00:00
|
|
|
currentTeamId={teamIdForApi}
|
2023-01-27 22:25:53 +00:00
|
|
|
selectedPlatform="darwin"
|
|
|
|
|
showTitle
|
|
|
|
|
showDescription={false}
|
|
|
|
|
includeNameColumn={false}
|
|
|
|
|
setShowTitle={() => {
|
|
|
|
|
return null;
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
),
|
|
|
|
|
});
|
|
|
|
|
|
2023-03-31 17:40:14 +00:00
|
|
|
return isPremiumTier ? (
|
2023-01-27 22:25:53 +00:00
|
|
|
<div className={baseClass}>
|
2023-05-19 16:57:25 +00:00
|
|
|
<p className={`${baseClass}__description`}>
|
|
|
|
|
Remotely encourage the installation of macOS updates on hosts assigned
|
|
|
|
|
to this team.
|
|
|
|
|
</p>
|
|
|
|
|
<div className={`${baseClass}__content`}>
|
|
|
|
|
<div className={`${baseClass}__form-table-content`}>
|
|
|
|
|
<div className={`${baseClass}__os-versions-card`}>
|
|
|
|
|
{OperatingSystemCard}
|
2023-01-27 22:25:53 +00:00
|
|
|
</div>
|
2023-05-19 16:57:25 +00:00
|
|
|
<div className={`${baseClass}__os-version-form`}>
|
|
|
|
|
<OsMinVersionForm currentTeamId={teamIdForApi} key={teamIdForApi} />
|
2023-01-27 22:25:53 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-05-19 16:57:25 +00:00
|
|
|
<div className={`${baseClass}__nudge-preview`}>
|
|
|
|
|
<NudgePreview />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-01-27 22:25:53 +00:00
|
|
|
</div>
|
2023-03-14 22:23:20 +00:00
|
|
|
) : (
|
2023-04-13 15:48:28 +00:00
|
|
|
<PremiumFeatureMessage
|
|
|
|
|
className={`${baseClass}__premium-feature-message`}
|
|
|
|
|
/>
|
2023-01-27 22:25:53 +00:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default MacOSUpdates;
|