Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tsc
  • Loading branch information
aslilac committed Mar 4, 2024
commit a8ed894304a6dd9367ac7f195bc1935d3826ecd2
3 changes: 1 addition & 2 deletions site/src/api/errors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { AxiosError, AxiosResponse } from "axios";
import axios from "axios";
import axios, { type AxiosError, type AxiosResponse } from "axios";

const Language = {
errorsByCode: {
Expand Down
4 changes: 2 additions & 2 deletions site/src/api/queries/appearance.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { QueryClient, type UseQueryOptions } from "react-query";
import type { QueryClient, UseQueryOptions } from "react-query";
import * as API from "api/api";
import { type AppearanceConfig } from "api/typesGenerated";
import type { AppearanceConfig } from "api/typesGenerated";
import { getMetadataAsJSON } from "utils/metadata";

const initialAppearanceData = getMetadataAsJSON<AppearanceConfig>("appearance");
Expand Down
4 changes: 2 additions & 2 deletions site/src/api/queries/buildInfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type UseQueryOptions } from "react-query";
import type { UseQueryOptions } from "react-query";
import * as API from "api/api";
import { type BuildInfoResponse } from "api/typesGenerated";
import type { BuildInfoResponse } from "api/typesGenerated";
import { getMetadataAsJSON } from "utils/metadata";

const initialBuildInfoData = getMetadataAsJSON<BuildInfoResponse>("build-info");
Expand Down
4 changes: 2 additions & 2 deletions site/src/api/queries/experiments.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type UseQueryOptions } from "react-query";
import type { UseQueryOptions } from "react-query";
import * as API from "api/api";
import { type Experiments } from "api/typesGenerated";
import type { Experiments } from "api/typesGenerated";
import { getMetadataAsJSON } from "utils/metadata";

const initialExperimentsData = getMetadataAsJSON<Experiments>("experiments");
Expand Down
14 changes: 5 additions & 9 deletions site/src/api/queries/templates.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import type {
MutationOptions,
type QueryClient,
type QueryOptions,
} from "react-query";
import type { MutationOptions, QueryClient, QueryOptions } from "react-query";
import * as API from "api/api";
import type {
CreateTemplateRequest,
CreateTemplateVersionRequest,
ProvisionerJob,
ProvisionerJobStatus,
UsersRequest,
TemplateRole,
type Template,
type CreateTemplateVersionRequest,
type ProvisionerJobStatus,
type TemplateVersion
Template,
TemplateVersion,
} from "api/typesGenerated";
import { delay } from "utils/delay";
import { getTemplateVersionFiles } from "utils/templateVersion";
Expand Down
14 changes: 7 additions & 7 deletions site/src/api/queries/workspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import type { Dayjs } from "dayjs";
import type {
QueryClient,
UseMutationOptions,
type QueryOptions,
QueryOptions,
} from "react-query";
import * as API from "api/api";
import { putWorkspaceExtension } from "api/api";
import type {
WorkspaceBuild,
CreateWorkspaceRequest,
ProvisionerLogLevel,
type WorkspaceBuildParameter,
type Workspace,
type CreateWorkspaceRequest,
type WorkspacesResponse,
type WorkspacesRequest
Workspace,
WorkspaceBuild,
WorkspaceBuildParameter,
WorkspacesRequest,
WorkspacesResponse,
} from "api/typesGenerated";
import { workspaceBuildsKey } from "./workspaceBuilds";

Expand Down
16 changes: 7 additions & 9 deletions site/src/components/Form/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
import {
createContext,
useContext,
forwardRef} from "react";
import type {
ReactNode,
ComponentProps,
type ComponentProps,
type FC,
type HTMLProps
forwardRef,
type HTMLProps,
type ReactNode,
useContext,
} from "react";
import { AlphaBadge, DeprecatedBadge } from "components/Badges/Badges";
import { Stack } from "components/Stack/Stack";
import {
FormFooter as BaseFormFooter} from "../FormFooter/FormFooter";
import type {
FormFooterProps,
FormFooter as BaseFormFooter,
type FormFooterProps,
type FormFooterStyles,
} from "../FormFooter/FormFooter";

Expand Down
15 changes: 7 additions & 8 deletions site/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@ import MuiPopover, {
import {
cloneElement,
createContext,
type FC,
type HTMLAttributes,
type ReactElement,
type ReactNode,
type RefObject,
useContext,
useEffect,
useId,
useRef,
useState
} from "react";
import type {
HTMLAttributes,
type FC,
type ReactElement,
type ReactNode
useState,
} from "react";

type TriggerMode = "hover" | "click";

type TriggerRef = React.RefObject<HTMLElement>;
type TriggerRef = RefObject<HTMLElement>;

type TriggerElement = ReactElement<{
ref: TriggerRef;
Expand Down
9 changes: 3 additions & 6 deletions site/src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import type { Interpolation, Theme} from "@emotion/react";
import { useTheme } from "@emotion/react";
import { createContext, useContext } from "react";
import type { HTMLAttributes, type FC } from "react";
import type { LinkProps } from "react-router-dom";
import { Link } from "react-router-dom";
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
import { createContext, type FC, type HTMLAttributes, useContext } from "react";
import { Link, type LinkProps } from "react-router-dom";

export const TAB_PADDING_Y = 12;
export const TAB_PADDING_X = 16;
Expand Down
13 changes: 6 additions & 7 deletions site/src/modules/resources/PortForwardButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import MenuItem from "@mui/material/MenuItem";
import Select from "@mui/material/Select";
import Stack from "@mui/material/Stack";
import TextField from "@mui/material/TextField";
import type { FormikContextType} from "formik";
import type { FormikContextType } from "formik";
import { useFormik } from "formik";
import { type FC } from "react";
import { useQuery, useMutation } from "react-query";
Expand All @@ -25,14 +25,13 @@ import {
upsertWorkspacePortShare,
workspacePortShares,
} from "api/queries/workspaceportsharing";
import {
WorkspaceAppSharingLevels} from "api/typesGenerated";
import { WorkspaceAppSharingLevels } from "api/typesGenerated";
import type {
Template,
UpsertWorkspaceAgentPortShareRequest,
type Template,
type WorkspaceAgent,
type WorkspaceAgentListeningPort,
type WorkspaceAgentPortShareLevel
WorkspaceAgent,
WorkspaceAgentListeningPort,
WorkspaceAgentPortShareLevel,
} from "api/typesGenerated";
import {
HelpTooltipLink,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from "react";
import { Helmet } from "react-helmet-async";
import { useQuery } from "react-query";
import { useSearchParams } from "react-router-dom";
import { entitlements } from "api/queries/entitlements";
import {
insightsTemplate,
Expand Down Expand Up @@ -57,7 +58,7 @@ import { getLatencyColor } from "utils/latency";
import { getTemplatePageTitle } from "../utils";
import type { DateRangeValue } from "./DateRange";
import { DateRange as DailyPicker } from "./DateRange";
import type { InsightsInterval} from "./IntervalMenu";
import type { InsightsInterval } from "./IntervalMenu";
import { IntervalMenu } from "./IntervalMenu";
import { lastWeeks } from "./utils";
import { WeekPicker, numberOfWeeksOptions } from "./WeekPicker";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import Link from "@mui/material/Link";
import MenuItem from "@mui/material/MenuItem";
import Switch from "@mui/material/Switch";
import TextField from "@mui/material/TextField";
import type { FormikTouched} from "formik";
import type { FormikTouched } from "formik";
import { useFormik } from "formik";
import { useState, useEffect } from "react";
import type { ChangeEvent, type FC } from "react";
import type { ChangeEvent, FC } from "react";
import type { Template, UpdateTemplateMeta } from "api/typesGenerated";
import {
FormSection,
Expand All @@ -20,17 +20,14 @@ import { Stack } from "components/Stack/Stack";
import { TemplateScheduleAutostart } from "modules/templates/TemplateScheduleAutostart/TemplateScheduleAutostart";
import { docs } from "utils/docs";
import { getFormHelpers } from "utils/formUtils";
import type {
TemplateAutostartRequirementDaysValue} from "utils/schedule";
import {
calculateAutostopRequirementDaysValue,
} from "utils/schedule";
import type { TemplateAutostartRequirementDaysValue } from "utils/schedule";
import { calculateAutostopRequirementDaysValue } from "utils/schedule";
import {
AutostopRequirementDaysHelperText,
AutostopRequirementWeeksHelperText,
convertAutostopRequirementDaysValue,
} from "./AutostopRequirementHelperText";
import type { TemplateScheduleFormValues} from "./formHelpers";
import type { TemplateScheduleFormValues } from "./formHelpers";
import { getValidationSchema } from "./formHelpers";
import { ScheduleDialog } from "./ScheduleDialog";
import {
Expand Down
4 changes: 2 additions & 2 deletions site/src/pages/WorkspacePage/WorkspacePage.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { screen, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import EventSourceMock from "eventsourcemock";
import { rest } from "msw";
import * as api from "api/api";
import type { TemplateVersionParameter, type Workspace } from "api/typesGenerated";
import EventSourceMock from "eventsourcemock";
import type { TemplateVersionParameter, Workspace } from "api/typesGenerated";
import {
MockTemplate,
MockWorkspace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Tooltip from "@mui/material/Tooltip";
import { visuallyHidden } from "@mui/utils";
import dayjs, { type Dayjs } from "dayjs";
import { forwardRef, useRef, useState } from "react";
import type { ReactNode , type FC } from "react";
import type { FC, ReactNode } from "react";
import { useMutation, useQueryClient } from "react-query";
import { Link as RouterLink } from "react-router-dom";
import { getErrorMessage } from "api/errors";
Expand Down