Skip to content

Commit

Permalink
feat: add login config to ma-pilot dev, cc-dev, and prod environments (
Browse files Browse the repository at this point in the history
  • Loading branch information
Fran McDade authored and Fran McDade committed Dec 12, 2023
1 parent 5d007dc commit 2c6e77e
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 11 deletions.
2 changes: 2 additions & 0 deletions explorer/app/components/common/MDXContent/hca-dcp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ export { default as DownloadCurlCommandStart } from "./downloadCurlCommandStart.
export { default as DownloadCurlCommandSuccess } from "./downloadCurlCommandSuccess.mdx";
export { default as ExportToTerraStart } from "./exportToTerraStart.mdx";
export { default as ExportToTerraSuccessWithWarning } from "./exportToTerraSuccessWithWarning.mdx";
export { default as LoginTermsOfService } from "./loginTermsOfService.mdx";
export { default as LoginText } from "./loginText.mdx";
export { default as ManifestDownloadStart } from "./manifestDownloadStart.mdx";
export { default as ManifestDownloadSuccess } from "./manifestDownloadSuccess.mdx";
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Link } from "@clevercanary/data-explorer-ui/lib/components/Links/components/Link/link";

<span>
I have read and agree to{" "}
<Link
label="privacy notice"
url="https://data.humancellatlas.dev.clevercanary.com/privacy"
/>{" "}
and terms of service
</span>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { HelpIconButton } from "@clevercanary/data-explorer-ui/lib/components/common/Button/components/HelpIconButton/helpIconButton";

<span>
<span>Please sign in to your Data Explorer account</span>{" "}
<HelpIconButton url="https://data.humancellatlas.org/help" />
</span>
1 change: 1 addition & 0 deletions explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"build:anvil-cmg": "./scripts/build.sh anvil-cmg && next build && next export -o out/explore && npm run postbuild",
"build-cc-dev:anvil-cmg": "./scripts/common-build.sh anvil-cmg cc-dev && next build && next export -o out && npm run postbuild",
"dev:hca-dcp": "./scripts/dev.sh hca-dcp && next dev",
"dev:cc-ma-dev:hca-dcp": "./scripts/dev.sh hca-dcp cc-ma-dev && next dev",
"build-dev:hca-dcp": "./scripts/common-build.sh hca-dcp dev && next build && next export -o out && npm run postbuild",
"build-cc-ma-dev:hca-dcp": "./scripts/common-build.sh hca-dcp cc-ma-dev && next build && next export -o out && npm run postbuild",
"build-ma-dev:hca-dcp": "./scripts/common-build.sh hca-dcp ma-dev && next build && next export -o out && npm run postbuild",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { AuthenticationConfig } from "../../../../../../data-explorer/packages/data-explorer-ui/src/config/entities";
import * as MDX from "../../../../app/components/common/MDXContent/hca-dcp";

export const authenticationConfig: AuthenticationConfig = {
googleGISAuthConfig: {
clientId:
"561542988117-9e04fhfrc9su130eb2ggea7bdppolkjq.apps.googleusercontent.com", // TODO(cc) update clientId.
googleProfileEndpoint: "https://www.googleapis.com/oauth2/v3/userinfo",
scope:
"https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile openid",
},
termsOfService: MDX.RenderComponent({ Component: MDX.LoginTermsOfService }),
terraAuthConfig: {
termsOfServiceEndpoint:
"https://sam.dsde-dev.broadinstitute.org/register/user/v2/self/termsOfServiceDetails",
terraProfileEndpoint:
"https://sam.dsde-dev.broadinstitute.org/register/user/v1",
},
text: MDX.RenderComponent({ Component: MDX.LoginText }),
title: "Sign in to your account",
};
11 changes: 9 additions & 2 deletions explorer/site-config/hca-dcp/cc-ma-dev/config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import { SiteConfig } from "@clevercanary/data-explorer-ui/lib/config/entities";
import { makeConfig } from "../dev/config";
import { authenticationConfig } from "./authentication/authentication";

// Template constants
const PORTAL_URL = "https://data.humancellatlas.dev.clevercanary.com";
const BROWSER_URL =
"https://ma-pilot.explore.data.humancellatlas.dev.clevercanary.com";
const CATALOG = "dcp3";
const DATA_URL = "https://service.dev.singlecell.gi.ucsc.edu";
const PORTAL_URL = "https://data.humancellatlas.dev.clevercanary.com";

const config: SiteConfig = {
...makeConfig(BROWSER_URL, PORTAL_URL),
...makeConfig(BROWSER_URL, PORTAL_URL, DATA_URL, CATALOG),
authentication: authenticationConfig,
};

const header = { ...config.layout.header };
config.layout.header = { ...header, authenticationEnabled: true };

export default config;
8 changes: 5 additions & 3 deletions explorer/site-config/hca-dcp/dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const PORTAL_URL = "https://data.humancellatlas.dev.clevercanary.com";
export function makeConfig(
browserUrl: string,
portalUrl: string,
dataUrl: string,
catalog: string = CATALOG
): SiteConfig {
return {
Expand All @@ -48,6 +49,7 @@ export function makeConfig(
gtmPreview: "env-186",
},
appTitle: APP_TITLE,
authentication: undefined,
browserURL: browserUrl,
categoryGroupConfigs: [
{
Expand Down Expand Up @@ -154,7 +156,7 @@ export function makeConfig(
defaultParams: {
catalog,
},
url: `${DATA_URL}/`,
url: `${dataUrl}/`,
},
entities: [projectsEntityConfig, samplesEntityConfig, filesEntityConfig],
explorerTitle: "Explore Data",
Expand Down Expand Up @@ -229,7 +231,7 @@ export function makeConfig(
components: summary,
},
systemStatus: {
apiPath: `${DATA_URL}${APIEndpoints.INDEX_STATUS}`,
apiPath: `${dataUrl}${APIEndpoints.INDEX_STATUS}`,
bindResponse: <SystemStatusBindResponseFn>bindSystemStatusResponse,
},
themeOptions: {
Expand Down Expand Up @@ -291,6 +293,6 @@ export function makeConfig(
};
}

const config: SiteConfig = makeConfig(BROWSER_URL, PORTAL_URL);
const config: SiteConfig = makeConfig(BROWSER_URL, PORTAL_URL, DATA_URL);

export default config;
4 changes: 4 additions & 0 deletions explorer/site-config/hca-dcp/dev/index/filesEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FilesResponse } from "../../../../app/apis/azul/hca-dcp/common/response
import * as C from "../../../../app/components";
import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders";
import { HCA_DCP_CATEGORY_KEY, HCA_DCP_CATEGORY_LABEL } from "../../category";
import { subTitleHero } from "../listView/subTitleHero";

/**
* Entity config object responsible to config anything related to the /files route.
Expand Down Expand Up @@ -108,5 +109,8 @@ export const filesEntityConfig: EntityConfig<FilesResponse> = {
id: HCA_DCP_CATEGORY_KEY.FILE_NAME,
},
} as ListConfig<FilesResponse>,
listView: {
subTitleHero,
},
route: "files",
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { sideColumn as overviewSideColumn } from "../detail/project/overviewSide
import { mainColumn as projectFilesMainColumn } from "../detail/project/projectFilesMainColumn";
import { sideColumn as projectFilesSideColumn } from "../detail/project/projectFilesSideColumn";
import { top } from "../detail/project/top";
import { subTitleHero } from "../listView/subTitleHero";

/**
* Entity config object responsible to config anything related to the /projects route.
Expand Down Expand Up @@ -138,6 +139,9 @@ export const projectsEntityConfig: EntityConfig = {
id: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE,
},
} as ListConfig<ProjectsResponse>,
listView: {
subTitleHero,
},
overrides: projectEdits,
route: "projects",
};
4 changes: 4 additions & 0 deletions explorer/site-config/hca-dcp/dev/index/samplesEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { SamplesResponse } from "../../../../app/apis/azul/hca-dcp/common/respon
import * as C from "../../../../app/components";
import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders";
import { HCA_DCP_CATEGORY_KEY, HCA_DCP_CATEGORY_LABEL } from "../../category";
import { subTitleHero } from "../listView/subTitleHero";

/**
* Entity config object responsible to config anything related to the /samples route.
Expand Down Expand Up @@ -114,5 +115,8 @@ export const samplesEntityConfig: EntityConfig<SamplesResponse> = {
id: HCA_DCP_CATEGORY_KEY.SAMPLE_ID,
},
} as ListConfig<SamplesResponse>,
listView: {
subTitleHero,
},
route: "samples",
};
11 changes: 11 additions & 0 deletions explorer/site-config/hca-dcp/dev/listView/subTitleHero.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {
ComponentConfig,
ComponentsConfig,
} from "@clevercanary/data-explorer-ui/lib/config/entities";
import * as C from "../../../../app/components";

export const subTitleHero: ComponentsConfig = [
{
component: C.TerraSetUpForm,
} as ComponentConfig<typeof C.TerraSetUpForm>,
];
6 changes: 4 additions & 2 deletions explorer/site-config/hca-dcp/ma-dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { SiteConfig } from "@clevercanary/data-explorer-ui/lib/config/entities";
import { makeConfig } from "../dev/config";

// Template constants
const PORTAL_URL = "https://data.dev.singlecell.gi.ucsc.edu";
const BROWSER_URL = "https://ma-pilot.explore.data.dev.singlecell.gi.ucsc.edu";
const CATALOG = "dcp3";
const DATA_URL = "https://service.dev.singlecell.gi.ucsc.edu";
const PORTAL_URL = "https://data.dev.singlecell.gi.ucsc.edu";

const config: SiteConfig = {
...makeConfig(BROWSER_URL, PORTAL_URL),
...makeConfig(BROWSER_URL, PORTAL_URL, DATA_URL, CATALOG),
};

if (config.analytics) {
Expand Down
5 changes: 3 additions & 2 deletions explorer/site-config/hca-dcp/ma-prod/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { SiteConfig } from "@clevercanary/data-explorer-ui/lib/config/entities";
import { makeConfig } from "../dev/config";

// Template constants
const PORTAL_URL = "https://data.humancellatlas.org";
const BROWSER_URL = "https://ma-pilot.explore.data.humancellatlas.org";
const DATA_URL = "https://service.azul.data.humancellatlas.org";
const PORTAL_URL = "https://data.humancellatlas.org";

const config: SiteConfig = {
...makeConfig(BROWSER_URL, PORTAL_URL),
...makeConfig(BROWSER_URL, PORTAL_URL, DATA_URL),
};

// Update gtmAuth for the prod environment lookup.
Expand Down
5 changes: 3 additions & 2 deletions explorer/site-config/hca-dcp/prod/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { SiteConfig } from "@clevercanary/data-explorer-ui/lib/config/entities";
import { makeConfig } from "../dev/config";

// Template constants
const PORTAL_URL = "https://data.humancellatlas.org";
const BROWSER_URL = "https://explore.data.humancellatlas.org";
const DATA_URL = "https://service.azul.data.humancellatlas.org";
const PORTAL_URL = "https://data.humancellatlas.org";

const config: SiteConfig = {
...makeConfig(BROWSER_URL, PORTAL_URL),
...makeConfig(BROWSER_URL, PORTAL_URL, DATA_URL),
};

// Update gtmAuth for the prod environment lookup.
Expand Down

0 comments on commit 2c6e77e

Please sign in to comment.