Skip to content

Commit

Permalink
[fix] some Type detail bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery committed Jun 19, 2024
1 parent 67954c1 commit 3eb6aea
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 34 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"boot-cell": "^2.0.0-beta.29",
"browser-unhandled-rejection": "^1.0.2",
"cell-router": "^3.0.0-rc.7",
"cell-router": "^3.0.0-rc.8",
"classnames": "^2.5.1",
"dom-renderer": "^2.1.8",
"echarts": "^5.5.0",
Expand All @@ -34,7 +34,7 @@
"@parcel/transformer-less": "~2.12.0",
"@parcel/transformer-typescript-tsc": "~2.12.0",
"@parcel/transformer-webmanifest": "~2.12.0",
"@types/node": "^18.19.36",
"@types/node": "^18.19.37",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"buffer": "^6.0.3",
Expand Down Expand Up @@ -72,7 +72,7 @@
"browserslist": "> 0.5%, last 2 versions, not dead, IE 11",
"scripts": {
"prepare": "husky",
"test": "lint-staged",
"test": "lint-staged && tsc --noEmit",
"clean": "rm -rf .parcel-cache/ dist/",
"start:local": "npm run clean && cross-env HTTP_ENV=local parcel source/index.html --open",
"start:remote": "npm run clean && cross-env HTTP_ENV=remote parcel source/index.html --open",
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

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

8 changes: 4 additions & 4 deletions source/component/AuditBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { Button, ButtonGroup } from 'boot-cell';

import { TimeUnitName } from '../utility';
import { DataItem, Organization } from '../service';
import { session, BaseModel, VerifiableModel } from '../model';
import { session, VerifiableModel } from '../model';

export interface AuditBarProps extends DataItem, Organization {
export interface AuditBarProps<T> extends DataItem, Organization {
scope: string;
model: BaseModel;
model: VerifiableModel<T>;
}

const TimeStamp: FC<Record<'date' | 'phone' | 'label', string>> = ({
Expand All @@ -26,7 +26,7 @@ const TimeStamp: FC<Record<'date' | 'phone' | 'label', string>> = ({
);
};

export const AuditBar: FC<AuditBarProps> = observer(props => {
export const AuditBar = observer(function <T>(props: AuditBarProps<T>) {
const {
createdAt,
updatedAt,
Expand Down
19 changes: 7 additions & 12 deletions source/component/CardsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,24 @@ import {
TouchHandler
} from 'boot-cell';
import { CustomElement } from 'web-utility';
import { Filter } from 'mobx-restful';

import { DistrictEvent, DistrictFilter, District } from './DistrictFilter';
import { VerifiableModel, session } from '../model';
import { DataItem } from '../service';

export abstract class CardsPage<T>
export abstract class CardsPage<T extends DataItem>
extends HTMLElement
implements CustomElement
{
abstract scope: string;
abstract model: VerifiableModel;
abstract model: VerifiableModel<T>;
abstract name: string;
districtFilter = false;

filter: District & { verified?: boolean } = {
filter = {
verified: !session.hasRole('Admin')
};

mountedCallback() {
this.model.getList(this.filter);
}
} as Filter<T> & District & { verified?: boolean };

disconnectedCallback() {
this.model.clear();
Expand All @@ -37,10 +35,7 @@ export abstract class CardsPage<T>
};

changeDistrict = ({ detail }: DistrictEvent) =>
this.model.getList(
(this.filter = { ...detail, verified: this.filter.verified }),
1
);
this.model.getList((this.filter = { ...this.filter, ...detail }), 1);

changeVerified = ({ target }: Event) => {
const { checked } = target as HTMLInputElement;
Expand Down
3 changes: 1 addition & 2 deletions source/page/Map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { observable } from 'mobx';
import { SpinnerBox } from 'boot-cell';
import { CustomElement, Hour } from 'web-utility';

import { HierarchicalVirusMap, VirusChart } from './component';
import { HierarchicalVirusMap } from './component';
import {
Series,
ProvinceData,
Expand Down Expand Up @@ -65,7 +65,6 @@ export default class MapsPage extends HTMLElement implements CustomElement {
resolution={resolution}
/>
)}
<VirusChart className="vh-100" />
</SpinnerBox>
);
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"useDefineForClassFields": true,
"jsx": "react-jsx",
"jsxImportSource": "dom-renderer",
"lib": ["ES2023", "DOM"]
"lib": ["ESNext", "DOM"]
},
"include": ["source/**/*", "*.ts"]
}

1 comment on commit 3eb6aea

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for wuhan2020 ready!

✅ Preview
https://wuhan2020-pqs30if2v-techquerys-projects.vercel.app

Built with commit 3eb6aea.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.