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

Perform type checks during build and fix all errors #7469

Merged
merged 22 commits into from
Apr 2, 2024
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
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
],
"tailwindcss/no-custom-classname": "off",
"tailwindcss/migration-from-tailwind-2": "error",
"tailwindcss/classnames-order": "error",
"tailwindcss/classnames-order": "off",
"tailwindcss/enforces-shorthand": "off",
"tailwindcss/no-contradicting-classname": "error"
},
Expand Down
9 changes: 7 additions & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
"semi": true,
"jsxSingleQuote": false,
"arrowParens": "always",
"tailwindFunctions": ["classNames"]
}
"tailwindFunctions": [
"classNames"
],
"plugins": [
"prettier-plugin-tailwindcss"
]
}
209 changes: 209 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"@tailwindcss/typography": "^0.5.9",
"@types/cypress": "^1.1.3",
"@types/echarts": "^4.9.18",
"@types/google.maps": "^3.55.5",
"@types/lodash-es": "^4.17.9",
"@types/qrcode.react": "^1.0.2",
"@types/react": "18.2.14",
Expand Down Expand Up @@ -159,6 +160,7 @@
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6",
"vite": "^5.1.3",
"vite-plugin-checker": "^0.6.4",
"vite-plugin-pwa": "^0.18.2"
},
"browserslist": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export const DISCHARGE_REASONS = [
{ id: 2, text: "Referred" },
{ id: 3, text: "Expired" },
{ id: 4, text: "LAMA" },
];
] as const;

export const CONSCIOUSNESS_LEVEL = [
{ id: "UNRESPONSIVE", text: "Unresponsive" },
Expand Down
2 changes: 1 addition & 1 deletion src/Common/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const useAbortableEffect = (
};

export const parseOptionId: (
options: OptionsType[],
options: readonly OptionsType[],
id: string | string[]
) => string = (options, id) => {
const textArray = options
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Assets/AssetConfigure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const AssetConfigure = ({ assetId, facilityId }: AssetConfigureProps) => {
<Page
title={`Configure HL7 Monitor: ${asset.name}`}
crumbsReplacements={{
[facilityId]: { name: asset.location_object.facility.name },
[facilityId]: { name: asset.location_object.facility?.name },
assets: { uri: `/assets?facility=${facilityId}` },
[assetId]: { name: asset?.name },
}}
Expand All @@ -42,7 +42,7 @@ const AssetConfigure = ({ assetId, facilityId }: AssetConfigureProps) => {
<Page
title={`Configure Ventilator: ${asset?.name}`}
crumbsReplacements={{
[facilityId]: { name: asset?.location_object.facility.name },
[facilityId]: { name: asset?.location_object.facility?.name },
assets: { uri: `/assets?facility=${facilityId}` },
[assetId]: { name: asset?.name },
}}
Expand All @@ -57,7 +57,7 @@ const AssetConfigure = ({ assetId, facilityId }: AssetConfigureProps) => {
<Page
title={`Configure ONVIF Camera: ${asset?.name}`}
crumbsReplacements={{
[facilityId]: { name: asset?.location_object.facility.name },
[facilityId]: { name: asset?.location_object.facility?.name },
assets: { uri: `/assets?facility=${facilityId}` },
[assetId]: { name: asset?.name },
}}
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Assets/AssetManage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ const AssetManage = (props: AssetManageProps) => {
<Page
title="Asset Details"
crumbsReplacements={{
[facilityId]: { name: asset?.location_object.facility.name },
[facilityId]: { name: asset?.location_object.facility?.name },
assets: { uri: `/assets?facility=${facilityId}` },
[assetId]: {
name: asset?.name,
Expand Down Expand Up @@ -404,7 +404,7 @@ const AssetManage = (props: AssetManageProps) => {
<div className="flex flex-col gap-6">
{[
{
label: asset?.location_object.facility.name,
label: asset?.location_object.facility?.name,
icon: "l-location-pin-alt",
content: asset?.location_object.name,
},
Expand All @@ -426,7 +426,7 @@ const AssetManage = (props: AssetManageProps) => {
className="flex gap-2"
onClick={() =>
navigate(
`/facility/${asset?.location_object.facility.id}/assets/${asset?.id}/update`
`/facility/${asset?.location_object.facility?.id}/assets/${asset?.id}/update`
)
}
id="update-asset"
Expand All @@ -444,7 +444,7 @@ const AssetManage = (props: AssetManageProps) => {
<ButtonV2
onClick={() =>
navigate(
`/facility/${asset?.location_object.facility.id}/assets/${asset?.id}/configure`
`/facility/${asset?.location_object.facility?.id}/assets/${asset?.id}/configure`
)
}
id="configure-asset"
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Assets/AssetWarrantyCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function AssetWarrantyCard(props: { asset: AssetData }) {
</div>
))}
</div>
<div className="mb-2 hidden h-[1px] w-full bg-white/40 xl:block" />
<div className="mb-2 hidden h-px w-full bg-white/40 xl:block" />
<div className="shrink-0">
<div>
<div className="mb-1 text-xs uppercase italic tracking-widest text-gray-200">
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Assets/AssetsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const AssetsList = () => {
try {
if (assetData) {
navigate(
`/facility/${assetData.location_object.facility.id}/assets/${assetId}`
`/facility/${assetData.location_object.facility?.id}/assets/${assetId}`
);
}
} catch (err) {
Expand Down Expand Up @@ -188,7 +188,7 @@ const AssetsList = () => {
{assets.map((asset: AssetData) => (
<Link
key={asset.id}
href={`/facility/${asset?.location_object.facility.id}/assets/${asset.id}`}
href={`/facility/${asset?.location_object.facility?.id}/assets/${asset.id}`}
className="h-full text-inherit"
data-testid="created-asset-list"
>
Expand Down
Loading
Loading