Skip to content

Commit

Permalink
something wip
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyhappydan committed May 27, 2024
1 parent f7410c7 commit 2e5c713
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/components/VirtualLab/Bookmarks/BookmarkList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@ export default function BookmarkList({ labId, projectId }: Props) {
</div>
);
}

// http://localhost:3000/
// virtual-lab/
// lab/
// 673bbb40-7b3a-40f7-abf0-a25379fd4a8b/
// project/
// e5ed7dfd-9b7c-4de4-990d-7a603da654b9/
// explore/
// interactive/
// experimental/
// morphology/
// YmJwL21vdXNlbGlnaHQhLyFodHRwczovL2JicC5lcGZsLmNoL25ldXJvc2NpZW5jZWdyYXBoL2RhdGEvbmV1cm9ubW9ycGhvbG9naWVzL0FBMTE5MA==?
// brainRegion=http%253A%252F%252Fapi.brain-map.org%252Fapi%252Fv2%252Fdata%252FStructure%252F567
4 changes: 3 additions & 1 deletion src/types/explore-section/data-types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Field } from '@/constants/explore-section/fields-config/enums';
import { DetailProps } from '@/types/explore-section/application';

export type ExperimentDataTypeName = "morphology" | "electrophysiology" | "neuron-density" | "bouton-density" | "synapse-per-connection";

export type DataTypeConfig = {
title: string;
name: string;
name: ExperimentDataTypeName;
columns: Array<Field>;
curated: boolean;
group: DataTypeGroup;
Expand Down
16 changes: 16 additions & 0 deletions src/util/common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ExploreESHit } from '@/types/explore-section/es';
import { ExploreSectionResource } from '@/types/explore-section/resources';
import { BASE_EXPERIMENTAL_EXPLORE_PATH } from '@/constants/explore-section/paths';
import { ExperimentDataTypeName } from '@/types/explore-section/data-types';

export const switchStateType = {
COUNT: 'count',
Expand Down Expand Up @@ -34,4 +36,18 @@ export const detailUrlBuilder = (
resource: ExploreESHit<ExploreSectionResource>
) => `${basePath}/${to64(`${resource._source.project.label}!/!${resource._id}`)}`;

export const detailUrlWithinLab = (
labId: string,
labProjectId: string,
resourceProjectLabel: string,
resourceId: string,
resourceType: ExperimentDataTypeName
) => `/virtual-lab/lab/${labId}/project/${labProjectId}${BASE_EXPERIMENTAL_EXPLORE_PATH}${resourceType}/${to64(`${resourceProjectLabel}!/!${resourceId}`)}`;

export const detailUrlOutsideLab = (
projectLabel: string,
resourceId: string,
resourceType: ExperimentDataTypeName
) => `${BASE_EXPERIMENTAL_EXPLORE_PATH}/${resourceType}/${to64(`${projectLabel}!/!${resourceId}`)}`;

export const localCompareString = (a: string, b: string) => a.localeCompare(b);

0 comments on commit 2e5c713

Please sign in to comment.