139 lines
4.6 KiB
JavaScript
139 lines
4.6 KiB
JavaScript
import {
|
|
selectAdminPermissions
|
|
} from "./chunk-6HMBNYS4.js";
|
|
import {
|
|
useLicenseLimits
|
|
} from "./chunk-G2UWKDMB.js";
|
|
import "./chunk-T3B5F2LV.js";
|
|
import "./chunk-YXDCVYVT.js";
|
|
import {
|
|
useRBAC
|
|
} from "./chunk-CMLQV3Z2.js";
|
|
import "./chunk-PQINNV4N.js";
|
|
import "./chunk-VYSYYPOB.js";
|
|
import "./chunk-W2TBR6J3.js";
|
|
import "./chunk-QEGMJR7H.js";
|
|
import "./chunk-LCL5TIBZ.js";
|
|
import {
|
|
useSelector
|
|
} from "./chunk-WOQNBAGN.js";
|
|
import "./chunk-76QM3EFM.js";
|
|
import "./chunk-CE4VABH2.js";
|
|
import "./chunk-5VODLFKF.js";
|
|
import {
|
|
Flex,
|
|
Grid,
|
|
Link,
|
|
TooltipImpl,
|
|
Typography,
|
|
useIntl
|
|
} from "./chunk-7XB6XSWQ.js";
|
|
import "./chunk-TUXTO2Z5.js";
|
|
import "./chunk-FOD4ENRR.js";
|
|
import {
|
|
ForwardRef$3,
|
|
ForwardRef$3F
|
|
} from "./chunk-WRD5KPDH.js";
|
|
import {
|
|
require_jsx_runtime
|
|
} from "./chunk-NIAJZ5MX.js";
|
|
import "./chunk-ACIMPXWY.js";
|
|
import "./chunk-MADUDGYZ.js";
|
|
import {
|
|
__toESM
|
|
} from "./chunk-PLDDJCW6.js";
|
|
|
|
// node_modules/@strapi/admin/dist/admin/ee/admin/src/pages/SettingsPage/pages/ApplicationInfoPage/components/AdminSeatInfo.mjs
|
|
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
var BILLING_SELF_HOSTED_URL = "https://strapi.io/billing/request-seats";
|
|
var MANAGE_SEATS_URL = "https://strapi.io/billing/manage-seats";
|
|
var AdminSeatInfoEE = () => {
|
|
const { formatMessage } = useIntl();
|
|
const { settings } = useSelector(selectAdminPermissions);
|
|
const { isLoading: isRBACLoading, allowedActions: { canRead, canCreate, canUpdate, canDelete } } = useRBAC((settings == null ? void 0 : settings.users) ?? {});
|
|
const { license, isError, isLoading: isLicenseLoading } = useLicenseLimits({
|
|
// TODO: this creates a waterfall which we should avoid to render earlier, but for that
|
|
// we will have to move away from data-fetching hooks to query functions.
|
|
// Short-term we could at least implement a loader, for the user to have visual feedback
|
|
// in case the requests take a while
|
|
enabled: !isRBACLoading && canRead && canCreate && canUpdate && canDelete
|
|
});
|
|
const isLoading = isRBACLoading || isLicenseLoading;
|
|
if (isError || isLoading || !license) {
|
|
return null;
|
|
}
|
|
const { licenseLimitStatus, enforcementUserCount, permittedSeats, type } = license;
|
|
if (!permittedSeats) {
|
|
return null;
|
|
}
|
|
return (0, import_jsx_runtime.jsxs)(Grid.Item, {
|
|
col: 6,
|
|
s: 12,
|
|
direction: "column",
|
|
alignItems: "stretch",
|
|
children: [
|
|
(0, import_jsx_runtime.jsx)(Typography, {
|
|
variant: "sigma",
|
|
textColor: "neutral600",
|
|
children: formatMessage({
|
|
id: "Settings.application.admin-seats",
|
|
defaultMessage: "Admin seats"
|
|
})
|
|
}),
|
|
(0, import_jsx_runtime.jsxs)(Flex, {
|
|
gap: 2,
|
|
children: [
|
|
(0, import_jsx_runtime.jsx)(Flex, {
|
|
children: (0, import_jsx_runtime.jsx)(Typography, {
|
|
tag: "p",
|
|
children: formatMessage({
|
|
id: "Settings.application.ee.admin-seats.count",
|
|
defaultMessage: "<text>{enforcementUserCount}</text>/{permittedSeats}"
|
|
}, {
|
|
permittedSeats,
|
|
enforcementUserCount,
|
|
text: (chunks) => (0, import_jsx_runtime.jsx)(Typography, {
|
|
fontWeight: "semiBold",
|
|
textColor: enforcementUserCount > permittedSeats ? "danger500" : void 0,
|
|
children: chunks
|
|
})
|
|
})
|
|
})
|
|
}),
|
|
licenseLimitStatus === "OVER_LIMIT" && (0, import_jsx_runtime.jsx)(TooltipImpl, {
|
|
label: formatMessage({
|
|
id: "Settings.application.ee.admin-seats.at-limit-tooltip",
|
|
defaultMessage: "At limit: add seats to invite more users"
|
|
}),
|
|
children: (0, import_jsx_runtime.jsx)(ForwardRef$3, {
|
|
width: "1.4rem",
|
|
height: "1.4rem",
|
|
fill: "danger500"
|
|
})
|
|
})
|
|
]
|
|
}),
|
|
type === "gold" ? (0, import_jsx_runtime.jsx)(Link, {
|
|
href: BILLING_SELF_HOSTED_URL,
|
|
endIcon: (0, import_jsx_runtime.jsx)(ForwardRef$3F, {}),
|
|
children: formatMessage({
|
|
id: "Settings.application.ee.admin-seats.support",
|
|
defaultMessage: "Contact sales"
|
|
})
|
|
}) : (0, import_jsx_runtime.jsx)(Link, {
|
|
href: MANAGE_SEATS_URL,
|
|
isExternal: true,
|
|
endIcon: (0, import_jsx_runtime.jsx)(ForwardRef$3F, {}),
|
|
children: formatMessage({
|
|
id: "Settings.application.ee.admin-seats.add-seats",
|
|
defaultMessage: "Manage seats"
|
|
})
|
|
})
|
|
]
|
|
});
|
|
};
|
|
export {
|
|
AdminSeatInfoEE
|
|
};
|
|
//# sourceMappingURL=AdminSeatInfo-6OY4OYIE.js.map
|