Skip to content

Commit cd8797a

Browse files
authored
Frontend support for reindex_through, nested contexts... (#670)
...and null-safe operators. Companion to three backend PRs: #668 Add reindex_through support to SliceQuery #667 Refactor ContextEvaluator and add nested context references #666 Null-guarded negated operators and is_null/not_null
1 parent 4b711b4 commit cd8797a

File tree

109 files changed

+5433
-1254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+5433
-1254
lines changed

frontend/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = {
3737
"@typescript-eslint/indent": "off",
3838
"@typescript-eslint/naming-convention": "off",
3939
"@typescript-eslint/no-explicit-any": "warn",
40-
// "@typescript-eslint/no-use-before-define": "off",
40+
"@typescript-eslint/no-use-before-define": ["error", { functions: false }],
4141
"@typescript-eslint/quotes": "off",
4242
"arrow-body-style": "off",
4343
"class-methods-use-this": "off",

frontend/packages/@depmap/api/src/breadboxAPI/resources/temp.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export async function evaluateContext(
3838
if (
3939
typeof context.expr !== "boolean" &&
4040
"in" in context.expr &&
41+
Array.isArray(context.expr.in[1]) &&
4142
Object.keys(context.vars).length > 0
4243
) {
4344
const slice = Object.values(context.vars)[0];
@@ -73,22 +74,6 @@ export async function evaluateContext(
7374
}
7475
}
7576

76-
const varsAsSliceQueries = Object.fromEntries(
77-
Object.entries(context.vars).map(([varName, variable]) => [
78-
varName,
79-
{
80-
// The `DataExplorerContextVariable` type has some extra fields that
81-
// aren't part of the SliceQuery format. We'll only include the
82-
// relevant fields so the backend doesn't get confused.
83-
dataset_id: variable.dataset_id,
84-
identifier: variable.identifier,
85-
identifier_type: variable.identifier_type,
86-
},
87-
])
88-
);
89-
90-
const contextToEval = { ...context, vars: varsAsSliceQueries };
91-
9277
const response = await postJson<
9378
| {
9479
ids: string[];
@@ -105,7 +90,7 @@ export async function evaluateContext(
10590
error_type: string;
10691
};
10792
}
108-
>("/temp/context", contextToEval);
93+
>("/temp/context", context);
10994

11095
if ("detail" in response) {
11196
window.console.warn("Could not evaluate context", context);

frontend/packages/@depmap/api/src/breadboxAPI/resources/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export function getDimensionTypeIdentifiers(
4343
dimTypeName: string,
4444
params?: {
4545
data_type?: string;
46-
// NOTE: This is known to affect performance.
4746
show_only_dimensions_in_datasets?: boolean;
4847
}
4948
) {

frontend/packages/@depmap/common-components/src/components/Markdown/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface MarkdownRendererProps {
99

1010
function Markdown({ children, className = undefined }: MarkdownRendererProps) {
1111
return (
12-
<Suspense fallback={<Spinner />}>
12+
<Suspense fallback={<Spinner position="static" />}>
1313
<LazyMarkdownCore className={className}>{children}</LazyMarkdownCore>
1414
</Suspense>
1515
);

frontend/packages/@depmap/common-components/src/styles/modals.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
:global {
2-
// A parent modal that launches a confirmation modal
3-
// should not be fully hidden, just darkened.
4-
// This overrides the behavior specified here:
5-
// https://github.com/broadinstitute/depmap-portal/blob/e1e9134/frontend/packages/@depmap/data-explorer-2/src/styles/ContextBuilderV2.scss#L16-L36
2+
// A parent modal that launches a confirmation modal should get darkened.
63
div[role="dialog"]:has(~ div[role="dialog"] .stackableConfirmationModal) {
74
.modal-content {
8-
display: block !important;
95
filter: brightness(0.5);
106
transition: filter 0.3s ease;
117
}
128
}
139
}
1410

11+
// Never allow modal backdrops to stack.
12+
:global div[role="dialog"] ~ div[role="dialog"] {
13+
.modal-backdrop {
14+
display: none;
15+
}
16+
}
17+
1518
.dontShowThisAgain {
1619
label {
1720
font-weight: normal;

frontend/packages/@depmap/custom-analyses/src/components/AnalysisConfigurationPanel/selects/AnalysisFilterSelect.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function AnalysisFilterSelect({ dimension_type, value, onChange }: Props) {
3030
onClickCreateContext={handleClickCreateContext}
3131
onClickSaveAsContext={handleClickSaveAsContext}
3232
selectClassName={styles.AnalysisContextSelect}
33+
linkToContextManager
3334
/>
3435
</div>
3536
);

frontend/packages/@depmap/data-explorer-2/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export { default as renderConditionally } from "./src/utils/render-conditionally
44
export { default as DimensionSelectV2 } from "./src/components/DimensionSelectV2";
55
export { default as ContextBuilderV2 } from "./src/components/ContextBuilderV2";
66
export { default as ContextManager } from "./src/components/ContextManager";
7-
export { default as AnnotationSelect } from "./src/components/AnnotationSelect";
87
export { default as DataExplorerPage } from "./src/components/DataExplorerPage/components/DataExplorer2";
98
export { default as ContextTypeSelect } from "./src/components/ContextManager/ContextTypeSelect";
109

frontend/packages/@depmap/data-explorer-2/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@depmap/globals": "1.0.0",
1616
"@depmap/slice-table": "1.0.0",
1717
"@depmap/statistics": "1.0.0",
18+
"@depmap/selects": "1.0.0",
1819
"@depmap/types": "1.0.0",
1920
"@depmap/user-upload": "1.0.0",
2021
"@depmap/utils": "1.0.0",

frontend/packages/@depmap/data-explorer-2/src/components/AnnotationSelect/AnnotationSliceSelect.tsx

Lines changed: 0 additions & 228 deletions
This file was deleted.

0 commit comments

Comments
 (0)