Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensures support for additional Facet types (beyond 'terms') #250

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
11 changes: 4 additions & 7 deletions static.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import _STATIC from "./static.json";
import _STATIC from "./static.json" with { type: "json" };
import { defaultsDeep, get as _get } from "lodash";
import { ThemeSettings } from "@/theme";

import type { ResultListingComponentOptions } from "@/components/ResultListing";
import type { ResultComponentOptions } from "@/components/Result";
import { NavigationOptions } from "@/components/Navigation";

import type { GFacet } from "@globus/sdk/services/search/service/query";
Copy link
Member Author

@jbottigliero jbottigliero Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE TO SELF:

This isn't going to work based on the current type in the SDK... which I think is slightly off based on:

  • size should be optional when type: "terms"
  • name is optional and is only required if there is a conflict in field_name

Aside from that, it's not clear we're actually processing the generated GFilter properly given the configured GFacet.


/**
* The base type for a `static.json` file.
*/
Expand Down Expand Up @@ -141,12 +143,7 @@
* The UUID of the Globus Search Index that will be used as the data source.
*/
index: string;
facets?: {
name?: string;
field_name: string;
type: string;
size: number;
}[];
facets?: GFacet[];
};
};
};
Expand All @@ -160,7 +157,7 @@
* Reference to the `static.json` file.
* @private
*/
export const STATIC: Static = _STATIC;

Check failure on line 160 in static.ts

View workflow job for this annotation

GitHub Actions / lint + test

Type '{ _static: { generator: { name: string; }; }; data: { version: string; attributes: { metadata: { title: string; description: string; }; theme: { colors: { brand: { "50": string; "100": string; "200": string; "300": string; ... 5 more ...; "900": string; }; }; }; content: { ...; }; components: { ...; }; globus: { ......' is not assignable to type 'Static'.

defaultsDeep(STATIC, {
data: {
Expand Down
Loading