diff --git a/frontend/src/pull-card/index.tsx b/frontend/src/pull-card/index.tsx index 5a64527e..43d006e7 100644 --- a/frontend/src/pull-card/index.tsx +++ b/frontend/src/pull-card/index.tsx @@ -196,9 +196,9 @@ const formatDate = (dateStr: string | null) => { return dateStr ? formatter.format(new Date(dateStr)) : null; }; -// eslint-disable-next-line @typescript-eslint/no-explicit-any function highlightOnChange( ref: RefObject, +// eslint-disable-next-line @typescript-eslint/no-explicit-any dependencies: Array ) { // Animate a highlight when pull.received_at changes diff --git a/frontend/src/pull.ts b/frontend/src/pull.ts index 581d73a7..a1870d71 100644 --- a/frontend/src/pull.ts +++ b/frontend/src/pull.ts @@ -8,6 +8,7 @@ import { StatusState, CommentSource, SignatureGroup, + SignatureType, } from "./types"; export class Pull extends PullData { @@ -18,6 +19,10 @@ export class Pull extends PullData { super(); Object.assign(this, data); + const syntheticCRs = this.getSyntheticSignatures(SignatureType.CR); + const syntheticQAs = this.getSyntheticSignatures(SignatureType.QA); + this.status.allCR = this.status.allCR.concat(syntheticCRs); + this.status.allQA = this.status.allQA.concat(syntheticQAs); this.cr_signatures = computeSignatures(data.status.allCR); this.qa_signatures = computeSignatures(data.status.allQA); } @@ -91,6 +96,20 @@ export class Pull extends PullData { }); } + getSyntheticSignatures(type: SignatureType): Signature[] { + // Treat dev_block sigs as out-of-date CRs in that they hold a place + // in the CR requirements. + return this.status.dev_block.map((devBlock) => { + return { + data: { + ...devBlock.data, + type, + active: 0, + } + }; + }); + } + /** * Returns true if there are required CI statues OR if there are *any* CI * statuses