Skip to content

Commit

Permalink
fix: ts check failed
Browse files Browse the repository at this point in the history
  • Loading branch information
vran-dev committed Dec 24, 2023
1 parent a0a7e35 commit 6ed7223
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 8 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"typescript": "4.7.4"
},
"dependencies": {
"@types/js-yaml": "^4.0.9",
"js-yaml": "^4.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
1 change: 1 addition & 0 deletions src/processor/contributionGraphCodeBlockProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class ContributionGraphRawProcessor {
}

try {
// @ts-ignore
return load(code);
} catch (e) {
if (e.mark?.line) {
Expand Down
23 changes: 15 additions & 8 deletions src/processor/dataFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class DataviewDataFetcher {
groupByCustomField(result: any, dateFieldName: string) {
const convertFailedPages: ConvertFail[] = [];
const data = result
// @ts-ignore
.filter((page) => {
if (page[dateFieldName]) {
try {
Expand All @@ -45,9 +46,11 @@ export class DataviewDataFetcher {
});
return false;
})
// @ts-ignore
.groupBy((page) => {
return page[dateFieldName].toFormat("yyyy-MM-dd");
})
// @ts-ignore
.map((entry) => {
return {
date: entry.key,
Expand All @@ -61,14 +64,18 @@ export class DataviewDataFetcher {
}

groupByFileCTime(data: any) {
return data
.groupBy((p) => p.file.ctime.toFormat("yyyy-MM-dd"))
.map((entry) => {
return {
date: entry.key,
value: entry.rows.length,
};
});
return (
data
// @ts-ignore
.groupBy((p) => p.file.ctime.toFormat("yyyy-MM-dd"))
// @ts-ignore
.map((entry) => {
return {
date: entry.key,
value: entry.rows.length,
};
})
);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/util/tooltips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function showTips(event: MouseEvent, text: string) {

// 调整 tooltip 元素的位置
if (event.target) {
//@ts-ignore
const rect = event.target.getBoundingClientRect();
tooltip.style.top = rect.top - tooltip.offsetHeight - 5 + "px";
tooltip.style.left = rect.left + "px";
Expand Down
1 change: 1 addition & 0 deletions src/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function mapBy<T, R>(
for (const item of arr) {
const key = keyMapping(item);
if (map.has(key)) {
//@ts-ignore
map.set(key, aggregator(map.get(key), valueMapping(item)));
} else {
map.set(key, valueMapping(item));
Expand Down
1 change: 1 addition & 0 deletions src/view/form/CellRuleFormItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function CellRuleItem(props: {
<div className="form-item">
<button
className="cell-rule-remove-button"
//@ts-ignore
onClick={() => props.onRemove(props.rule.id)}
>
x
Expand Down
4 changes: 4 additions & 0 deletions src/view/form/GraphForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export function CreateContributionGraphForm(props: {
...formData.titleStyle,
fontWeight:
formData.titleStyle?.fontWeight || "normal",
// @ts-ignore
textAlign:
formData.titleStyle?.textAlign || "left",
}}
Expand Down Expand Up @@ -268,9 +269,11 @@ export function CreateContributionGraphForm(props: {
return (
<CellRuleItem
rule={rule}
// @ts-ignore
key={rule.id}
onChange={(newRule) => {
const newRules = cellRules.map((r) => {
// @ts-ignore
if (r.id == newRule.id) {
return newRule;
} else {
Expand All @@ -281,6 +284,7 @@ export function CreateContributionGraphForm(props: {
}}
onRemove={(id: string) => {
const newRules = cellRules.filter(
// @ts-ignore
(r) => r.id != id
);
setCellRules(newRules);
Expand Down
Empty file removed test/matrixDataGenerator.test.ts
Empty file.

0 comments on commit 6ed7223

Please sign in to comment.