@@ -21,9 +21,9 @@
|
||||
import { Avatar, Field, Option, Select } from "@probo/ui";
|
||||
import { type ComponentProps, Suspense } from "react";
|
||||
import { type Control, Controller, type FieldPath, type FieldValues } from "react-hook-form";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { usePeople } from "#/hooks/graph/PeopleGraph";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
type Props<
|
||||
TFieldValues extends FieldValues = FieldValues,
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
// SOFTWARE.
|
||||
|
||||
import { usePageTitle } from "@probo/hooks";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button } from "@probo/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useSearchParams } from "react-router";
|
||||
|
||||
type AuthErrorContent = {
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
|
||||
import { LaptopIcon } from "@phosphor-icons/react";
|
||||
import { usePageTitle } from "@probo/hooks";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button, Card } from "@probo/ui";
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
|
||||
import { Link } from "react-router";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button, IconArrowLink } from "@probo/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
type Props = {
|
||||
url?: string | null;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
import type { ProviderInfo } from "../AddAccessReviewSourceDialog";
|
||||
|
||||
// DATADOG_SITES labels are technical identifiers (region code + hostname),
|
||||
// intentionally not wrapped in __(). The dialog's prose strings are.
|
||||
// intentionally not translated. The dialog's prose strings are.
|
||||
export const DATADOG_SITES: { value: string; label: string }[] = [
|
||||
{ value: "US1", label: "US1 (app.datadoghq.com)" },
|
||||
{ value: "US3", label: "US3 (us3.datadoghq.com)" },
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
// SOFTWARE.
|
||||
|
||||
import { usePageTitle } from "@probo/hooks";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
Breadcrumb,
|
||||
Button,
|
||||
@@ -27,6 +26,7 @@ import {
|
||||
TabLink,
|
||||
Tabs,
|
||||
} from "@probo/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
type PreloadedQuery,
|
||||
usePreloadedQuery,
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
// SOFTWARE.
|
||||
|
||||
import { usePageTitle } from "@probo/hooks";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button, IconPlusLarge, PageHeader, Tbody, Th, Thead, Tr } from "@probo/ui";
|
||||
import type { ComponentProps } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
type PreloadedQuery,
|
||||
usePaginationFragment,
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import { formatDate } from "@probo/helpers";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { dateFormat } from "@probo/i18n";
|
||||
import { Badge, Card } from "@probo/ui";
|
||||
import type { ReactNode } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
@@ -48,7 +48,7 @@ const deviceFragment = graphql`
|
||||
export function DeviceDetailsCard(props: {
|
||||
deviceFragmentRef: DeviceDetailsCard_deviceFragment$key;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const { i18n, t } = useTranslation();
|
||||
const pendingLabel = t("devices.values.pending");
|
||||
const device = useFragment(deviceFragment, props.deviceFragmentRef);
|
||||
|
||||
@@ -88,12 +88,18 @@ export function DeviceDetailsCard(props: {
|
||||
<DetailField
|
||||
label={t("devices.fields.enrolledAt")}
|
||||
value={
|
||||
device.enrolledAt ? formatDate(device.enrolledAt) : pendingLabel
|
||||
device.enrolledAt
|
||||
? dateFormat(i18n.language, device.enrolledAt)
|
||||
: pendingLabel
|
||||
}
|
||||
/>
|
||||
<DetailField
|
||||
label={t("devices.fields.lastSeen")}
|
||||
value={device.lastSeenAt ? formatDate(device.lastSeenAt) : t("devices.values.never")}
|
||||
value={
|
||||
device.lastSeenAt
|
||||
? dateFormat(i18n.language, device.lastSeenAt)
|
||||
: t("devices.values.never")
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import { formatDate } from "@probo/helpers";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { dateFormat } from "@probo/i18n";
|
||||
import {
|
||||
ActionDropdown,
|
||||
Badge,
|
||||
@@ -30,6 +29,7 @@ import {
|
||||
Tr,
|
||||
useDialogRef,
|
||||
} from "@probo/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
@@ -67,7 +67,7 @@ interface DeviceRowProps {
|
||||
}
|
||||
|
||||
export function DeviceRow({ canAssignDevice, canRevoke, fKey }: DeviceRowProps) {
|
||||
const { t } = useTranslation();
|
||||
const { i18n, t } = useTranslation();
|
||||
const organizationId = useOrganizationId();
|
||||
const reassignDialogRef = useDialogRef();
|
||||
const pendingLabel = t("devices.values.pending");
|
||||
@@ -95,7 +95,11 @@ export function DeviceRow({ canAssignDevice, canRevoke, fKey }: DeviceRowProps)
|
||||
</Td>
|
||||
<Td>{displayValue(device.platform, pendingLabel)}</Td>
|
||||
<Td>{displayValue(device.osVersion, pendingLabel)}</Td>
|
||||
<Td>{device.lastSeenAt ? formatDate(device.lastSeenAt) : t("devices.values.never")}</Td>
|
||||
<Td>
|
||||
{device.lastSeenAt
|
||||
? dateFormat(i18n.language, device.lastSeenAt)
|
||||
: t("devices.values.never")}
|
||||
</Td>
|
||||
<Td>
|
||||
<span className="text-txt-success">{summary.pass}</span>
|
||||
{" / "}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { IconCircleInfo } from "@probo/ui";
|
||||
import * as Popover from "@radix-ui/react-popover";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export function PostureColumnHeader() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
// SOFTWARE.
|
||||
|
||||
import { formatError } from "@probo/helpers";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useConfirm, useToast } from "@probo/ui";
|
||||
import { useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
// SOFTWARE.
|
||||
|
||||
import { formatError } from "@probo/helpers";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
Breadcrumb,
|
||||
Button,
|
||||
@@ -30,6 +29,7 @@ import {
|
||||
useToast,
|
||||
} from "@probo/ui";
|
||||
import { type ReactNode, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
import { z } from "zod";
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
// SOFTWARE.
|
||||
|
||||
import { formatError } from "@probo/helpers";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
Breadcrumb,
|
||||
Button,
|
||||
@@ -30,6 +29,7 @@ import {
|
||||
useToast,
|
||||
} from "@probo/ui";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useFragment, useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
import { z } from "zod";
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Table, Tbody, Td, Th, Thead, Tr } from "@probo/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
|
||||
@@ -18,12 +18,15 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { dateTimeFormat } from "@probo/i18n/date";
|
||||
import { Badge, Td, Tr } from "@probo/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { DevicePostureListItem_postureFragment$key } from "#/__generated__/core/DevicePostureListItem_postureFragment.graphql";
|
||||
import type {
|
||||
DevicePostureListItem_postureFragment$key,
|
||||
} from "#/__generated__/core/DevicePostureListItem_postureFragment.graphql";
|
||||
|
||||
import { statusVariant } from "../../_lib/deviceDisplay";
|
||||
import { getPostureCheckLabel } from "../_lib/getPostureCheckLabel";
|
||||
@@ -54,15 +57,7 @@ export function DevicePostureListItem({ postureKey }: DevicePostureListItemProps
|
||||
</Badge>
|
||||
</Td>
|
||||
<Td className="text-end whitespace-nowrap">
|
||||
{new Intl.DateTimeFormat(i18n.language, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
hour12: false,
|
||||
}).format(posture.observedAt)}
|
||||
{dateTimeFormat(i18n.language, posture.observedAt)}
|
||||
</Td>
|
||||
</Tr>
|
||||
);
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
// SOFTWARE.
|
||||
|
||||
import { usePageTitle } from "@probo/hooks";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button, Card, IconPlusLarge, Tbody, Th, Thead, Tr } from "@probo/ui";
|
||||
import { useTransition } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
graphql,
|
||||
type PreloadedQuery,
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
// SOFTWARE.
|
||||
|
||||
import { formatError } from "@probo/helpers";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
Button,
|
||||
Dialog,
|
||||
@@ -28,6 +27,7 @@ import {
|
||||
useToast,
|
||||
} from "@probo/ui";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import { formatDate } from "@probo/helpers";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { dateFormat } from "@probo/i18n";
|
||||
import { Badge, Td, Tr } from "@probo/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
@@ -54,7 +54,7 @@ function stateVariant(state: string): "success" | "warning" | "info" {
|
||||
}
|
||||
|
||||
export function EmployeeDeviceListItem({ deviceKey }: EmployeeDeviceListItemProps) {
|
||||
const { t } = useTranslation();
|
||||
const { i18n, t } = useTranslation();
|
||||
const pendingLabel = t("devices.values.pending");
|
||||
|
||||
const device = useFragment(employeeDeviceListItemFragment, deviceKey);
|
||||
@@ -67,7 +67,11 @@ export function EmployeeDeviceListItem({ deviceKey }: EmployeeDeviceListItemProp
|
||||
</Td>
|
||||
<Td>{displayValue(device.platform, pendingLabel)}</Td>
|
||||
<Td>{displayValue(device.osVersion, pendingLabel)}</Td>
|
||||
<Td>{device.lastSeenAt ? formatDate(device.lastSeenAt) : t("devices.values.never")}</Td>
|
||||
<Td>
|
||||
{device.lastSeenAt
|
||||
? dateFormat(i18n.language, device.lastSeenAt)
|
||||
: t("devices.values.never")}
|
||||
</Td>
|
||||
</Tr>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button, Card, useToast } from "@probo/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const RELEASE_BASE_URL
|
||||
= "https://github.com/getprobo/probo/releases/latest/download";
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
// SOFTWARE.
|
||||
|
||||
import { formatError } from "@probo/helpers";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
Button,
|
||||
IconArrowsClockwise,
|
||||
@@ -27,6 +26,7 @@ import {
|
||||
useToast,
|
||||
} from "@probo/ui";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { fetchQuery, useMutation, useRelayEnvironment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
|
||||
@@ -108,7 +108,6 @@ export {
|
||||
} from "./fileAccept";
|
||||
export {
|
||||
formatDatetime,
|
||||
formatDate,
|
||||
toDateInput,
|
||||
todayAsDateInput,
|
||||
parseDate,
|
||||
|
||||
Reference in New Issue
Block a user