synapse-react-client 4.0.20 → 4.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SWC.index.d.ts +1 -0
- package/dist/SWC.index.d.ts.map +1 -1
- package/dist/SWC.index.js +2 -1
- package/dist/SWC.index.js.map +1 -1
- package/dist/components/CardContainer/CardConfiguration.d.ts +2 -0
- package/dist/components/CardContainer/CardConfiguration.d.ts.map +1 -1
- package/dist/components/CardContainer/CardContainer.d.ts.map +1 -1
- package/dist/components/CardContainer/CardContainer.js +44 -50
- package/dist/components/CardContainer/CardContainer.js.map +1 -1
- package/dist/components/CardContainerLogic/CardContainerLogic.d.ts +14 -0
- package/dist/components/CardContainerLogic/CardContainerLogic.d.ts.map +1 -1
- package/dist/components/CardContainerLogic/CardContainerLogic.js +64 -40
- package/dist/components/CardContainerLogic/CardContainerLogic.js.map +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmissionStepper.js +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmissionStepper.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.css +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.js +16 -16
- package/dist/components/DataExplorer/DataExplorer.module.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.scss +26 -7
- package/dist/components/DataGrid/DataGrid.d.ts +1 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/DataGrid.js +72 -72
- package/dist/components/DataGrid/DataGrid.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +209 -206
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts +6 -3
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +54 -46
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
- package/dist/components/DataGrid/hooks/useColumnResizeHandles.d.ts.map +1 -1
- package/dist/components/DataGrid/hooks/useColumnResizeHandles.js +1 -1
- package/dist/components/DataGrid/hooks/useColumnResizeHandles.js.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.d.ts.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js +68 -67
- package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts +1 -0
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +5 -3
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DataGrid/utils/modelColsToGrid.d.ts +1 -1
- package/dist/components/DataGrid/utils/modelColsToGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/modelColsToGrid.js +15 -14
- package/dist/components/DataGrid/utils/modelColsToGrid.js.map +1 -1
- package/dist/components/DataGrid/utils/normalizeWebsocketError.d.ts +7 -0
- package/dist/components/DataGrid/utils/normalizeWebsocketError.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/normalizeWebsocketError.js +8 -0
- package/dist/components/DataGrid/utils/normalizeWebsocketError.js.map +1 -0
- package/dist/components/GenericCard/GenericCard.d.ts +2 -0
- package/dist/components/GenericCard/GenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/GenericCard.js +76 -64
- package/dist/components/GenericCard/GenericCard.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +33 -25
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/Goals/Goals.d.ts +8 -0
- package/dist/components/Goals/Goals.d.ts.map +1 -1
- package/dist/components/Goals/Goals.js +54 -40
- package/dist/components/Goals/Goals.js.map +1 -1
- package/dist/components/Plot/SynapseSankeyPlot.css +1 -0
- package/dist/components/Plot/SynapseSankeyPlot.d.ts +44 -2
- package/dist/components/Plot/SynapseSankeyPlot.d.ts.map +1 -1
- package/dist/components/Plot/SynapseSankeyPlot.js +343 -38
- package/dist/components/Plot/SynapseSankeyPlot.js.map +1 -1
- package/dist/components/Plot/SynapseSankeyPlot.module.js +15 -0
- package/dist/components/Plot/SynapseSankeyPlot.module.js.map +1 -0
- package/dist/components/Plot/SynapseSankeyPlot.module.scss +63 -0
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.d.ts +9 -0
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.d.ts.map +1 -0
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js +69 -0
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js.map +1 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.d.ts +13 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.d.ts.map +1 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.js +11 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.js.map +1 -0
- package/dist/components/ProjectVisibilityChip/index.d.ts +5 -0
- package/dist/components/ProjectVisibilityChip/index.d.ts.map +1 -0
- package/dist/components/ProjectVisibilityChip/index.js +7 -0
- package/dist/components/ProjectVisibilityChip/index.js.map +1 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.d.ts.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/RowSetView.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/RowSetView.js +9 -12
- package/dist/components/QueryWrapperPlotNav/RowSetView.js.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.d.ts +7 -15
- package/dist/components/RssFeedCards/RssFeedCards.d.ts.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.js +114 -123
- package/dist/components/RssFeedCards/RssFeedCards.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts +13 -12
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +88 -77
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js +63 -74
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/ColumnModelForm.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js +72 -68
- package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.d.ts +27 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js +47 -36
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormReducer.d.ts +12 -12
- package/dist/components/TableColumnSchemaEditor/Validators/BooleanSchema.d.ts +4 -1
- package/dist/components/TableColumnSchemaEditor/Validators/BooleanSchema.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/ColumnModelValidator.d.ts +167 -517
- package/dist/components/TableColumnSchemaEditor/Validators/ColumnModelValidator.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/ColumnModelValidator.js +65 -65
- package/dist/components/TableColumnSchemaEditor/Validators/ColumnModelValidator.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/DatetimeSchema.d.ts +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/DatetimeSchema.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/DoubleSchema.d.ts +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/DoubleSchema.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/DoubleSchema.js +6 -13
- package/dist/components/TableColumnSchemaEditor/Validators/DoubleSchema.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/EntityIdSchema.d.ts +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/EntityIdSchema.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/IntegerSchema.d.ts +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/IntegerSchema.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/IntegerSchema.js +2 -2
- package/dist/components/TableColumnSchemaEditor/Validators/IntegerSchema.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/OptionalStringSchema.d.ts +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/OptionalStringSchema.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/getZodSchemaForColumnType.d.ts +2 -2
- package/dist/components/TableColumnSchemaEditor/Validators/getZodSchemaForColumnType.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/getZodSchemaForColumnType.js +15 -16
- package/dist/components/TableColumnSchemaEditor/Validators/getZodSchemaForColumnType.js.map +1 -1
- package/dist/components/UserCardList/UserCardList.d.ts +2 -20
- package/dist/components/UserCardList/UserCardList.d.ts.map +1 -1
- package/dist/components/UserCardList/UserCardList.js +49 -72
- package/dist/components/UserCardList/UserCardList.js.map +1 -1
- package/dist/components/UserCardList/UserCardListRotate.d.ts +13 -0
- package/dist/components/UserCardList/UserCardListRotate.d.ts.map +1 -1
- package/dist/components/UserCardList/UserCardListRotate.js +82 -57
- package/dist/components/UserCardList/UserCardListRotate.js.map +1 -1
- package/dist/mocks/mockSearchQueryData.js +2 -2
- package/dist/mocks/mockSearchQueryData.js.map +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.d.ts +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.js +6 -3
- package/dist/mocks/msw/handlers/searchQueryHandlers.js.map +1 -1
- package/dist/mocks/query/mockUserCardTableQueryResultBundle.d.ts +13 -0
- package/dist/mocks/query/mockUserCardTableQueryResultBundle.d.ts.map +1 -1
- package/dist/mocks/query/mockUserCardTableQueryResultBundle.js +27 -0
- package/dist/mocks/query/mockUserCardTableQueryResultBundle.js.map +1 -1
- package/dist/style/abstracts/_cssVariables.scss +1 -0
- package/dist/style/components/_cards.scss +10 -0
- package/dist/style/components/_data-grid-extra.css +1 -1
- package/dist/style/components/_data-grid-extra.scss +7 -1
- package/dist/style/main.css +1 -1
- package/dist/synapse-client/SynapseClient.d.ts.map +1 -1
- package/dist/synapse-client/SynapseClient.js +497 -495
- package/dist/synapse-client/SynapseClient.js.map +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +1 -0
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +3 -0
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/index.js +46 -44
- package/dist/synapse-queries/user/index.js +3 -3
- package/dist/synapse-queries/user/useUserBundle.d.ts +12 -0
- package/dist/synapse-queries/user/useUserBundle.d.ts.map +1 -1
- package/dist/synapse-queries/user/useUserBundle.js +50 -36
- package/dist/synapse-queries/user/useUserBundle.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/AppUtils/session/SessionInitializedGuard.d.ts +10 -5
- package/dist/utils/AppUtils/session/SessionInitializedGuard.d.ts.map +1 -1
- package/dist/utils/AppUtils/session/SessionInitializedGuard.js +13 -9
- package/dist/utils/AppUtils/session/SessionInitializedGuard.js.map +1 -1
- package/dist/utils/functions/SqlFunctions.d.ts +1 -1
- package/dist/utils/functions/SqlFunctions.d.ts.map +1 -1
- package/dist/utils/functions/SqlFunctions.js +1 -1
- package/dist/utils/functions/SqlFunctions.js.map +1 -1
- package/package.json +7 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserCardList.js","names":[],"sources":["../../../src/components/UserCardList/UserCardList.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"UserCardList.js","names":[],"sources":["../../../src/components/UserCardList/UserCardList.tsx"],"sourcesContent":["import { useGetUserProfilesWithProfilePicAttached } from '@/synapse-queries/user/useUserBundle'\nimport { MEDIUM_USER_CARD, UserCardSize } from '@/utils/SynapseConstants'\nimport {\n ColumnTypeEnum,\n RowSet,\n UserProfile,\n} from '@sage-bionetworks/synapse-types'\nimport { useMemo } from 'react'\nimport UserCard from '../UserCard/UserCard'\n\nexport type UserCardListProps = {\n /* The list of user IDs or null values to render. For null values, the card will be rendered with table data supplied by `firstName`, `lastName`, and `institution` columns supplied by the data prop. */\n list: (string | null)[]\n size?: UserCardSize\n // Data should not be needed, however, it gives the option to fill in a user profile with other column\n // fields. This is required specifically by AMP-AD Explore/People page\n rowSet?: RowSet\n}\n\n/**\n * Given a RowSet, extracts faux user profiles for rows where ownerId is null,\n * using firstName, lastName, and institution columns.\n */\nfunction extractFauxUserProfiles(\n rowSet: RowSet,\n): Omit<UserProfile, 'ownerId'>[] {\n const firstNameIndex = rowSet.headers.findIndex(el => el.name === 'firstName')\n const lastNameIndex = rowSet.headers.findIndex(el => el.name === 'lastName')\n const institutionIndex = rowSet.headers.findIndex(\n el => el.name === 'institution',\n )\n const ownerIdIndex = rowSet.headers.findIndex(\n el => el.columnType === ColumnTypeEnum.USERID,\n )\n const nullOwnerIdsRows = rowSet.rows.filter(el => !el.values[ownerIdIndex])\n return nullOwnerIdsRows.map(el => {\n const values = el.values\n return {\n firstName: values[firstNameIndex] ?? '',\n lastName: values[lastNameIndex] ?? '',\n company: values[institutionIndex] ?? undefined,\n ownerId: null,\n userName: values[firstNameIndex] ? (values[firstNameIndex][0] ?? '') : '',\n }\n })\n}\n\nexport function UserCardList(props: UserCardListProps) {\n const { list, size = MEDIUM_USER_CARD, rowSet } = props\n\n const principalIds = useMemo(\n () => list.filter((el): el is string => !!el),\n [list],\n )\n\n const { data } = useGetUserProfilesWithProfilePicAttached(principalIds)\n\n const userProfileMap = useMemo(() => {\n const map: Record<string, UserProfile> = {}\n data?.list.forEach(profile => {\n if (profile.ownerId) {\n map[profile.ownerId] = profile\n }\n })\n return map\n }, [data])\n\n const fauxUserProfilesList = rowSet\n ? extractFauxUserProfiles(rowSet)\n : undefined\n let fauxUserProfileIndex = 0\n\n return (\n <div className=\"SRC-card-grid-row\">\n {list.map(ownerId => {\n const userProfile = ownerId != null ? userProfileMap[ownerId] : null\n if (userProfile) {\n return (\n <div\n key={JSON.stringify(userProfile)}\n className=\"SRC-grid-item SRC-narrow-grid-item\"\n >\n <UserCard\n size={size}\n preSignedURL={userProfile.clientPreSignedURL}\n userProfile={userProfile}\n />\n </div>\n )\n }\n const fauxUserProfile =\n fauxUserProfilesList && fauxUserProfilesList[fauxUserProfileIndex]\n if (!fauxUserProfile) {\n return false\n }\n fauxUserProfileIndex += 1\n return (\n <div\n key={JSON.stringify(fauxUserProfile)}\n className=\"SRC-grid-item SRC-narrow-grid-item\"\n >\n <UserCard\n disableLink={true}\n hideEmail={true}\n size={size}\n // TODO: Modify UserCard to accept a fake profile with no ownerId field, and remove this cast.\n userProfile={fauxUserProfile as UserProfile}\n />\n </div>\n )\n })}\n </div>\n )\n}\n\nexport default UserCardList\n"],"mappings":";;;;;;;AAuBA,SAAS,EACP,GACgC;CAChC,IAAM,IAAiB,EAAO,QAAQ,WAAU,MAAM,EAAG,SAAS,WAAW,GACvE,IAAgB,EAAO,QAAQ,WAAU,MAAM,EAAG,SAAS,UAAU,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,CAUhC,KAfE;EAiBX,CAAC;CACE,CAAA;AAET"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SQLOperator } from '@/utils/functions/SqlFunctions';
|
|
2
2
|
import { UserCardSize } from '@/utils/SynapseConstants';
|
|
3
3
|
import { FacetColumnRequest } from '@sage-bionetworks/synapse-types';
|
|
4
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
4
5
|
export type UserCardListRotateProps = {
|
|
5
6
|
sql: string;
|
|
6
7
|
count: number;
|
|
@@ -16,4 +17,16 @@ export type UserCardListRotateProps = {
|
|
|
16
17
|
export declare const getDisplayIds: (ids: string[] | undefined, count: number | undefined, storageUidKey: string) => string[];
|
|
17
18
|
export declare function UserCardListRotate({ sql, count, useQueryResultUserData, size, summaryLink, summaryLinkText, selectedFacets, searchParams, sqlOperator, additionalFiltersSessionStorageKey, }: UserCardListRotateProps): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export default UserCardListRotate;
|
|
20
|
+
/**
|
|
21
|
+
* Prefetches the UserCardListRotate table query and the user profiles it
|
|
22
|
+
* references into a QueryClient for use with HydrationBoundary. Uses anonymous
|
|
23
|
+
* access; warm-caches for unauthenticated users.
|
|
24
|
+
*/
|
|
25
|
+
export declare function prefetchUserCardListRotate(queryClient: QueryClient, sql: string, options?: {
|
|
26
|
+
selectedFacets?: FacetColumnRequest[];
|
|
27
|
+
searchParams?: Record<string, string>;
|
|
28
|
+
sqlOperator?: SQLOperator;
|
|
29
|
+
additionalFiltersSessionStorageKey?: string;
|
|
30
|
+
count?: number;
|
|
31
|
+
}): Promise<void>;
|
|
19
32
|
//# sourceMappingURL=UserCardListRotate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserCardListRotate.d.ts","sourceRoot":"","sources":["../../../src/components/UserCardList/UserCardListRotate.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserCardListRotate.d.ts","sourceRoot":"","sources":["../../../src/components/UserCardList/U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,CAAC,EAAE,WAAW,CAAA;IACzB,kCAAkC,CAAC,EAAE,MAAM,CAAA;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GACA,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
|
|
@@ -1,81 +1,106 @@
|
|
|
1
1
|
import { LARGE_USER_CARD as e } from "../../utils/SynapseConstants.js";
|
|
2
2
|
import t from "../../synapse-client/index.js";
|
|
3
3
|
import { getAdditionalFilters as n, parseEntityIdFromSqlStatement as r } from "../../utils/functions/SqlFunctions.js";
|
|
4
|
-
import {
|
|
4
|
+
import { KeyFactory as i } from "../../synapse-queries/KeyFactory.js";
|
|
5
|
+
import { useSynapseContext as a } from "../../utils/context/SynapseContext.js";
|
|
5
6
|
import "../../utils/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { tableQueryUseQueryDefaults as o } from "../../synapse-queries/entity/useGetQueryResultBundle.js";
|
|
8
|
+
import { getUserProfilesWithProfilePicAttachedQueryOptions as s } from "../../synapse-queries/user/useUserBundle.js";
|
|
9
|
+
import { LoadingUserCardMedium as c } from "../UserCard/UserCardMedium.js";
|
|
10
|
+
import { UserCardList as l } from "./UserCardList.js";
|
|
11
|
+
import { LargeButton as u } from "../styled/LargeButton.js";
|
|
12
|
+
import { useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
13
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
14
|
+
import { ColumnTypeEnum as _ } from "@sage-bionetworks/synapse-types";
|
|
15
|
+
import { useQuery as v } from "@tanstack/react-query";
|
|
13
16
|
//#region src/components/UserCardList/UserCardListRotate.tsx
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
var y = "sage_rotate_uids", b = 3, x = (e = [], t = b, n) => {
|
|
18
|
+
if (typeof localStorage > "u") return e.slice(0, t);
|
|
19
|
+
let r = localStorage.getItem(n), i = r ? JSON.parse(r) : [];
|
|
20
|
+
if (!i.length) {
|
|
21
|
+
let r = e.slice(0, t);
|
|
22
|
+
return localStorage.setItem(n, JSON.stringify(r)), r;
|
|
23
|
+
}
|
|
24
|
+
let a = new Set(i), o = e.filter((e) => !a.has(e));
|
|
25
|
+
if (o.length >= t) {
|
|
26
|
+
let e = o.slice(0, t);
|
|
27
|
+
return localStorage.setItem(n, JSON.stringify([...i, ...e])), e;
|
|
28
|
+
}
|
|
29
|
+
let s = e.slice(0, t - o.length);
|
|
30
|
+
return localStorage.setItem(n, JSON.stringify(s)), [...o, ...s];
|
|
25
31
|
};
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}(), ()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
]),
|
|
32
|
+
function S(e, t) {
|
|
33
|
+
return {
|
|
34
|
+
partMask: 1,
|
|
35
|
+
concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest",
|
|
36
|
+
entityId: r(e),
|
|
37
|
+
query: {
|
|
38
|
+
sql: e,
|
|
39
|
+
additionalFilters: n(t?.searchParams, t?.sqlOperator, t?.additionalFiltersSessionStorageKey),
|
|
40
|
+
selectedFacets: t?.selectedFacets
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function C(e) {
|
|
45
|
+
if (!e?.queryResult?.queryResults.rows) return [];
|
|
46
|
+
let t = e.queryResult.queryResults.headers.findIndex((e) => e.columnType === _.USERID);
|
|
47
|
+
return t === -1 ? [] : e.queryResult.queryResults.rows.map((e) => e.values[t]).filter((e) => e !== null);
|
|
48
|
+
}
|
|
49
|
+
function w({ sql: n, count: r, useQueryResultUserData: i = !1, size: s = e, summaryLink: _, summaryLinkText: b, selectedFacets: w, searchParams: T, sqlOperator: E, additionalFiltersSessionStorageKey: D }) {
|
|
50
|
+
let { accessToken: O, keyFactory: k } = a(), A = `${y}-${n}-${JSON.stringify(w)}`, j = S(n, {
|
|
51
|
+
selectedFacets: w,
|
|
52
|
+
searchParams: T,
|
|
53
|
+
sqlOperator: E,
|
|
54
|
+
additionalFiltersSessionStorageKey: D
|
|
55
|
+
}), { data: M, isPending: N } = v({
|
|
56
|
+
...o,
|
|
57
|
+
queryKey: k.getFullTableQueryResultQueryKey(j, !1),
|
|
58
|
+
queryFn: () => t.getFullQueryTableResults(j, O)
|
|
59
|
+
}), [P, F] = m([]), I = f(() => C(M), [M]), L = I.slice(0, r), R = p(!1);
|
|
60
|
+
d(() => {
|
|
61
|
+
R.current || (R.current = !0, F(x(I, r, A)));
|
|
62
|
+
}, [
|
|
63
|
+
I,
|
|
64
|
+
r,
|
|
65
|
+
A
|
|
66
|
+
]);
|
|
67
|
+
let z = P.length > 0 ? P : L;
|
|
68
|
+
return /* @__PURE__ */ g("div", {
|
|
54
69
|
className: "UserCardListRotate",
|
|
55
70
|
children: [
|
|
56
|
-
|
|
57
|
-
!
|
|
71
|
+
N && /* @__PURE__ */ h(c, {}),
|
|
72
|
+
!N && z.length === 0 && /* @__PURE__ */ h("p", {
|
|
58
73
|
className: "font-italic",
|
|
59
74
|
children: "No one was found."
|
|
60
75
|
}),
|
|
61
|
-
!
|
|
62
|
-
list:
|
|
63
|
-
size:
|
|
64
|
-
rowSet:
|
|
76
|
+
!N && z.length > 0 && /* @__PURE__ */ h(l, {
|
|
77
|
+
list: z,
|
|
78
|
+
size: s,
|
|
79
|
+
rowSet: i ? M?.queryResult?.queryResults : void 0
|
|
65
80
|
}),
|
|
66
|
-
|
|
81
|
+
_ && b && /* @__PURE__ */ h("div", {
|
|
67
82
|
className: "UserCardListRotate__summary",
|
|
68
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ h(u, {
|
|
69
84
|
color: "secondary",
|
|
70
85
|
variant: "contained",
|
|
71
|
-
href:
|
|
86
|
+
href: _,
|
|
72
87
|
children: b
|
|
73
88
|
})
|
|
74
89
|
})
|
|
75
90
|
]
|
|
76
91
|
});
|
|
77
92
|
}
|
|
93
|
+
async function T(e, n, r) {
|
|
94
|
+
let a = new i(void 0), c = S(n, r), l = a.getFullTableQueryResultQueryKey(c, !1);
|
|
95
|
+
await e.prefetchQuery({
|
|
96
|
+
...o,
|
|
97
|
+
queryKey: l,
|
|
98
|
+
queryFn: () => t.getFullQueryTableResults(c, void 0)
|
|
99
|
+
});
|
|
100
|
+
let u = C(e.getQueryData(l)).slice(0, r?.count ?? b);
|
|
101
|
+
u.length > 0 && await e.prefetchQuery(s(u, { keyFactory: a }));
|
|
102
|
+
}
|
|
78
103
|
//#endregion
|
|
79
|
-
export {
|
|
104
|
+
export { w as UserCardListRotate, w as default, x as getDisplayIds, T as prefetchUserCardListRotate };
|
|
80
105
|
|
|
81
106
|
//# sourceMappingURL=UserCardListRotate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserCardListRotate.js","names":[],"sources":["../../../src/components/UserCardList/UserCardListRotate.tsx"],"sourcesContent":["import LargeButton from '@/components/styled/LargeButton'\nimport SynapseClient from '@/synapse-client'\nimport { SynapseConstants } from '@/utils'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport {\n getAdditionalFilters,\n parseEntityIdFromSqlStatement,\n SQLOperator,\n} from '@/utils/functions/SqlFunctions'\nimport { LARGE_USER_CARD, UserCardSize } from '@/utils/SynapseConstants'\nimport {\n ColumnTypeEnum,\n FacetColumnRequest,\n QueryBundleRequest,\n QueryResultBundle,\n} from '@sage-bionetworks/synapse-types'\nimport { useState } from 'react'\nimport { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect'\nimport { LoadingUserCardMedium } from '../UserCard/UserCardMedium'\nimport UserCardList from './UserCardList'\n\nconst STORED_UID_KEY = 'sage_rotate_uids'\nconst DEFAULT_DISPLAY_COUNT = 3\n\nexport type UserCardListRotateProps = {\n sql: string\n count: number\n useQueryResultUserData?: boolean\n size?: UserCardSize\n summaryLink?: string\n summaryLinkText?: string\n selectedFacets?: FacetColumnRequest[]\n sqlOperator?: SQLOperator\n searchParams?: Record<string, string>\n additionalFiltersSessionStorageKey?: string\n}\n\nexport const getDisplayIds = (\n ids: string[] = [],\n count: number = DEFAULT_DISPLAY_COUNT,\n storageUidKey: string,\n) => {\n let storedIds: string[] = []\n let newIds: string[] = []\n const storedIdsStr = localStorage.getItem(storageUidKey)\n if (storedIdsStr != null) {\n storedIds = JSON.parse(storedIdsStr)\n }\n if (!storedIds.length) {\n // no stuff in storage\n newIds = ids.slice(0, count)\n localStorage.setItem(storageUidKey, JSON.stringify(newIds))\n return newIds\n } else {\n // has stuff in storage\n const filtered = ids.filter(item => !storedIds.includes(item))\n if (filtered.length >= count) {\n newIds = filtered.slice(0, count)\n localStorage.setItem(\n storageUidKey,\n JSON.stringify(storedIds.concat(newIds)),\n )\n return newIds\n } else {\n localStorage.removeItem(storageUidKey)\n const part = ids.slice(0, count - filtered.length)\n localStorage.setItem(storageUidKey, JSON.stringify(part))\n return filtered.concat(part)\n }\n }\n}\n\nexport function UserCardListRotate({\n sql,\n count,\n useQueryResultUserData = false,\n size = LARGE_USER_CARD,\n summaryLink,\n summaryLinkText,\n selectedFacets,\n searchParams,\n sqlOperator,\n additionalFiltersSessionStorageKey,\n}: UserCardListRotateProps) {\n const { accessToken } = useSynapseContext()\n const [userIds, setUserIds] = useState<string[]>([])\n const [queryData, setQueryData] = useState<QueryResultBundle>()\n const [isLoading, setIsLoading] = useState<boolean>()\n let mounted = true\n const storageUidKey = `${STORED_UID_KEY}-${sql}-${JSON.stringify(\n selectedFacets,\n )}`\n useDeepCompareEffectNoCheck(() => {\n const fetchData = async function () {\n setIsLoading(true)\n const entityId = parseEntityIdFromSqlStatement(sql)\n const additionalFilters = getAdditionalFilters(\n searchParams,\n sqlOperator,\n additionalFiltersSessionStorageKey,\n )\n const partMask = SynapseConstants.BUNDLE_MASK_QUERY_RESULTS\n const request: QueryBundleRequest = {\n partMask,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n entityId,\n query: {\n sql,\n additionalFilters,\n selectedFacets,\n },\n }\n\n const queryResultBundle = await SynapseClient.getFullQueryTableResults(\n request,\n accessToken,\n )\n const { queryResult } = queryResultBundle\n if (queryResult?.queryResults.rows) {\n // find the column that has the USER_ID in it.\n const ownerIdColumnIndex = queryResult.queryResults.headers.findIndex(\n el => el.columnType === ColumnTypeEnum.USERID,\n )\n const ids: string[] = queryResult.queryResults.rows\n .map(d => d.values[ownerIdColumnIndex])\n .filter((id): id is string => id !== null)\n if (mounted) {\n const newIds = getDisplayIds(ids, count, storageUidKey)\n setUserIds(newIds)\n if (useQueryResultUserData) {\n setQueryData(queryResultBundle)\n }\n setIsLoading(false)\n }\n } else {\n console.log('UserCardListRotate: Error getting data')\n }\n }\n fetchData()\n\n return () => {\n mounted = false\n }\n }, [sql, selectedFacets, count, accessToken, searchParams, sqlOperator])\n\n return (\n <div className=\"UserCardListRotate\">\n {isLoading && <LoadingUserCardMedium />}\n {!isLoading && userIds.length === 0 && (\n <p className=\"font-italic\">No one was found.</p>\n )}\n {!isLoading && userIds.length > 0 && (\n <UserCardList\n list={userIds}\n size={size}\n rowSet={queryData?.queryResult?.queryResults}\n />\n )}\n {summaryLink && summaryLinkText && (\n <div className=\"UserCardListRotate__summary\">\n <LargeButton color=\"secondary\" variant=\"contained\" href={summaryLink}>\n {summaryLinkText}\n </LargeButton>\n </div>\n )}\n </div>\n )\n}\n\nex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IACA;GACF;EACF,GAEM,IAAoB,MAAM,EAAc,yBAC5C,GACA,CACF,GACM,EAAE,mBAAgB;EACxB,IAAI,GAAa,aAAa,MAAM;GAElC,IAAM,IAAqB,EAAY,aAAa,QAAQ,WAC1D,MAAM,EAAG,eAAe,EAAe,MACzC,GACM,IAAgB,EAAY,aAAa,KAC5C,KAAI,MAAK,EAAE,OAAO,EAAmB,EACrC,QAAQ,MAAqB,MAAO,IAAI;GAC3C,AAAI,MAEF,EADe,EAAc,GAAK,GAAO,CAC9B,CAAM,GACb,KACF,EAAa,CAAiB,GAEhC,EAAa,EAAK;EAEtB,OACE,QAAQ,IAAI,wCAAwC;CAExD,EACU,SAEG;EACX,IAAU;CACZ,IACC;EAAC;EAAK;EAAgB;EAAO;EAAa;EAAc;CAAW,CAAC,GAGrE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACG,KAAa,kBAAC,GAAD,CAAwB,CAAA;GACrC,CAAC,KAAa,EAAQ,WAAW,KAChC,kBAAC,KAAD;IAAG,WAAU;cAAc;GAAoB,CAAA;GAEhD,CAAC,KAAa,EAAQ,SAAS,KAC9B,kBAAC,GAAD;IACE,MAAM;IACA;IACN,QAAQ,GAAW,aAAa;GACjC,CAAA;GAEF,KAAe,KACd,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KAAa,OAAM;KAAY,SAAQ;KAAY,MAAM;eACtD;IACU,CAAA;GACV,CAAA;EAEJ;;AAET"}
|
|
1
|
+
{"version":3,"file":"UserCardListRotate.js","names":[],"sources":["../../../src/components/UserCardList/UserCardListRotate.tsx"],"sourcesContent":["import LargeButton from '@/components/styled/LargeButton'\nimport SynapseClient from '@/synapse-client'\nimport { KeyFactory } from '@/synapse-queries/KeyFactory'\nimport { tableQueryUseQueryDefaults } from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { getUserProfilesWithProfilePicAttachedQueryOptions } from '@/synapse-queries/user/useUserBundle'\nimport { SynapseConstants } from '@/utils'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport {\n getAdditionalFilters,\n parseEntityIdFromSqlStatement,\n SQLOperator,\n} from '@/utils/functions/SqlFunctions'\nimport { LARGE_USER_CARD, UserCardSize } from '@/utils/SynapseConstants'\nimport {\n ColumnTypeEnum,\n FacetColumnRequest,\n QueryBundleRequest,\n QueryResultBundle,\n} from '@sage-bionetworks/synapse-types'\nimport { QueryClient, useQuery } from '@tanstack/react-query'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { LoadingUserCardMedium } from '../UserCard/UserCardMedium'\nimport UserCardList from './UserCardList'\n\nconst STORED_UID_KEY = 'sage_rotate_uids'\nconst DEFAULT_DISPLAY_COUNT = 3\n\nexport type UserCardListRotateProps = {\n sql: string\n count: number\n useQueryResultUserData?: boolean\n size?: UserCardSize\n summaryLink?: string\n summaryLinkText?: string\n selectedFacets?: FacetColumnRequest[]\n sqlOperator?: SQLOperator\n searchParams?: Record<string, string>\n additionalFiltersSessionStorageKey?: string\n}\n\nexport const getDisplayIds = (\n ids: string[] = [],\n count: number = DEFAULT_DISPLAY_COUNT,\n storageUidKey: string,\n): string[] => {\n // Guard against SSR / Node.js environments where localStorage is unavailable\n if (typeof localStorage === 'undefined') {\n return ids.slice(0, count)\n }\n const storedIdsJson = localStorage.getItem(storageUidKey)\n const seenIds: string[] = storedIdsJson\n ? (JSON.parse(storedIdsJson) as string[])\n : []\n\n if (!seenIds.length) {\n const selected = ids.slice(0, count)\n localStorage.setItem(storageUidKey, JSON.stringify(selected))\n return selected\n }\n\n const seenSet = new Set(seenIds)\n const unseenIds = ids.filter(id => !seenSet.has(id))\n\n if (unseenIds.length >= count) {\n const selected = unseenIds.slice(0, count)\n localStorage.setItem(\n storageUidKey,\n JSON.stringify([...seenIds, ...selected]),\n )\n return selected\n }\n\n // Not enough unseen IDs — reset and cycle back to the beginning\n const fromStart = ids.slice(0, count - unseenIds.length)\n localStorage.setItem(storageUidKey, JSON.stringify(fromStart))\n return [...unseenIds, ...fromStart]\n}\n\nfunction buildRequest(\n sql: string,\n options?: {\n selectedFacets?: FacetColumnRequest[]\n searchParams?: Record<string, string>\n sqlOperator?: SQLOperator\n additionalFiltersSessionStorageKey?: string\n },\n): QueryBundleRequest {\n const entityId = parseEntityIdFromSqlStatement(sql)\n const additionalFilters = getAdditionalFilters(\n options?.searchParams,\n options?.sqlOperator,\n options?.additionalFiltersSessionStorageKey,\n )\n return {\n partMask: SynapseConstants.BUNDLE_MASK_QUERY_RESULTS,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n entityId,\n query: {\n sql,\n additionalFilters,\n selectedFacets: options?.selectedFacets,\n },\n }\n}\n\nfunction extractUserIdsFromBundle(\n bundle: QueryResultBundle | undefined,\n): string[] {\n if (!bundle?.queryResult?.queryResults.rows) return []\n const ownerIdColumnIndex = bundle.queryResult.queryResults.headers.findIndex(\n el => el.columnType === ColumnTypeEnum.USERID,\n )\n if (ownerIdColumnIndex === -1) return []\n return bundle.queryResult.queryResults.rows\n .map(d => d.values[ownerIdColumnIndex])\n .filter((id): id is string => id !== null)\n}\n\nexport function UserCardListRotate({\n sql,\n count,\n useQueryResultUserData = false,\n size = LARGE_USER_CARD,\n summaryLink,\n summaryLinkText,\n selectedFacets,\n searchParams,\n sqlOperator,\n additionalFiltersSessionStorageKey,\n}: UserCardListRotateProps) {\n const { accessToken, keyFactory } = useSynapseContext()\n const storageUidKey = `${STORED_UID_KEY}-${sql}-${JSON.stringify(\n selectedFacets,\n )}`\n\n const request = buildRequest(sql, {\n selectedFacets,\n searchParams,\n sqlOperator,\n additionalFiltersSessionStorageKey,\n })\n\n const { data: queryResultBundle, isPending } = useQuery({\n ...tableQueryUseQueryDefaults,\n queryKey: keyFactory.getFullTableQueryResultQueryKey(request, false),\n queryFn: () => SynapseClient.getFullQueryTableResults(request, accessToken),\n })\n\n const [rotatedShownIds, setRotatedShownIds] = useState<string[]>([])\n const allIds = useMemo(\n () => extractUserIdsFromBundle(queryResultBundle),\n [queryResultBundle],\n )\n\n const firstNIds = allIds.slice(0, count)\n\n // Not ideal to use an effect, but this ensures this is isomorphic for SSG\n // while ensuring a new set of IDs is shown after client rendering takes over.\n const hasMounted = useRef(false)\n useEffect(() => {\n if (!hasMounted.current) {\n hasMounted.current = true\n setRotatedShownIds(getDisplayIds(allIds, count, storageUidKey))\n }\n }, [allIds, count, storageUidKey])\n\n const renderedIds = rotatedShownIds.length > 0 ? rotatedShownIds : firstNIds\n\n return (\n <div className=\"UserCardListRotate\">\n {isPending && <LoadingUserCardMedium />}\n {!isPending && renderedIds.length === 0 && (\n <p className=\"font-italic\">No one was found.</p>\n )}\n {!isPending && renderedIds.length > 0 && (\n <UserCardList\n list={renderedIds}\n size={size}\n rowSet={\n useQueryResultUserData\n ? queryResultBundle?.queryResult?.queryResults\n : undefined\n }\n />\n )}\n {summaryLink && summaryLinkText && (\n <div className=\"UserCardListRotate__summary\">\n <LargeButton color=\"secondary\" variant=\"contained\" href={summaryLink}>\n {summaryLinkText}\n </LargeButton>\n </div>\n )}\n </div>\n )\n}\n\nexport default UserCardListRotate\n\n/**\n * Prefetches the UserCardListRotate table query and the user profiles it\n * references into a QueryClient for use with HydrationBoundary. Uses anonymous\n * access; warm-caches for unauthenticated users.\n */\nexport async function prefetchUserCardListRotate(\n queryClient: QueryClient,\n sql: string,\n options?: {\n selectedFacets?: FacetColumnRequest[]\n searchParams?: Record<string, string>\n sqlOperator?: SQLOperator\n additionalFiltersSessionStorageKey?: string\n count?: number\n },\n): Promise<void> {\n const keyFactory = new KeyFactory(undefined)\n const request = buildRequest(sql, options)\n const queryKey = keyFactory.getFullTableQueryResultQueryKey(request, false)\n await queryClient.prefetchQuery({\n ...tableQueryUseQueryDefaults,\n queryKey,\n queryFn: () => SynapseClient.getFullQueryTableResults(request, undefined),\n })\n\n const queryResultBundle =\n queryClient.getQueryData<QueryResultBundle>(queryKey)\n // During SSR localStorage is unavailable, so getDisplayIds falls back to\n // slice(0, count). Match that here so prefetched profiles cover exactly the\n // IDs the first render will request.\n const principalIds = extractUserIdsFromBundle(queryResultBundle).slice(\n 0,\n options?.count ?? DEFAULT_DISPLAY_COUNT,\n )\n if (principalIds.length > 0) {\n await queryClient.prefetchQuery(\n getUserProfilesWithProfilePicAttachedQueryOptions(principalIds, {\n keyFactory,\n }),\n )\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,IAAM,IAAiB,oBACjB,IAAwB,GAejB,KACX,IAAgB,CAAC,GACjB,IAAgB,GAChB,MACa;CAEb,IAAI,OAAO,eAAiB,KAC1B,OAAO,EAAI,MAAM,GAAG,CAAK;CAE3B,IAAM,IAAgB,aAAa,QAAQ,CAAa,GAClD,IAAoB,IACrB,KAAK,MAAM,CAAa,IACzB,CAAC;CAEL,IAAI,CAAC,EAAQ,QAAQ;EACnB,IAAM,IAAW,EAAI,MAAM,GAAG,CAAK;EAEnC,OADA,aAAa,QAAQ,GAAe,KAAK,UAAU,CAAQ,CAAC,GACrD;CACT;CAEA,IAAM,IAAU,IAAI,IAAI,CAAO,GACzB,IAAY,EAAI,QAAO,MAAM,CAAC,EAAQ,IAAI,CAAE,CAAC;CAEnD,IAAI,EAAU,UAAU,GAAO;EAC7B,IAAM,IAAW,EAAU,MAAM,GAAG,CAAK;EAKzC,OAJA,aAAa,QACX,GACA,KAAK,UAAU,CAAC,GAAG,GAAS,GAAG,CAAQ,CAAC,CAC1C,GACO;CACT;CAGA,IAAM,IAAY,EAAI,MAAM,GAAG,IAAQ,EAAU,MAAM;CAEvD,OADA,aAAa,QAAQ,GAAe,KAAK,UAAU,CAAS,CAAC,GACtD,CAAC,GAAG,GAAW,GAAG,CAAS;AACpC;AAEA,SAAS,EACP,GACA,GAMoB;CAOpB,OAAO;EACL,UAAU;EACV,cAAc;EACd,UATe,EAA8B,CAS7C;EACA,OAAO;GACL;GACA,mBAXsB,EACxB,GAAS,cACT,GAAS,aACT,GAAS,kCAQP;GACA,gBAAgB,GAAS;EAC3B;CACF;AACF;AAEA,SAAS,EACP,GAC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;IACA;IACN,QACE,IACI,GAAmB,aAAa,eAChC,KAAA;GAEP,CAAA;GAEF,KAAe,KACd,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KAAa,OAAM;KAAY,SAAQ;KAAY,MAAM;eACtD;IACU,CAAA;GACV,CAAA;EAEJ;;AAET;AASA,eAAsB,EACpB,GACA,GACA,GAOe;CACf,IAAM,IAAa,IAAI,EAAW,KAAA,CAAS,GACrC,IAAU,EAAa,GAAK,CAAO,GACnC,IAAW,EAAW,gCAAgC,GAAS,EAAK;CAC1E,MAAM,EAAY,cAAc;EAC9B,GAAG;EACH;EACA,eAAe,EAAc,yBAAyB,GAAS,KAAA,CAAS;CAC1E,CAAC;CAOD,IAAM,IAAe,EAJnB,EAAY,aAAgC,CAIA,CAAiB,EAAE,MAC/D,GACA,GAAS,SAAS,CACpB;CACA,AAAI,EAAa,SAAS,KACxB,MAAM,EAAY,cAChB,EAAkD,GAAc,EAC9D,cACF,CAAC,CACH;AAEJ"}
|
|
@@ -11,8 +11,8 @@ var e = "syn60001", t = "syn60000", n = {
|
|
|
11
11
|
}, i = {
|
|
12
12
|
concreteType: "org.sagebionetworks.repo.model.search.table.SearchIndexQuery",
|
|
13
13
|
searchQuery: {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
size: 25,
|
|
15
|
+
from: 0
|
|
16
16
|
}
|
|
17
17
|
}, a = {
|
|
18
18
|
concreteType: "org.sagebionetworks.repo.model.table.QueryResultBundle",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockSearchQueryData.js","names":[],"sources":["../../src/mocks/mockSearchQueryData.ts"],"sourcesContent":["import { QueryResultBundle } from '@sage-bionetworks/synapse-types'\nimport { SearchIndex, SearchIndexQuery } from '@sage-bionetworks/synapse-client'\nimport { MockEntityData } from '@/mocks/entity/MockEntityData'\nimport { Entity } from '@sage-bionetworks/synapse-types'\n\n/** The SearchIndex entity that accepts search API calls and has a definingSql. */\nexport const MOCK_SEARCH_INDEX_ENTITY_ID = 'syn60001'\n/** The underlying Table/View whose schema (column models) backs the search index. */\nexport const MOCK_SEARCH_UNDERLYING_TABLE_ENTITY_ID = 'syn60000'\n\n/** Mock SearchIndex entity whose definingSQL references the underlying table. */\nexport const mockSearchIndexEntity: SearchIndex = {\n id: MOCK_SEARCH_INDEX_ENTITY_ID,\n name: 'Mock Search Index',\n concreteType: 'org.sagebionetworks.repo.model.search.table.SearchIndex',\n definingSQL: `SELECT * FROM ${MOCK_SEARCH_UNDERLYING_TABLE_ENTITY_ID}`,\n}\n\n/** MockEntityData wrapper so the default entity GET handler can serve syn60001. */\nexport const mockSearchIndexEntityData: MockEntityData = {\n id: MOCK_SEARCH_INDEX_ENTITY_ID,\n name: mockSearchIndexEntity.name!,\n entity: mockSearchIndexEntity as unknown as Entity,\n}\n\nexport const mockSearchIndexQuery: SearchIndexQuery = {\n concreteType: 'org.sagebionetworks.repo.model.search.table.SearchIndexQuery',\n searchQuery: {\n limit: 25,\n offset: 0,\n },\n}\n\nexport const mockSearchQueryResultBundle: QueryResultBundle = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryResultBundle',\n queryCount: 53,\n selectColumns: [\n { name: 'mature', columnType: 'STRING' },\n { name: 'acronym', columnType: 'STRING' },\n { name: 'name', columnType: 'STRING' },\n { name: 'category', columnType: 'STRING' },\n { name: 'collections', columnType: 'STRING_LIST' },\n { name: 'topic', columnType: 'STRING_LIST' },\n { name: 'dataTypes', columnType: 'STRING_LIST' },\n { name: 'isOpen', columnType: 'STRING' },\n { name: 'registration', columnType: 'STRING' },\n ],\n columnModels: [\n {\n id: '245711',\n name: 'mature',\n columnType: 'STRING',\n maximumSize: 50,\n facetType: 'enumeration',\n },\n { id: '240032', name: 'acronym', columnType: 'STRING', maximumSize: 100 },\n { id: '244787', name: 'name', columnType: 'STRING', maximumSize: 256 },\n {\n id: '245706',\n name: 'category',\n columnType: 'STRING',\n maximumSize: 100,\n facetType: 'enumeration',\n },\n {\n id: '245526',\n name: 'collections',\n columnType: 'STRING_LIST',\n maximumListLength: 100,\n facetType: 'enumeration',\n },\n {\n id: '243320',\n name: 'topic',\n columnType: 'STRING_LIST',\n maximumListLength: 100,\n facetType: 'enumeration',\n },\n {\n id: '240611',\n name: 'dataTypes',\n columnType: 'STRING_LIST',\n maximumListLength: 100,\n facetType: 'enumeration',\n },\n {\n id: '245712',\n name: 'isOpen',\n columnType: 'STRING',\n maximumSize: 10,\n facetType: 'enumeration',\n },\n {\n id: '245713',\n name: 'registration',\n columnType: 'STRING',\n maximumSize: 10,\n facetType: 'enumeration',\n },\n ],\n facets: [\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'collections',\n facetType: 'enumeration',\n facetValues: [\n { value: 'Machine Learning Framework', count: 11, isSelected: false },\n { value: 'File Format', count: 8, isSelected: false },\n { value: 'OBO Foundry', count: 6, isSelected: false },\n {\n value: 'Implementation Maturity Production',\n count: 5,\n isSelected: false,\n },\n {\n value: 'Standards Process Maturity Final',\n count: 4,\n isSelected: false,\n },\n { value: 'Cloud Platform', count: 3, isSelected: false },\n { value: 'Graph Data Platform', count: 3, isSelected: false },\n { value: 'Notebook Platform', count: 3, isSelected: false },\n { value: 'Cloud Service', count: 1, isSelected: false },\n { value: 'Data Model', count: 1, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'category',\n facetType: 'enumeration',\n facetValues: [\n { value: 'Software or Tool', count: 33, isSelected: false },\n { value: 'Biomedical Standard', count: 8, isSelected: false },\n { value: 'Ontology or Vocabulary', count: 8, isSelected: false },\n { value: 'Data Standard', count: 2, isSelected: false },\n { value: 'Training Program', count: 2, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'topic',\n facetType: 'enumeration',\n facetValues: [\n { value: 'Data', count: 27, isSelected: false },\n { value: 'Genome', count: 6, isSelected: false },\n { value: 'Clinical Observations', count: 4, isSelected: false },\n { value: 'Image', count: 3, isSelected: false },\n { value: 'Networks And Pathways', count: 3, isSelected: false },\n { value: 'EHR', count: 2, isSelected: false },\n { value: 'Gene', count: 2, isSelected: false },\n { value: 'Training', count: 2, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'dataTypes',\n facetType: 'enumeration',\n facetValues: [\n { value: 'PyTorch Tensor', count: 3, isSelected: false },\n { value: 'Array', count: 2, isSelected: false },\n { value: 'Database', count: 2, isSelected: false },\n { value: 'Graph', count: 2, isSelected: false },\n { value: 'Graph Database', count: 2, isSelected: false },\n { value: 'BED', count: 1, isSelected: false },\n { value: 'DICOM', count: 1, isSelected: false },\n { value: 'Neo4j', count: 1, isSelected: false },\n { value: 'ONNX', count: 1, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'isOpen',\n facetType: 'enumeration',\n facetValues: [\n { value: 'Yes', count: 50, isSelected: false },\n { value: 'No', count: 3, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'mature',\n facetType: 'enumeration',\n facetValues: [\n { value: 'Is Not Mature', count: 48, isSelected: false },\n { value: 'Is Mature', count: 5, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'registration',\n facetType: 'enumeration',\n facetValues: [\n { value: 'No', count: 44, isSelected: false },\n { value: 'Yes', count: 9, isSelected: false },\n ],\n },\n ],\n queryResult: {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryResult',\n queryResults: {\n concreteType: 'org.sagebionetworks.repo.model.table.RowSet',\n tableId: MOCK_SEARCH_INDEX_ENTITY_ID,\n etag: 'search-mock-etag',\n headers: [\n { name: 'mature', columnType: 'STRING', id: '245711' },\n { name: 'acronym', columnType: 'STRING', id: '240032' },\n { name: 'name', columnType: 'STRING', id: '244787' },\n { name: 'category', columnType: 'STRING', id: '245706' },\n { name: 'collections', columnType: 'STRING_LIST', id: '245526' },\n { name: 'topic', columnType: 'STRING_LIST', id: '243320' },\n { name: 'dataTypes', columnType: 'STRING_LIST', id: '240611' },\n { name: 'isOpen', columnType: 'STRING', id: '245712' },\n { name: 'registration', columnType: 'STRING', id: '245713' },\n ],\n rows: [\n {\n rowId: 1,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'PyTorch',\n 'PyTorch',\n 'Software or Tool',\n '[\"Machine Learning Framework\"]',\n '[\"Data\"]',\n '[\"PyTorch Tensor\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 2,\n versionNumber: 1,\n values: [\n 'Is Mature',\n 'TF',\n 'TensorFlow',\n 'Software or Tool',\n '[\"Machine Learning Framework\"]',\n '[\"Data\"]',\n '[\"Tensor\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 3,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'HDF5',\n 'Hierarchical Data Format 5',\n 'Data Standard',\n '[\"File Format\"]',\n '[\"Data\"]',\n '[\"Array\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 4,\n versionNumber: 1,\n values: [\n 'Is Mature',\n 'DICOM',\n 'Digital Imaging and Communications in Medicine',\n 'Biomedical Standard',\n '[\"File Format\"]',\n '[\"Image\"]',\n '[\"DICOM\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 5,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'Neo4j',\n 'Neo4j Graph Database',\n 'Software or Tool',\n '[\"Graph Data Platform\"]',\n '[\"Data\"]',\n '[\"Neo4j\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 6,\n versionNumber: 1,\n values: [\n 'Is Mature',\n 'GO',\n 'Gene Ontology',\n 'Ontology or Vocabulary',\n '[\"OBO Foundry\"]',\n '[\"Gene\"]',\n null,\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 7,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'ONNX',\n 'Open Neural Network Exchange',\n 'Data Standard',\n '[\"Machine Learning Framework\"]',\n '[\"Data\"]',\n '[\"ONNX\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 8,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'Jupyter',\n 'JupyterHub',\n 'Software or Tool',\n '[\"Notebook Platform\"]',\n '[\"Training\"]',\n null,\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 9,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'AWS',\n 'Amazon Web Services',\n 'Software or Tool',\n '[\"Cloud Platform\"]',\n '[\"Data\"]',\n null,\n 'Yes',\n 'Yes',\n ],\n },\n {\n rowId: 10,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'HPO',\n 'Human Phenotype Ontology',\n 'Ontology or Vocabulary',\n '[\"OBO Foundry\"]',\n '[\"Clinical Observations\"]',\n null,\n 'Yes',\n 'No',\n ],\n },\n ],\n },\n },\n}\n"],"mappings":";AAMA,IAAa,IAA8B,YAE9B,IAAyC,YAGzC,IAAqC;CAChD,IAAI;CACJ,MAAM;CACN,cAAc;CACd,aAAa,iBAAiB;AAChC,GAGa,IAA4C;CACvD,IAAI;CACJ,MAAM,EAAsB;CAC5B,QAAQ;AACV,GAEa,IAAyC;CACpD,cAAc;CACd,aAAa;EACX,OAAO;EACP,QAAQ;CACV;AACF,GAEa,IAAiD;CAC5D,cAAc;CACd,YAAY;CACZ,eAAe;EACb;GAAE,MAAM;GAAU,YAAY;EAAS;EACvC;GAAE,MAAM;GAAW,YAAY;EAAS;EACxC;GAAE,MAAM;GAAQ,YAAY;EAAS;EACrC;GAAE,MAAM;GAAY,YAAY;EAAS;EACzC;GAAE,MAAM;GAAe,YAAY;EAAc;EACjD;GAAE,MAAM;GAAS,YAAY;EAAc;EAC3C;GAAE,MAAM;GAAa,YAAY;EAAc;EAC/C;GAAE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AAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;GACF;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"mockSearchQueryData.js","names":[],"sources":["../../src/mocks/mockSearchQueryData.ts"],"sourcesContent":["import { QueryResultBundle } from '@sage-bionetworks/synapse-types'\nimport { SearchIndex, SearchIndexQuery } from '@sage-bionetworks/synapse-client'\nimport { MockEntityData } from '@/mocks/entity/MockEntityData'\nimport { Entity } from '@sage-bionetworks/synapse-types'\n\n/** The SearchIndex entity that accepts search API calls and has a definingSql. */\nexport const MOCK_SEARCH_INDEX_ENTITY_ID = 'syn60001'\n/** The underlying Table/View whose schema (column models) backs the search index. */\nexport const MOCK_SEARCH_UNDERLYING_TABLE_ENTITY_ID = 'syn60000'\n\n/** Mock SearchIndex entity whose definingSQL references the underlying table. */\nexport const mockSearchIndexEntity: SearchIndex = {\n id: MOCK_SEARCH_INDEX_ENTITY_ID,\n name: 'Mock Search Index',\n concreteType: 'org.sagebionetworks.repo.model.search.table.SearchIndex',\n definingSQL: `SELECT * FROM ${MOCK_SEARCH_UNDERLYING_TABLE_ENTITY_ID}`,\n}\n\n/** MockEntityData wrapper so the default entity GET handler can serve syn60001. */\nexport const mockSearchIndexEntityData: MockEntityData = {\n id: MOCK_SEARCH_INDEX_ENTITY_ID,\n name: mockSearchIndexEntity.name!,\n entity: mockSearchIndexEntity as unknown as Entity,\n}\n\nexport const mockSearchIndexQuery: SearchIndexQuery = {\n concreteType: 'org.sagebionetworks.repo.model.search.table.SearchIndexQuery',\n searchQuery: {\n size: 25,\n from: 0,\n },\n}\n\nexport const mockSearchQueryResultBundle: QueryResultBundle = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryResultBundle',\n queryCount: 53,\n selectColumns: [\n { name: 'mature', columnType: 'STRING' },\n { name: 'acronym', columnType: 'STRING' },\n { name: 'name', columnType: 'STRING' },\n { name: 'category', columnType: 'STRING' },\n { name: 'collections', columnType: 'STRING_LIST' },\n { name: 'topic', columnType: 'STRING_LIST' },\n { name: 'dataTypes', columnType: 'STRING_LIST' },\n { name: 'isOpen', columnType: 'STRING' },\n { name: 'registration', columnType: 'STRING' },\n ],\n columnModels: [\n {\n id: '245711',\n name: 'mature',\n columnType: 'STRING',\n maximumSize: 50,\n facetType: 'enumeration',\n },\n { id: '240032', name: 'acronym', columnType: 'STRING', maximumSize: 100 },\n { id: '244787', name: 'name', columnType: 'STRING', maximumSize: 256 },\n {\n id: '245706',\n name: 'category',\n columnType: 'STRING',\n maximumSize: 100,\n facetType: 'enumeration',\n },\n {\n id: '245526',\n name: 'collections',\n columnType: 'STRING_LIST',\n maximumListLength: 100,\n facetType: 'enumeration',\n },\n {\n id: '243320',\n name: 'topic',\n columnType: 'STRING_LIST',\n maximumListLength: 100,\n facetType: 'enumeration',\n },\n {\n id: '240611',\n name: 'dataTypes',\n columnType: 'STRING_LIST',\n maximumListLength: 100,\n facetType: 'enumeration',\n },\n {\n id: '245712',\n name: 'isOpen',\n columnType: 'STRING',\n maximumSize: 10,\n facetType: 'enumeration',\n },\n {\n id: '245713',\n name: 'registration',\n columnType: 'STRING',\n maximumSize: 10,\n facetType: 'enumeration',\n },\n ],\n facets: [\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'collections',\n facetType: 'enumeration',\n facetValues: [\n { value: 'Machine Learning Framework', count: 11, isSelected: false },\n { value: 'File Format', count: 8, isSelected: false },\n { value: 'OBO Foundry', count: 6, isSelected: false },\n {\n value: 'Implementation Maturity Production',\n count: 5,\n isSelected: false,\n },\n {\n value: 'Standards Process Maturity Final',\n count: 4,\n isSelected: false,\n },\n { value: 'Cloud Platform', count: 3, isSelected: false },\n { value: 'Graph Data Platform', count: 3, isSelected: false },\n { value: 'Notebook Platform', count: 3, isSelected: false },\n { value: 'Cloud Service', count: 1, isSelected: false },\n { value: 'Data Model', count: 1, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'category',\n facetType: 'enumeration',\n facetValues: [\n { value: 'Software or Tool', count: 33, isSelected: false },\n { value: 'Biomedical Standard', count: 8, isSelected: false },\n { value: 'Ontology or Vocabulary', count: 8, isSelected: false },\n { value: 'Data Standard', count: 2, isSelected: false },\n { value: 'Training Program', count: 2, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'topic',\n facetType: 'enumeration',\n facetValues: [\n { value: 'Data', count: 27, isSelected: false },\n { value: 'Genome', count: 6, isSelected: false },\n { value: 'Clinical Observations', count: 4, isSelected: false },\n { value: 'Image', count: 3, isSelected: false },\n { value: 'Networks And Pathways', count: 3, isSelected: false },\n { value: 'EHR', count: 2, isSelected: false },\n { value: 'Gene', count: 2, isSelected: false },\n { value: 'Training', count: 2, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'dataTypes',\n facetType: 'enumeration',\n facetValues: [\n { value: 'PyTorch Tensor', count: 3, isSelected: false },\n { value: 'Array', count: 2, isSelected: false },\n { value: 'Database', count: 2, isSelected: false },\n { value: 'Graph', count: 2, isSelected: false },\n { value: 'Graph Database', count: 2, isSelected: false },\n { value: 'BED', count: 1, isSelected: false },\n { value: 'DICOM', count: 1, isSelected: false },\n { value: 'Neo4j', count: 1, isSelected: false },\n { value: 'ONNX', count: 1, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'isOpen',\n facetType: 'enumeration',\n facetValues: [\n { value: 'Yes', count: 50, isSelected: false },\n { value: 'No', count: 3, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'mature',\n facetType: 'enumeration',\n facetValues: [\n { value: 'Is Not Mature', count: 48, isSelected: false },\n { value: 'Is Mature', count: 5, isSelected: false },\n ],\n },\n {\n concreteType:\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n columnName: 'registration',\n facetType: 'enumeration',\n facetValues: [\n { value: 'No', count: 44, isSelected: false },\n { value: 'Yes', count: 9, isSelected: false },\n ],\n },\n ],\n queryResult: {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryResult',\n queryResults: {\n concreteType: 'org.sagebionetworks.repo.model.table.RowSet',\n tableId: MOCK_SEARCH_INDEX_ENTITY_ID,\n etag: 'search-mock-etag',\n headers: [\n { name: 'mature', columnType: 'STRING', id: '245711' },\n { name: 'acronym', columnType: 'STRING', id: '240032' },\n { name: 'name', columnType: 'STRING', id: '244787' },\n { name: 'category', columnType: 'STRING', id: '245706' },\n { name: 'collections', columnType: 'STRING_LIST', id: '245526' },\n { name: 'topic', columnType: 'STRING_LIST', id: '243320' },\n { name: 'dataTypes', columnType: 'STRING_LIST', id: '240611' },\n { name: 'isOpen', columnType: 'STRING', id: '245712' },\n { name: 'registration', columnType: 'STRING', id: '245713' },\n ],\n rows: [\n {\n rowId: 1,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'PyTorch',\n 'PyTorch',\n 'Software or Tool',\n '[\"Machine Learning Framework\"]',\n '[\"Data\"]',\n '[\"PyTorch Tensor\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 2,\n versionNumber: 1,\n values: [\n 'Is Mature',\n 'TF',\n 'TensorFlow',\n 'Software or Tool',\n '[\"Machine Learning Framework\"]',\n '[\"Data\"]',\n '[\"Tensor\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 3,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'HDF5',\n 'Hierarchical Data Format 5',\n 'Data Standard',\n '[\"File Format\"]',\n '[\"Data\"]',\n '[\"Array\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 4,\n versionNumber: 1,\n values: [\n 'Is Mature',\n 'DICOM',\n 'Digital Imaging and Communications in Medicine',\n 'Biomedical Standard',\n '[\"File Format\"]',\n '[\"Image\"]',\n '[\"DICOM\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 5,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'Neo4j',\n 'Neo4j Graph Database',\n 'Software or Tool',\n '[\"Graph Data Platform\"]',\n '[\"Data\"]',\n '[\"Neo4j\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 6,\n versionNumber: 1,\n values: [\n 'Is Mature',\n 'GO',\n 'Gene Ontology',\n 'Ontology or Vocabulary',\n '[\"OBO Foundry\"]',\n '[\"Gene\"]',\n null,\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 7,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'ONNX',\n 'Open Neural Network Exchange',\n 'Data Standard',\n '[\"Machine Learning Framework\"]',\n '[\"Data\"]',\n '[\"ONNX\"]',\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 8,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'Jupyter',\n 'JupyterHub',\n 'Software or Tool',\n '[\"Notebook Platform\"]',\n '[\"Training\"]',\n null,\n 'Yes',\n 'No',\n ],\n },\n {\n rowId: 9,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'AWS',\n 'Amazon Web Services',\n 'Software or Tool',\n '[\"Cloud Platform\"]',\n '[\"Data\"]',\n null,\n 'Yes',\n 'Yes',\n ],\n },\n {\n rowId: 10,\n versionNumber: 1,\n values: [\n 'Is Not Mature',\n 'HPO',\n 'Human Phenotype Ontology',\n 'Ontology or Vocabulary',\n '[\"OBO Foundry\"]',\n '[\"Clinical Observations\"]',\n null,\n 'Yes',\n 'No',\n ],\n },\n ],\n },\n },\n}\n"],"mappings":";AAMA,IAAa,IAA8B,YAE9B,IAAyC,YAGzC,IAAqC;CAChD,IAAI;CACJ,MAAM;CACN,cAAc;CACd,aAAa,iBAAiB;AAChC,GAGa,IAA4C;CACvD,IAAI;CACJ,MAAM,EAAsB;CAC5B,QAAQ;AACV,GAEa,IAAyC;CACpD,cAAc;CACd,aAAa;EACX,MAAM;EACN,MAAM;CACR;AACF,GAEa,IAAiD;CAC5D,cAAc;CACd,YAAY;CACZ,eAAe;EACb;GAAE,MAAM;GAAU,YAAY;EAAS;EACvC;GAAE,MAAM;GAAW,YAAY;EAAS;EACxC;GAAE,MAAM;GAAQ,YAAY;EAAS;EACrC;GAAE,MAAM;GAAY,YAAY;EAAS;EACzC;GAAE,MAAM;GAAe,YAAY;EAAc;EACjD;GAAE,MAAM;GAAS,YAAY;EAAc;EAC3C;GAAE,MAAM;GAAa,YAAY;EAAc;EAC/C;GAAE,MAAM;GAAU,YAAY;EAAS;EACvC;GAAE,MAAM;GAAgB,YAAY;EAAS;CAC/C;CACA,cAAc;EACZ;GACE,IAAI;GACJ,MAAM;GACN,YAAY;GACZ,aAAa;GACb,WAAW;EACb;EACA;GAAE,IAAI;GAAU,MAAM;GAAW,YAAY;GAAU,aA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;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;IACA;KACE,OAAO;KACP,eAAe;KACf,QAAQ;MACN;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;KACF;IACF;GACF;EACF;CACF;AACF"}
|
|
@@ -6,7 +6,7 @@ import { HttpHandler } from 'msw';
|
|
|
6
6
|
* Used to match registered bindings against incoming requests.
|
|
7
7
|
*/
|
|
8
8
|
type SearchIndexQueryKey = Omit<SearchIndexQuery, 'searchQuery'> & {
|
|
9
|
-
searchQuery?: Omit<SearchSearchQuery, '
|
|
9
|
+
searchQuery?: Omit<SearchSearchQuery, 'size' | 'from'>;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Register a specific query binding for the mock search service.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchQueryHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/searchQueryHandlers.ts"],"names":[],"mappings":"AAQA,OAAO,
|
|
1
|
+
{"version":3,"file":"searchQueryHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/searchQueryHandlers.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,iBAAiB,EAClB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACL,gBAAgB,EAEhB,iBAAiB,EAClB,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAKjC;;;GAGG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,GAAG;IACjE,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;CACvD,CAAA;AAwCD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,iBAAiB,QAQ1B;AAmED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,aAAa,SAAoD,GAChE,WAAW,EAAE,CAOf"}
|
|
@@ -14,7 +14,7 @@ function l(e, t = 25, n = 0) {
|
|
|
14
14
|
return r.queryResult?.queryResults.rows && (r.queryResult.queryResults.rows = r.queryResult.queryResults.rows.slice(n, n + t)), r;
|
|
15
15
|
}
|
|
16
16
|
function u(e, t) {
|
|
17
|
-
return l(t, e.searchQuery?.
|
|
17
|
+
return l(t, e.searchQuery?.size, e.searchQuery?.from);
|
|
18
18
|
}
|
|
19
19
|
function d(e, t) {
|
|
20
20
|
let n = c.getOneByField("queryKey", e);
|
|
@@ -28,7 +28,7 @@ function d(e, t) {
|
|
|
28
28
|
}
|
|
29
29
|
function f(e) {
|
|
30
30
|
let t = s(e);
|
|
31
|
-
t.searchQuery && (delete t.searchQuery.
|
|
31
|
+
t.searchQuery && (delete t.searchQuery.size, delete t.searchQuery.from);
|
|
32
32
|
let n = t;
|
|
33
33
|
return u(e, c.getOneByField("queryKey", n)?.result ?? i);
|
|
34
34
|
}
|
|
@@ -50,7 +50,10 @@ function p(e) {
|
|
|
50
50
|
totalHits: e.queryCount,
|
|
51
51
|
hits: n,
|
|
52
52
|
selectColumns: r,
|
|
53
|
-
|
|
53
|
+
aggregationResults: Object.fromEntries((e.facets ?? []).filter((e) => e.concreteType === "org.sagebionetworks.repo.model.table.FacetColumnResultValues").map((e) => [e.columnName, { buckets: (e.facetValues ?? []).map((e) => ({
|
|
54
|
+
key: e.value,
|
|
55
|
+
doc_count: e.count
|
|
56
|
+
})) }])),
|
|
54
57
|
offset: e.queryResult?.queryResults.rows?.length ? 0 : void 0
|
|
55
58
|
};
|
|
56
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchQueryHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/searchQueryHandlers.ts"],"sourcesContent":["import {\n SEARCH_QUERY_ASYNC_GET,\n SEARCH_QUERY_ASYNC_START,\n} from '@/utils/APIConstants'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n} from '@/utils/functions/getEndpoint'\nimport {
|
|
1
|
+
{"version":3,"file":"searchQueryHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/searchQueryHandlers.ts"],"sourcesContent":["import {\n SEARCH_QUERY_ASYNC_GET,\n SEARCH_QUERY_ASYNC_START,\n} from '@/utils/APIConstants'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n} from '@/utils/functions/getEndpoint'\nimport {\n FacetColumnResultValues,\n QueryResultBundle,\n} from '@sage-bionetworks/synapse-types'\nimport {\n SearchIndexQuery,\n SearchQueryResults,\n SearchSearchQuery,\n} from '@sage-bionetworks/synapse-client'\nimport { cloneDeep } from 'lodash-es'\nimport { HttpHandler } from 'msw'\nimport { generateAsyncJobHandlers } from './asyncJobHandlers'\nimport { mockSearchQueryResultBundle } from '@/mocks/mockSearchQueryData'\nimport BasicMockedCrudService from '../util/BasicMockedCrudService'\n\n/**\n * A key derived from a SearchIndexQuery, excluding pagination fields.\n * Used to match registered bindings against incoming requests.\n */\ntype SearchIndexQueryKey = Omit<SearchIndexQuery, 'searchQuery'> & {\n searchQuery?: Omit<SearchSearchQuery, 'size' | 'from'>\n}\n\ntype SearchQueryBinding = {\n id: string\n queryKey: SearchIndexQueryKey\n result: QueryResultBundle\n}\n\nconst mockSearchQueryService = new BasicMockedCrudService<\n SearchQueryBinding,\n 'id'\n>({\n idField: 'id',\n autoGenerateId: true,\n})\n\nfunction applyLimitOffset(\n bundle: QueryResultBundle,\n limit = 25,\n offset = 0,\n): QueryResultBundle {\n const result = cloneDeep(bundle)\n if (result.queryResult?.queryResults.rows) {\n result.queryResult.queryResults.rows =\n result.queryResult.queryResults.rows.slice(offset, offset + limit)\n }\n return result\n}\n\nfunction processSearchRequest(\n request: SearchIndexQuery,\n baseBundle: QueryResultBundle,\n): QueryResultBundle {\n return applyLimitOffset(\n baseBundle,\n request.searchQuery?.size,\n request.searchQuery?.from,\n )\n}\n\n/**\n * Register a specific query binding for the mock search service.\n * If a binding for the same query key (ignoring limit/offset) already exists, it is updated.\n */\nexport function registerSearchQueryResult(\n queryKey: SearchIndexQueryKey,\n result: QueryResultBundle,\n) {\n const existing = mockSearchQueryService.getOneByField('queryKey', queryKey)\n if (existing) {\n mockSearchQueryService.update(existing.id, { ...existing, result })\n } else {\n mockSearchQueryService.create({ queryKey, result })\n }\n}\n\nfunction getSearchQueryResult(request: SearchIndexQuery): QueryResultBundle {\n const requestCopy = cloneDeep(request)\n if (requestCopy.searchQuery) {\n delete requestCopy.searchQuery.size\n delete requestCopy.searchQuery.from\n }\n const queryKey = requestCopy as SearchIndexQueryKey\n\n const binding = mockSearchQueryService.getOneByField('queryKey', queryKey)\n const baseBundle = binding?.result ?? mockSearchQueryResultBundle\n\n return processSearchRequest(request, baseBundle)\n}\n\n/**\n * Adapts the QueryResultBundle mock result into the SearchQueryResults shape\n * that the real SearchQueryServicesApi returns.\n */\nfunction toSearchQueryResults(bundle: QueryResultBundle): SearchQueryResults {\n const headers = bundle.queryResult?.queryResults.headers ?? []\n\n const hits = (bundle.queryResult?.queryResults.rows ?? []).map(row => ({\n rowId: row.rowId,\n rowVersion: row.versionNumber,\n fields: headers.map((header, i) => ({\n name: header.name,\n value: row.values[i] ?? undefined,\n })),\n }))\n\n const selectColumns = headers.map(header => ({\n name: header.name,\n columnType: header.columnType,\n id: header.id,\n }))\n\n return {\n concreteType:\n 'org.sagebionetworks.repo.model.search.SearchQueryResults' as const,\n totalHits: bundle.queryCount,\n hits,\n selectColumns,\n // Convert FacetColumnResultValues[] → aggregationResults (OpenSearch terms agg shape)\n // so that searchQueryResultsToQueryResultBundle can parse facet data from mock responses.\n aggregationResults: Object.fromEntries(\n (bundle.facets ?? [])\n .filter(\n (f): f is FacetColumnResultValues =>\n f.concreteType ===\n 'org.sagebionetworks.repo.model.table.FacetColumnResultValues',\n )\n .map(f => [\n f.columnName,\n {\n buckets: (f.facetValues ?? []).map(fv => ({\n key: fv.value,\n doc_count: fv.count,\n })),\n },\n ]),\n ),\n offset: bundle.queryResult?.queryResults.rows?.length ? 0 : undefined,\n }\n}\n\n/**\n * Returns MSW handlers for the SearchQueryServicesApi endpoints.\n * Uses the default mock data from mockSearchQueryData.ts unless overridden via registerSearchQueryResult().\n */\nexport function getHandlersForSearchQuery(\n backendOrigin = getEndpoint(BackendDestinationEnum.REPO_ENDPOINT),\n): HttpHandler[] {\n return generateAsyncJobHandlers<SearchIndexQuery, SearchQueryResults>(\n SEARCH_QUERY_ASYNC_START,\n tokenParam => SEARCH_QUERY_ASYNC_GET(tokenParam),\n request => toSearchQueryResults(getSearchQueryResult(request)),\n backendOrigin,\n )\n}\n"],"mappings":";;;;;;;AAqCA,IAAM,IAAyB,IAAI,EAGjC;CACA,SAAS;CACT,gBAAgB;AAClB,CAAC;AAED,SAAS,EACP,GACA,IAAQ,IACR,IAAS,GACU;CACnB,IAAM,IAAS,EAAU,CAAM;CAK/B,OAJI,EAAO,aAAa,aAAa,SACnC,EAAO,YAAY,aAAa,OAC9B,EAAO,YAAY,aAAa,KAAK,MAAM,GAAQ,IAAS,CAAK,IAE9D;AACT;AAEA,SAAS,EACP,GACA,GACmB;CACnB,OAAO,EACL,GACA,EAAQ,aAAa,MACrB,EAAQ,aAAa,IACvB;AACF;AAMA,SAAgB,EACd,GACA,GACA;CACA,IAAM,IAAW,EAAuB,cAAc,YAAY,CAAQ;CAC1E,AAAI,IACF,EAAuB,OAA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
1
|
declare const queryResultBundle: {
|
|
2
2
|
concreteType: "org.sagebionetworks.repo.model.table.QueryResultBundle";
|
|
3
|
+
columnModels: ({
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
columnType: "STRING";
|
|
7
|
+
} | {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
columnType: "USERID";
|
|
11
|
+
} | {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
columnType: "STRING_LIST";
|
|
15
|
+
})[];
|
|
3
16
|
queryResult: {
|
|
4
17
|
concreteType: "org.sagebionetworks.repo.model.table.QueryResult";
|
|
5
18
|
queryResults: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockUserCardTableQueryResultBundle.d.ts","sourceRoot":"","sources":["../../../src/mocks/query/mockUserCardTableQueryResultBundle.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"mockUserCardTableQueryResultBundle.d.ts","sourceRoot":"","sources":["../../../src/mocks/query/mockUserCardTableQueryResultBundle.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoEM,CAAA;AAE7B,eAAe,iBAAiB,CAAA"}
|
|
@@ -2,6 +2,33 @@ import "../user/mock_user_profile.js";
|
|
|
2
2
|
//#region src/mocks/query/mockUserCardTableQueryResultBundle.ts
|
|
3
3
|
var e = {
|
|
4
4
|
concreteType: "org.sagebionetworks.repo.model.table.QueryResultBundle",
|
|
5
|
+
columnModels: [
|
|
6
|
+
{
|
|
7
|
+
id: "124219",
|
|
8
|
+
name: "firstName",
|
|
9
|
+
columnType: "STRING"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "124220",
|
|
13
|
+
name: "lastName",
|
|
14
|
+
columnType: "STRING"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "124221",
|
|
18
|
+
name: "institution",
|
|
19
|
+
columnType: "STRING"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "124214",
|
|
23
|
+
name: "ownerID",
|
|
24
|
+
columnType: "USERID"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "151844",
|
|
28
|
+
name: "Program",
|
|
29
|
+
columnType: "STRING_LIST"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
5
32
|
queryResult: {
|
|
6
33
|
concreteType: "org.sagebionetworks.repo.model.table.QueryResult",
|
|
7
34
|
queryResults: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockUserCardTableQueryResultBundle.js","names":[],"sources":["../../../src/mocks/query/mockUserCardTableQueryResultBundle.ts"],"sourcesContent":["import { QueryResultBundle } from '@sage-bionetworks/synapse-types'\nimport { MOCK_USER_ID } from '../user/mock_user_profile'\n\nconst queryResultBundle = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryResultBundle',\n queryResult: {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryResult',\n queryResults: {\n concreteType: 'org.sagebionetworks.repo.model.table.RowSet',\n tableId: 'syn13897207',\n etag: '593afe35-0e97-436d-b7f3-ad00289b0ac0',\n headers: [\n {\n name: 'firstName',\n columnType: 'STRING',\n id: '124219',\n },\n {\n name: 'lastName',\n columnType: 'STRING',\n id: '124220',\n },\n {\n name: 'institution',\n columnType: 'STRING',\n id: '124221',\n },\n {\n name: 'ownerID',\n columnType: 'USERID',\n id: '124214',\n },\n {\n name: 'Program',\n columnType: 'STRING_LIST',\n id: '151844',\n },\n ],\n rows: [\n {\n rowId: 262,\n versionNumber: 406,\n values: [\n 'John',\n 'Doe',\n 'Sage Bionetworks',\n MOCK_USER_ID.toString(),\n '[\"My-program\"]',\n ],\n },\n {\n rowId: 508,\n versionNumber: 541,\n values: [\n 'FakeFirst',\n 'FakeLast',\n 'Fake institution',\n null,\n '[\"Extra-data\"]',\n ],\n },\n ],\n },\n },\n} satisfies QueryResultBundle\n\nexport default queryResultBundle\n"],"mappings":";;AAGA,IAAM,IAAoB;CACxB,cAAc;CACd,aAAa;EACX,cAAc;EACd,cAAc;GACZ,cAAc;GACd,SAAS;GACT,MAAM;GACN,SAAS;IACP;KACE,MAAM;KACN,YAAY;KACZ,IAAI;IACN;IACA;KACE,MAAM;KACN,YAAY;KACZ,IAAI;IACN;IACA;KACE,MAAM;KACN,YAAY;KACZ,IAAI;IACN;IACA;KACE,MAAM;KACN,YAAY;KACZ,IAAI;IACN;IACA;KACE,MAAM;KACN,YAAY;KACZ,IAAI;IACN;GACF;GACA,MAAM,CACJ;IACE,OAAO;IACP,eAAe;IACf,QAAQ;KACN;KACA;KACA;;KAEA;IACF;GACF,GACA;IACE,OAAO;IACP,eAAe;IACf,QAAQ;KACN;KACA;KACA;KACA;KACA;IACF;GACF,CACF;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"mockUserCardTableQueryResultBundle.js","names":[],"sources":["../../../src/mocks/query/mockUserCardTableQueryResultBundle.ts"],"sourcesContent":["import { QueryResultBundle } from '@sage-bionetworks/synapse-types'\nimport { MOCK_USER_ID } from '../user/mock_user_profile'\n\nconst queryResultBundle = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryResultBundle',\n columnModels: [\n { id: '124219', name: 'firstName', columnType: 'STRING' },\n { id: '124220', name: 'lastName', columnType: 'STRING' },\n { id: '124221', name: 'institution', columnType: 'STRING' },\n { id: '124214', name: 'ownerID', columnType: 'USERID' },\n { id: '151844', name: 'Program', columnType: 'STRING_LIST' },\n ],\n queryResult: {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryResult',\n queryResults: {\n concreteType: 'org.sagebionetworks.repo.model.table.RowSet',\n tableId: 'syn13897207',\n etag: '593afe35-0e97-436d-b7f3-ad00289b0ac0',\n headers: [\n {\n name: 'firstName',\n columnType: 'STRING',\n id: '124219',\n },\n {\n name: 'lastName',\n columnType: 'STRING',\n id: '124220',\n },\n {\n name: 'institution',\n columnType: 'STRING',\n id: '124221',\n },\n {\n name: 'ownerID',\n columnType: 'USERID',\n id: '124214',\n },\n {\n name: 'Program',\n columnType: 'STRING_LIST',\n id: '151844',\n },\n ],\n rows: [\n {\n rowId: 262,\n versionNumber: 406,\n values: [\n 'John',\n 'Doe',\n 'Sage Bionetworks',\n MOCK_USER_ID.toString(),\n '[\"My-program\"]',\n ],\n },\n {\n rowId: 508,\n versionNumber: 541,\n values: [\n 'FakeFirst',\n 'FakeLast',\n 'Fake institution',\n null,\n '[\"Extra-data\"]',\n ],\n },\n ],\n },\n },\n} satisfies QueryResultBundle\n\nexport default queryResultBundle\n"],"mappings":";;AAGA,IAAM,IAAoB;CACxB,cAAc;CACd,cAAc;EACZ;GAAE,IAAI;GAAU,MAAM;GAAa,YAAY;EAAS;EACxD;GAAE,IAAI;GAAU,MAAM;GAAY,YAAY;EAAS;EACvD;GAAE,IAAI;GAAU,MAAM;GAAe,YAAY;EAAS;EAC1D;GAAE,IAAI;GAAU,MAAM;GAAW,YAAY;EAAS;EACtD;GAAE,IAAI;GAAU,MAAM;GAAW,YAAY;EAAc;CAC7D;CACA,aAAa;EACX,cAAc;EACd,cAAc;GACZ,cAAc;GACd,SAAS;GACT,MAAM;GACN,SAAS;IACP;KACE,MAAM;KACN,YAAY;KACZ,IAAI;IACN;IACA;KACE,MAAM;KACN,YAAY;KACZ,IAAI;IACN;IACA;KACE,MAAM;KACN,YAAY;KACZ,IAAI;IACN;IACA;KACE,MAAM;KACN,YAAY;KACZ,IAAI;IACN;IACA;KACE,MAAM;KACN,YAAY;KACZ,IAAI;IACN;GACF;GACA,MAAM,CACJ;IACE,OAAO;IACP,eAAe;IACf,QAAQ;KACN;KACA;KACA;;KAEA;IACF;GACF,GACA;IACE,OAAO;IACP,eAAe;IACf,QAAQ;KACN;KACA;KACA;KACA;KACA;IACF;GACF,CACF;EACF;CACF;AACF"}
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
|
|
89
89
|
// Primary / Secondary / Tertiary Action Colors
|
|
90
90
|
--synapse-primary-action-color: #{v.$primary-action-color};
|
|
91
|
+
--synapse-focus-color: var(--synapse-primary-action-color);
|
|
91
92
|
--synapse-primary-bgcolor-rgba: #{v.$primary-bgcolor-rgba};
|
|
92
93
|
--synapse-secondary-action-color: #{v.$secondary-action-color};
|
|
93
94
|
--synapse-tertiary-action-color: #{v.$tertiary-action-color};
|
|
@@ -261,11 +261,21 @@
|
|
|
261
261
|
flex-direction: row;
|
|
262
262
|
align-items: flex-start;
|
|
263
263
|
gap: var(--baseline-grid);
|
|
264
|
+
|
|
264
265
|
@media (max-width: map.get(SRC.$breakpoints, 'medium')) {
|
|
265
266
|
flex-direction: column;
|
|
266
267
|
}
|
|
267
268
|
}
|
|
268
269
|
|
|
270
|
+
.SRC-cardTitleArea--ctaRight {
|
|
271
|
+
align-items: center;
|
|
272
|
+
gap: 30px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&.SRC-cardContent--ctaRight {
|
|
276
|
+
max-width: none;
|
|
277
|
+
}
|
|
278
|
+
|
|
269
279
|
.SRC-cardTitleAreaDetails {
|
|
270
280
|
display: flex;
|
|
271
281
|
flex: 0 0 25%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.dsg-input{font-size:inherit;color:#353a3f}.dsg-cell-disabled input{color:#71767f}.row-deleted .dsg-cell,.row-deleted .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff1f0}.row-created .dsg-cell,.row-created .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#f6ffed}.row-updated .dsg-cell,.row-updated .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff7e6}.row-valid .dsg-cell-gutter,.row-valid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.row-invalid .dsg-cell-gutter,.row-invalid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.row-unknown .dsg-cell-gutter{background:#fdfeeb}.row-unknown .dsg-cell-gutter:after{content:"";z-index:1;border:2px solid #e6c200;border-top-color:#0000;border-radius:50%;width:16px;height:16px;margin:-8px 0 0 -8px;animation:1s linear infinite spin;display:block;position:absolute;top:50%;left:50%}.row-unknown .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.cell-invalid,.dsg-cell.cell-invalid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.dsg-cell.cell-valid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.dsg-cell.cell-unknown,.dsg-cell.cell-unknown.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.dsg-cell-sticky-left:not(.cell-invalid):not(.cell-valid):not(.cell-unknown):not(.dsg-cell-header):not(.dsg-cell-gutter){background:var(--dsg-cell-background-color,white)}@keyframes spin{to{transform:rotate(360deg)}}.dsg-cell-header.
|
|
1
|
+
.dsg-input{font-size:inherit;color:#353a3f}.dsg-cell-disabled input{color:#71767f}.row-deleted .dsg-cell,.row-deleted .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff1f0}.row-created .dsg-cell,.row-created .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#f6ffed}.row-updated .dsg-cell,.row-updated .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff7e6}.row-valid .dsg-cell-gutter,.row-valid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.row-invalid .dsg-cell-gutter,.row-invalid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.row-unknown .dsg-cell-gutter{background:#fdfeeb}.row-unknown .dsg-cell-gutter:after{content:"";z-index:1;border:2px solid #e6c200;border-top-color:#0000;border-radius:50%;width:16px;height:16px;margin:-8px 0 0 -8px;animation:1s linear infinite spin;display:block;position:absolute;top:50%;left:50%}.row-unknown .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.cell-invalid,.dsg-cell.cell-invalid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.dsg-cell.cell-valid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.dsg-cell.cell-unknown,.dsg-cell.cell-unknown.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.dsg-cell-sticky-left:not(.cell-invalid):not(.cell-valid):not(.cell-unknown):not(.dsg-cell-header):not(.dsg-cell-gutter){background:var(--dsg-cell-background-color,white)}@keyframes spin{to{transform:rotate(360deg)}}.dsg-cell-header:not(.dsg-cell-gutter){color:#000;background-color:#dbdde1;font-weight:700}.dsg-cell-header.header-upsert-key{color:#fff;background-color:#395979;font-weight:700}.multi-value-cell{min-height:40px}.multi-value-cell-large{min-height:80px}.dsg-expand-rows-rect{z-index:50;background:#4580e614;box-shadow:inset 0 0 0 1px #4580e6}.dsg-expand-rows-indicator{z-index:1001;overflow:visible}.dsg-expand-rows-indicator:before{content:"";cursor:crosshair;position:absolute;inset:-4px}.cell-selected{border:1px solid #1976d2}.dsg-container:not(:focus-within) .cell-selected{z-index:25;background-color:#1976d20d;border:1px solid #1976d2}.dsg-container{position:relative}.column-resize-handle{cursor:col-resize;-webkit-user-select:none;user-select:none;z-index:100;background-color:#0000;width:8px;transition:background-color .15s;position:absolute}.column-resize-handle:before{content:"";background:0 0;border-left:1px solid #0000;border-right:1px solid #0000;width:4px;height:16px;transition:border-color .15s;position:absolute;top:8px;left:50%;transform:translate(-50%)}.column-resize-handle:hover{background-color:#80808026}.column-resize-handle:hover:before{border-left-color:#80808080;border-right-color:#80808080}.column-resize-handle.is-resizing{background-color:#8080804d}.column-resize-handle.is-resizing:before{border-left-color:#646464cc;border-right-color:#646464cc}body.col-resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}body.col-resizing .dsg-container,body.col-resizing .dsg-container *{cursor:col-resize}.dsg-cell.cell-changed--self:after{content:"";z-index:20;pointer-events:none;border-top:0 solid #0000;border-bottom:7px solid #0000;border-left:0 solid #0000;border-right:7px solid #52c41a;width:0;height:0;position:absolute;top:0;right:0}.dsg-cell.cell-changed--other-user:after{content:"";z-index:20;pointer-events:none;border-top:0 solid #0000;border-bottom:7px solid #0000;border-left:0 solid #0000;border-right:7px solid #1677ff;width:0;height:0;position:absolute;top:0;right:0}.dsg-cell.cell-remote-selected--color-0{box-shadow:inset 0 0 0 1px #1677ff66;background-color:#1677ff1f!important}.dsg-cell.cell-remote-selected--color-1{box-shadow:inset 0 0 0 1px #52c41a66;background-color:#52c41a1f!important}.dsg-cell.cell-remote-selected--color-2{box-shadow:inset 0 0 0 1px #fa8c1666;background-color:#fa8c161f!important}.dsg-cell.cell-remote-selected--color-3{box-shadow:inset 0 0 0 1px #eb2f9666;background-color:#eb2f961f!important}.dsg-cell.cell-remote-selected--color-4{box-shadow:inset 0 0 0 1px #13c2c266;background-color:#13c2c21f!important}.dsg-cell.cell-remote-selected--color-5{box-shadow:inset 0 0 0 1px #9254de66;background-color:#9254de1f!important}.dsg-cell.cell-remote-selected--color-6{box-shadow:inset 0 0 0 1px #f5222d66;background-color:#f5222d1f!important}.dsg-cell.cell-remote-selected--color-7{box-shadow:inset 0 0 0 1px #faad1466;background-color:#faad141f!important}
|