Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint CI: Show errors only and fix existing lint errors #6494

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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