Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

fix: rename AsgNegColumn to AsgColumn and fix column numbers #604

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions src/methods/colorizeDeadline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ const trans = {
},
}

const enum AsgNegColumn {
Status = 6,
Deadline = 2,
const enum AsgColumn {
Status = 7,
Deadline = 9,
}

const getAsgAttrs = (row: HTMLElement, column: AsgNegColumn) =>
(row.childNodes[row.childNodes.length - column] as HTMLElement).innerText
const getAsgAttrs = (row: HTMLElement, column: AsgColumn) =>
(row.childNodes[column] as HTMLElement).innerText

const getAsgRowElements = (document: Document) =>
document.querySelectorAll<HTMLElement>(".row0, .row1, .row")
Expand Down Expand Up @@ -56,8 +56,8 @@ const colorizeDeadline = ({
Array.from<HTMLElement>(getAsgRowElements(document))
.map((row) => ({
row,
deadline: getAsgAttrs(row, AsgNegColumn.Deadline),
status: checkStatus ? getAsgAttrs(row, AsgNegColumn.Status) : undefined,
deadline: getAsgAttrs(row, AsgColumn.Deadline),
status: checkStatus ? getAsgAttrs(row, AsgColumn.Status) : undefined,
}))
.filter(({ deadline }) => deadline)
.map((attrs) => ({
Expand Down