Skip to content

Commit

Permalink
Lint CI: Show errors only and fix existing lint errors (#6494)
Browse files Browse the repository at this point in the history
* annotate errors only

* fix existing errors
  • Loading branch information
rithviknishad authored Oct 25, 2023
1 parent 3c56058 commit 0ea1a1f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
statuses: write

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"

- name: Install dependencies
run: npm ci
- name: Install dependencies
run: npm ci

- name: Run lint
run: npm run lint
- name: Run lint
run: npm run lint --quiet
3 changes: 2 additions & 1 deletion src/CAREUI/interactive/FiltersSlideover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import useFilters from "../../Common/hooks/useFilters";
import ButtonV2 from "../../Components/Common/components/ButtonV2";
import CareIcon from "../icons/CareIcon";
import SlideOver from "./SlideOver";
import { ReactNode } from "react";

type AdvancedFilter = ReturnType<typeof useFilters>["advancedFilter"];

interface Props {
children: any;
children: ReactNode | ReactNode[];
advancedFilter: AdvancedFilter;
onClear?: () => void;
onApply?: () => void;
Expand Down
13 changes: 4 additions & 9 deletions src/Components/Assets/AssetImportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,19 @@ const AssetImportModal = ({ open, onClose, facility }: Props) => {
const [errors, setErrors] = useState<any>({
location: "",
});
const [locations, setLocations] = useState<any>([]);
const { sample_format_asset_import } = useConfig();
const [locationsLoading, setLocationsLoading] = useState(false);

const closeModal = () => {
setPreview(undefined);
setSelectedFile(undefined);
onClose && onClose();
};
useQuery(routes.listFacilityAssetLocation, {
const { data, loading } = useQuery(routes.listFacilityAssetLocation, {
pathParams: { facility_external_id: `${facility.id}` },
onResponse: ({ res, data }) => {
if (res?.status === 200 && data) {
setLocations(data.results);
}
},
});

const locations = data?.results || [];

useEffect(() => {
const readFile = async () => {
try {
Expand Down Expand Up @@ -209,7 +204,7 @@ const AssetImportModal = ({ open, onClose, facility }: Props) => {
fixedWidth={false}
>
<span className="mt-1 text-gray-700">{facility.name}</span>
{!locationsLoading && locations.length === 0 ? (
{!loading && locations.length === 0 ? (
<>
<div className="flex h-full flex-col items-center justify-center">
<h1 className="m-7 text-2xl font-medium text-gray-700">
Expand Down
3 changes: 1 addition & 2 deletions src/Components/Assets/AssetType/ONVIFCamera.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import useQuery from "../../../Utils/request/useQuery";

import CareIcon from "../../../CAREUI/icons/CareIcon";


interface Props {
assetId: string;
facilityId: string;
Expand Down Expand Up @@ -135,7 +134,7 @@ const ONVIFCamera = ({ assetId, facilityId, asset, onUpdated }: Props) => {
}
setLoadingAddPreset(false);
};

if (isLoading || loading || !facility) return <Loading />;

const fallbackMiddleware =
Expand Down

0 comments on commit 0ea1a1f

Please sign in to comment.