Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
Binary file added ui/src/assets/tooltip-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion ui/src/components/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ const fields: FormFieldProps[] = [
{ value: "Withdrawn", label: "Withdrawn" },
],
},
{ name: "titleOfInvention", label: "Title Of Invention", type: "text" },
{
name: "titleOfInvention",
label: "Title Of Invention",
type: "text",
tooltipText:
"Enabling the smart search will retrieve results that not only match the title of invention keyword, but are also semantically similar in meaning.",
},
{
name: "filingDate",
label: "Filing Date Range",
Expand Down Expand Up @@ -194,6 +200,7 @@ export default function SearchComponent() {
placeholder={field.label}
// error={errors[field.name]}
options={field.options}
tooltipText={field.tooltipText}
/>
);
return (
Expand Down
20 changes: 17 additions & 3 deletions ui/src/components/elements/FormField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";

import { OverlayTrigger, Tooltip } from "react-bootstrap";
import tooltipIcon from "../../assets/tooltip-48.png";
const FormField: React.FC<FormFieldProps> = ({
label,
name,
Expand All @@ -11,15 +12,27 @@ const FormField: React.FC<FormFieldProps> = ({
options = [],
valueEnd,
onChangeEnd,
tooltipText,
}) => {
const inputClass = `form-control ${error ? "is-invalid" : ""}`;

return (
<div className="mb-3 text-start">
<label htmlFor={name} className="form-label fw-semibold">
{label}
{label + " "}
{tooltipText && (
<OverlayTrigger
placement="top"
overlay={<Tooltip id={`tooltip-${name}`}>{tooltipText}</Tooltip>}
>
<img
src={tooltipIcon}
alt="info"
style={{ width: "16px", height: "16px", cursor: "pointer" }}
/>
</OverlayTrigger>
)}
</label>

{type === "select" ? (
<select
id={name}
Expand Down Expand Up @@ -101,4 +114,5 @@ export interface FormFieldProps {
options?: Option[]; // For select
valueEnd?: string; // For date-range end value
onChangeEnd?: (e: React.ChangeEvent<HTMLInputElement>) => void; // For date-range end
tooltipText?: string;
}
4 changes: 4 additions & 0 deletions ui/src/declarations.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.png" {
const value: string;
export default value;
}