Skip to content

Commit

Permalink
Merge pull request #371 from hubmapconsortium/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
axdanbol authored May 3, 2024
2 parents 6e053e1 + 26a84d1 commit 4f76063
Show file tree
Hide file tree
Showing 23 changed files with 93 additions and 22 deletions.
2 changes: 2 additions & 0 deletions apps/asctb-reporter/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
},
"configurations": {
"production": {
"baseHref": "/ui/asctb-reporter/",
"fileReplacements": [
{
"replace": "apps/asctb-reporter/src/environments/environment.ts",
Expand Down Expand Up @@ -62,6 +63,7 @@
]
},
"staging": {
"baseHref": "/ui--staging/asctb-reporter/",
"fileReplacements": [
{
"replace": "apps/asctb-reporter/src/environments/environment.ts",
Expand Down
1 change: 0 additions & 1 deletion apps/asctb-reporter/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset="utf-8" />
<title>HuBMAP CCF ASCT+B Reporter</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Primary Meta Tags -->
<meta name="title" content="ASCT+B Reporter" />
Expand Down
31 changes: 30 additions & 1 deletion apps/ccf-body-ui-wc/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
},
"configurations": {
"production": {
"baseHref": "/ui/ccf-body-ui-wc/",
"budgets": [
{
"type": "initial",
Expand All @@ -53,6 +54,34 @@
],
"outputHashing": "none"
},
"staging": {
"baseHref": "/ui--staging/ccf-body-ui-wc/",
"fileReplacements": [
{
"replace": "apps/ccf-body-ui-wc/src/environments/environment.ts",
"with": "apps/ccf-body-ui-wc/src/environments/environment.staging.ts"
}
],
"optimization": true,
"outputHashing": "none",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
},
"development": {
"buildOptimizer": false,
"optimization": false,
Expand All @@ -71,7 +100,7 @@
"namedChunks": true
}
},
"defaultConfiguration": "production"
"defaultConfiguration": ""
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
Expand Down
1 change: 0 additions & 1 deletion apps/ccf-body-ui-wc/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset="utf-8" />
<title>HuBMAP CCF Body UI</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
Expand Down
2 changes: 2 additions & 0 deletions apps/ccf-eui/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
},
"configurations": {
"production": {
"baseHref": "/ui/ccf-eui/",
"fileReplacements": [
{
"replace": "apps/ccf-eui/src/environments/environment.ts",
Expand Down Expand Up @@ -66,6 +67,7 @@
]
},
"staging": {
"baseHref": "/ui--staging/ccf-eui/",
"fileReplacements": [
{
"replace": "apps/ccf-eui/src/environments/environment.ts",
Expand Down
4 changes: 3 additions & 1 deletion apps/ccf-organ-info/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
},
"configurations": {
"production": {
"baseHref": "/ui/ccf-organ-info/",
"budgets": [
{
"type": "initial",
Expand All @@ -54,6 +55,7 @@
"outputHashing": "none"
},
"staging": {
"baseHref": "/ui--staging/ccf-organ-info/",
"budgets": [
{
"type": "initial",
Expand Down Expand Up @@ -92,7 +94,7 @@
"namedChunks": true
}
},
"defaultConfiguration": "production"
"defaultConfiguration": ""
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
Expand Down
1 change: 0 additions & 1 deletion apps/ccf-organ-info/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset="utf-8" />
<title>HuBMAP CCF Organ Info Component</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap" rel="stylesheet" />
Expand Down
2 changes: 2 additions & 0 deletions apps/ccf-rui/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
},
"configurations": {
"production": {
"baseHref": "/ui/ccf-rui/",
"fileReplacements": [
{
"replace": "apps/ccf-rui/src/environments/environment.ts",
Expand Down Expand Up @@ -62,6 +63,7 @@
]
},
"staging": {
"baseHref": "/ui--staging/ccf-rui/",
"fileReplacements": [
{
"replace": "apps/ccf-rui/src/environments/environment.ts",
Expand Down
1 change: 1 addition & 0 deletions apps/ccf-rui/src/app/app-web-component.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function parseOrgan(value: unknown): string | Organ {
export class AppWebComponent extends BaseWebComponent {
@Input() baseHref!: string;
@Input() useDownload!: string | boolean;
@Input() referenceData!: string;
@Input() user!: string | User;
@Input() organ!: string | Organ;
@Input() editRegistration!: string | SpatialEntityJsonLd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SpatialPlacementJsonLd, SpatialSceneNode } from 'ccf-body-ui';
import { ExtractionSet, SpatialEntity } from 'ccf-database';
import { ALL_ORGANS, GlobalConfigState, GlobalsService, OrganInfo } from 'ccf-shared';
import { EMPTY, Observable, from } from 'rxjs';
import { catchError, map, switchMap } from 'rxjs/operators';
import { catchError, switchMap } from 'rxjs/operators';

import { environment } from '../../../../environments/environment';
import { GlobalConfig } from '../../services/config/config';
Expand Down Expand Up @@ -94,8 +94,7 @@ export class ReferenceDataState extends NgxsImmutableDataRepository<ReferenceDat
}

private getSourceDB(): Observable<ReferenceDataStateModel> {
return this.globalConfig.getOption('baseHref').pipe(
map((baseHref) => (baseHref ?? '') + 'assets/reference-organ-data.json'),
return this.globalConfig.getOption<string>('referenceData').pipe(
switchMap((url) =>
from(fetch(url)).pipe(
switchMap((data) => data.json()),
Expand Down
12 changes: 6 additions & 6 deletions apps/ccf-rui/src/app/core/store/scene/scene.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ interface Collision {

const NODE_COLLISION_THROTTLE_DURATION = 10;

const DEFAULT_COLLISIONS_ENDPOINT = 'https://pfn8zf2gtu.us-east-2.awsapprunner.com/get-collisions';

function getNodeBbox(model: SpatialSceneNode): AABB {
const mat = new Matrix4(model.transformMatrix);
const lowerBound = mat.transformAsPoint([-1, -1, -1], []);
Expand Down Expand Up @@ -360,10 +358,12 @@ export class SceneState extends NgxsImmutableDataRepository<SceneStateModel> imp

private getCollisions(jsonld: unknown): Observable<Collision[] | undefined> {
return this.globalConfig.getOption('collisionsEndpoint').pipe(
switchMap((endpoint = DEFAULT_COLLISIONS_ENDPOINT) =>
this.http.post<Collision[]>(endpoint, JSON.stringify(jsonld), {
headers: { 'Content-Type': 'application/json' },
}),
switchMap((endpoint) =>
endpoint
? this.http.post<Collision[]>(endpoint, JSON.stringify(jsonld), {
headers: { 'Content-Type': 'application/json' },
})
: of(undefined),
),
catchError(() => of(undefined)),
take(1),
Expand Down
2 changes: 2 additions & 0 deletions apps/ccf-rui/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const environment = {
header: true,
homeUrl: 'https://portal.hubmapconsortium.org/',
logoTooltip: 'Human BioMolecular Atlas Project',
collisionsEndpoint: 'https://apps.humanatlas.io/api/v1/collisions',
referenceData: 'https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@gh-pages/rui/assets/reference-organ-data.json',
},
skipUnsavedChangesConfirmation: false,
googleAnalyticsToken: window.location.hostname === 'portal.hubmapconsortium.org' ? 'G-1WRJHN9FM6' : 'G-J9HWV9QPJ4',
Expand Down
2 changes: 2 additions & 0 deletions apps/ccf-rui/src/environments/environment.staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const environment = {
header: true,
homeUrl: 'https://portal.hubmapconsortium.org/',
logoTooltip: 'Human BioMolecular Atlas Project',
collisionsEndpoint: 'https://apps.humanatlas.io/api/v1/collisions',
referenceData: 'https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@gh-pages/rui/assets/reference-organ-data.json',
},
skipUnsavedChangesConfirmation: false,
googleAnalyticsToken: 'G-ERNVZ1Q4KE',
Expand Down
2 changes: 2 additions & 0 deletions apps/ccf-rui/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const environment = {
header: true,
homeUrl: 'https://portal.hubmapconsortium.org/',
logoTooltip: 'Human BioMolecular Atlas Project',
collisionsEndpoint: 'https://apps.humanatlas.io/api/v1/collisions',
referenceData: 'https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@gh-pages/rui/assets/reference-organ-data.json',
},
skipUnsavedChangesConfirmation: true,
googleAnalyticsToken: 'G-B3DT7XPMRT',
Expand Down
1 change: 0 additions & 1 deletion apps/ccf-rui/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset="utf-8" />
<title>HuBMAP CCF Registration User Interface (CCF-RUI)</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&amp;display=swap" rel="stylesheet" />
Expand Down
14 changes: 14 additions & 0 deletions apps/ftu-ui-small-wc/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"configurations": {
"production": {
"baseHref": "/ui/ftu-ui-small-wc/",
"budgets": [
{
"type": "initial",
Expand All @@ -47,6 +48,19 @@
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
},
"staging": {
"baseHref": "/ui--staging/ftu-ui-small-wc/",
"outputHashing": "none"
},
"preview": {
"baseHref": "/apps/ftu-ui-small-wc/",
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
Expand Down
4 changes: 2 additions & 2 deletions apps/ftu-ui/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"configurations": {
"production": {
"baseHref": "/hra-ui/apps/ftu-ui/",
"baseHref": "/ui/ftu-ui/",
"outputHashing": "none",
"budgets": [
{
Expand All @@ -49,7 +49,7 @@
"namedChunks": true
},
"staging": {
"baseHref": "/apps/ftu-ui/",
"baseHref": "/ui--staging/ftu-ui/",
"outputHashing": "none"
},
"preview": {
Expand Down
3 changes: 2 additions & 1 deletion apps/humanatlas.io/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"configurations": {
"production": {
"baseHref": "/ui/humanatlas.io/",
"budgets": [
{
"type": "initial",
Expand Down Expand Up @@ -66,7 +67,7 @@
"namedChunks": true
},
"staging": {
"baseHref": "/apps/humanatlas.io/",
"baseHref": "/ui--staging/humanatlas.io/",
"outputHashing": "none"
},
"preview": {
Expand Down
1 change: 0 additions & 1 deletion apps/humanatlas.io/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset="utf-8" />
<title>Human Reference Atlas Portal</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
Expand Down
19 changes: 18 additions & 1 deletion apps/medical-illustration/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
"configurations": {
"production": {
"baseHref": "/ui/medical-illustration/",
"budgets": [
{
"type": "initial",
Expand All @@ -45,9 +46,22 @@
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
},
"staging": {
"baseHref": "/ui--staging/medical-illustration/",
"outputHashing": "none"
},
"preview": {
"baseHref": "/apps/medical-illustration/",
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
"defaultConfiguration": ""
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
Expand Down Expand Up @@ -77,6 +91,9 @@
"options": {
"jestConfig": "apps/medical-illustration/jest.config.ts"
}
},
"build-webcomponent": {
"command": "node tools/scripts/build-webcomponent.mjs medical-illustration"
}
},
"tags": ["app", "webcomponent"],
Expand Down
5 changes: 3 additions & 2 deletions tools/scripts/build-webcomponent.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ async function build(app_name) {
`${distDir}/runtime*.js`,
`${distDir}/polyfills*.js`,
`${distDir}/scripts*.js`,
`${distDir}/vendor*.js`,
`${distDir}/main*.js`,
]);

if (jsFiles.length !== 4) {
console.log('Failed to find all application js files');
if (jsFiles.length === 0) {
console.log('Failed to find application js files');
exit(1);
}

Expand Down

0 comments on commit 4f76063

Please sign in to comment.