-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65339d2
commit bdab9e4
Showing
14 changed files
with
1,691 additions
and
106 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.content { | ||
height: 100%; | ||
overflow: hidden; | ||
|
||
.paneWrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--spacing-md); | ||
height: 100%; | ||
width: 100%; | ||
|
||
& > *:first-child { | ||
min-height: 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import * as t from 'io-ts'; | ||
|
||
import { INIT_FORMSET } from 'components/FilterForm/components/FilterFormStore'; | ||
import { ioRowHeight, ioTableViewMode, RowHeight, TableViewMode } from 'components/OptionsMenu'; | ||
import { SettingsConfig } from 'hooks/useSettings'; | ||
|
||
import { defaultColumnWidths, defaultExperimentColumns } from './columns'; | ||
|
||
const SelectAllType = t.type({ | ||
exclusions: t.array(t.number), | ||
type: t.literal('ALL_EXCEPT'), | ||
}); | ||
|
||
const RegularSelectionType = t.type({ | ||
selections: t.array(t.number), | ||
type: t.literal('ONLY_IN'), | ||
}); | ||
|
||
export const SelectionType = t.union([RegularSelectionType, SelectAllType]); | ||
export type SelectionType = t.TypeOf<typeof SelectionType>; | ||
export const DEFAULT_SELECTION: t.TypeOf<typeof RegularSelectionType> = { | ||
selections: [], | ||
type: 'ONLY_IN', | ||
}; | ||
|
||
// have to intersect with an empty object bc of settings store type issue | ||
export const ProjectSettings = t.intersection([ | ||
t.type({}), | ||
t.partial({ | ||
columns: t.array(t.string), | ||
columnWidths: t.record(t.string, t.number), | ||
compare: t.boolean, | ||
filterset: t.string, // save FilterFormSet as string | ||
heatmapOn: t.boolean, | ||
heatmapSkipped: t.array(t.string), | ||
pageLimit: t.number, | ||
pinnedColumnsCount: t.number, | ||
selection: SelectionType, | ||
sortString: t.string, | ||
}), | ||
]); | ||
export type ProjectSettings = t.TypeOf<typeof ProjectSettings>; | ||
|
||
export const ProjectUrlSettings = t.partial({ | ||
compare: t.boolean, | ||
page: t.number, | ||
}); | ||
|
||
export const settingsPathForProject = (id: number): string => `searchesForProject${id}`; | ||
export const defaultProjectSettings: Required<ProjectSettings> = { | ||
columns: defaultExperimentColumns, | ||
columnWidths: defaultColumnWidths, | ||
compare: false, | ||
filterset: JSON.stringify(INIT_FORMSET), | ||
heatmapOn: false, | ||
heatmapSkipped: [], | ||
pageLimit: 20, | ||
pinnedColumnsCount: 3, | ||
selection: DEFAULT_SELECTION, | ||
sortString: 'id=desc', | ||
}; | ||
|
||
export interface SearchesGlobalSettings { | ||
rowHeight: RowHeight; | ||
tableViewMode: TableViewMode; | ||
} | ||
|
||
export const experimentListGlobalSettingsConfig = t.partial({ | ||
rowHeight: ioRowHeight, | ||
tableViewMode: ioTableViewMode, | ||
}); | ||
|
||
export const experimentListGlobalSettingsDefaults = { | ||
rowHeight: RowHeight.MEDIUM, | ||
tableViewMode: 'scroll', | ||
} as const; | ||
|
||
export const experimentListGlobalSettingsPath = 'globalTableSettings'; | ||
|
||
export const settingsConfigGlobal: SettingsConfig<SearchesGlobalSettings> = { | ||
settings: { | ||
rowHeight: { | ||
defaultValue: RowHeight.MEDIUM, | ||
skipUrlEncoding: true, | ||
storageKey: 'rowHeight', | ||
type: ioRowHeight, | ||
}, | ||
tableViewMode: { | ||
defaultValue: 'scroll', | ||
skipUrlEncoding: true, | ||
storageKey: 'tableViewMode', | ||
type: ioTableViewMode, | ||
}, | ||
}, | ||
storagePath: experimentListGlobalSettingsPath, | ||
}; |
Oops, something went wrong.