Skip to content

Commit af1de79

Browse files
committed
feat/draft: patents first pass
1 parent bd6df5b commit af1de79

5 files changed

Lines changed: 321 additions & 52 deletions

File tree

angular/src/app/search-panel/search-panel.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ <h3 *ngIf="title" class="heading title has-text-black">{{ title }}</h3>
277277
>
278278
<div class="external-info">
279279
<p class="external-info__lead">
280-
Include open-source projects (and soon patents/papers) alongside NIST resources. Filters and counts will blend them into your results.
280+
Include open-source projects and patents alongside NIST resources. Filters and counts will blend them into your results.
281281
</p>
282282
<div class="external-info__pills">
283283
<span class="external-pill">
@@ -286,7 +286,7 @@ <h3 *ngIf="title" class="heading title has-text-black">{{ title }}</h3>
286286
</span>
287287
<span class="external-pill">
288288
<i class="pi pi-book"></i>
289-
Patents (soon)
289+
Patents
290290
</span>
291291
<span class="external-pill">
292292
<i class="pi pi-file"></i>

angular/src/app/search-panel/search-panel.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class SearchPanelComponent implements OnInit, OnDestroy {
139139
private productTypesSub?: Subscription;
140140
private externalToggleSub?: Subscription;
141141
externalHelperText: string =
142-
"Toggle to include external products like open-source code (patents & papers coming soon). Results and filters will blend with NIST data.";
142+
"Toggle to include external products like open-source code and patents (papers coming soon). Results and filters will blend with NIST data.";
143143
externalInfoVisible: boolean = false;
144144
examplesDialogVisible = false;
145145
toastKey = "productToast";

angular/src/app/search/results/results.component.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ export class ResultsComponent implements OnInit {
285285
if (!this.inited || this.startupGuard || !changed) return;
286286
// If code (or other external types) are disabled, strip any lingering external-only filters.
287287
const externalAllowed =
288-
this.externalProductsEnabled && state && state.code !== false;
288+
this.externalProductsEnabled &&
289+
state &&
290+
!!(state.code || state.papers || state.patents);
289291
if (!externalAllowed) {
290292
const cleaned = this.stripExternalOnlyTypes(this.currentFilter);
291293
if (cleaned.changed) {
@@ -580,6 +582,7 @@ export class ResultsComponent implements OnInit {
580582
.toLowerCase();
581583
if (!normalized) return false;
582584
if (normalized === "coderepository") return true;
585+
if (normalized.startsWith("patent")) return true;
583586
return normalized.startsWith("vcs:");
584587
}
585588

@@ -847,7 +850,12 @@ export class ResultsComponent implements OnInit {
847850
}
848851

849852
isExternalResult(resultItem: any): boolean {
850-
return !!(resultItem && (resultItem.external || resultItem.source === "code"));
853+
return !!(
854+
resultItem &&
855+
(resultItem.external ||
856+
resultItem.source === "code" ||
857+
resultItem.source === "patents")
858+
);
851859
}
852860

853861
getResultTitle(resultItem: any): string {

0 commit comments

Comments
 (0)