diff --git a/projects/ccf-eui/src/app/shared/components/checkbox/checkbox.component.spec.ts b/projects/ccf-eui/src/app/shared/components/checkbox/checkbox.component.spec.ts index 386d54831..740be50db 100644 --- a/projects/ccf-eui/src/app/shared/components/checkbox/checkbox.component.spec.ts +++ b/projects/ccf-eui/src/app/shared/components/checkbox/checkbox.component.spec.ts @@ -1,9 +1,8 @@ -import { MatCheckbox } from '@angular/material/checkbox'; +import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; import { Shallow } from 'shallow-render'; import { CheckboxComponent } from './checkbox.component'; import { CheckboxModule } from './checkbox.module'; -import { MatCheckboxChange } from '@angular/material/checkbox'; describe('FiltersCheckboxComponent', () => { diff --git a/projects/ccf-rui/src/app/app.component.spec.ts b/projects/ccf-rui/src/app/app.component.spec.ts deleted file mode 100644 index 3da0d828b..000000000 --- a/projects/ccf-rui/src/app/app.component.spec.ts +++ /dev/null @@ -1,3 +0,0 @@ -describe('AppComponent', () => { - // TODO -}); diff --git a/projects/ccf-rui/src/app/core/services/theming/theming.service.spec.ts b/projects/ccf-rui/src/app/core/services/theming/theming.service.spec.ts deleted file mode 100644 index 1eb13da7a..000000000 --- a/projects/ccf-rui/src/app/core/services/theming/theming.service.spec.ts +++ /dev/null @@ -1,3 +0,0 @@ -describe('ThemingService', () => { - // Add tests -}); diff --git a/projects/ccf-rui/src/app/core/store/anatomical-structure-tags/anatomical-structure-tags.state.spec.ts b/projects/ccf-rui/src/app/core/store/anatomical-structure-tags/anatomical-structure-tags.state.spec.ts index ebe363fe8..37af65e57 100644 --- a/projects/ccf-rui/src/app/core/store/anatomical-structure-tags/anatomical-structure-tags.state.spec.ts +++ b/projects/ccf-rui/src/app/core/store/anatomical-structure-tags/anatomical-structure-tags.state.spec.ts @@ -1,11 +1,13 @@ -import { TestBed } from '@angular/core/testing'; import { NgxsDataPluginModule } from '@angular-ru/ngxs'; +import { TestBed } from '@angular/core/testing'; import { NgxsModule, Store } from '@ngxs/store'; import { GlobalConfigState } from 'ccf-shared'; -import { Observable, lastValueFrom } from 'rxjs'; +import { lastValueFrom, Observable, of } from 'rxjs'; import { take } from 'rxjs/operators'; import { PageState } from '../page/page.state'; +import { ReferenceDataState } from '../reference-data/reference-data.state'; +import { RegistrationState } from '../registration/registration.state'; import { GLOBAL_CONFIG } from './../../services/config/config'; import { ModelState } from './../model/model.state'; import { SceneState } from './../scene/scene.state'; @@ -27,8 +29,15 @@ describe('AnatomicalStructureTagsState', () => { ], providers: [ AnatomicalStructureTagState, + RegistrationState, SceneState, - ModelState, + { + provide: ModelState, + useValue: { + modelChanged$: of([]) + } + }, + ReferenceDataState, GlobalConfigState, { provide: GLOBAL_CONFIG, diff --git a/projects/ccf-rui/src/app/core/store/model/model.state.spec.ts b/projects/ccf-rui/src/app/core/store/model/model.state.spec.ts index aa966ed40..72973fdc1 100644 --- a/projects/ccf-rui/src/app/core/store/model/model.state.spec.ts +++ b/projects/ccf-rui/src/app/core/store/model/model.state.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; import { NgxsDataPluginModule } from '@angular-ru/ngxs'; +import { TestBed } from '@angular/core/testing'; import { NgxsModule, Store } from '@ngxs/store'; import { GlobalConfigState, OrganInfo } from 'ccf-shared'; -import { Observable, lastValueFrom } from 'rxjs'; +import { lastValueFrom, Observable, of } from 'rxjs'; import { take } from 'rxjs/operators'; import { ExtractionSet } from '../../models/extraction-set'; @@ -54,7 +54,8 @@ describe('ModelState', () => { { provide: PageState, useValue: { - setHasChanges: () => undefined + setHasChanges: () => undefined, + registrationStarted$: of([]) } } ] diff --git a/projects/ccf-rui/src/app/core/store/page/page.state.spec.ts b/projects/ccf-rui/src/app/core/store/page/page.state.spec.ts index 5a3d7f767..b5005c290 100644 --- a/projects/ccf-rui/src/app/core/store/page/page.state.spec.ts +++ b/projects/ccf-rui/src/app/core/store/page/page.state.spec.ts @@ -1,12 +1,13 @@ -import { TestBed } from '@angular/core/testing'; import { NgxsDataPluginModule } from '@angular-ru/ngxs'; +import { TestBed } from '@angular/core/testing'; import { NgxsModule, Store } from '@ngxs/store'; import { GlobalConfigState } from 'ccf-shared'; -import { Observable, lastValueFrom } from 'rxjs'; +import { lastValueFrom, Observable, of } from 'rxjs'; import { take } from 'rxjs/operators'; import { GLOBAL_CONFIG } from '../../services/config/config'; import { AnatomicalStructureTagState } from '../anatomical-structure-tags/anatomical-structure-tags.state'; +import { ReferenceDataState } from '../reference-data/reference-data.state'; import { ModelState } from './../model/model.state'; import { PageState } from './page.state'; @@ -27,7 +28,12 @@ describe('PageState', () => { ], providers: [ ModelState, - AnatomicalStructureTagState, + ReferenceDataState, + { + provide: AnatomicalStructureTagState, useValue: { + tags$: of([]) + } + }, GlobalConfigState, { provide: GLOBAL_CONFIG, useValue: {} } ] diff --git a/projects/ccf-rui/src/app/core/store/registration/registration.state.spec.ts b/projects/ccf-rui/src/app/core/store/registration/registration.state.spec.ts index 548fc598f..0a548a363 100644 --- a/projects/ccf-rui/src/app/core/store/registration/registration.state.spec.ts +++ b/projects/ccf-rui/src/app/core/store/registration/registration.state.spec.ts @@ -133,7 +133,12 @@ describe('RegistrationState', () => { { provide: ReferenceDataState, useValue: { state$: referenceDataStateSubject, - snapshot: initialReferenceDataState + snapshot: initialReferenceDataState, + getSourceDB: () => ( + { + subscribe: () => undefined + } + ) } }, { diff --git a/projects/ccf-rui/src/app/core/store/registration/registration.state.ts b/projects/ccf-rui/src/app/core/store/registration/registration.state.ts index 474eb6479..a090710ea 100644 --- a/projects/ccf-rui/src/app/core/store/registration/registration.state.ts +++ b/projects/ccf-rui/src/app/core/store/registration/registration.state.ts @@ -141,17 +141,19 @@ export class RegistrationState extends NgxsImmutableDataRepository this.ctx.patchState({ - useRegistrationCallback: !!(!useDownload && register) - })) - ).subscribe(); - - this.globalConfig.getOption('editRegistration').pipe( - filterNulls(), - tap(reg => this.editRegistration(reg as SpatialEntityJsonLd)) - ).subscribe(); + this.refData.state$.subscribe(() => { + this.globalConfig.config$.pipe( + take(1), + tap(({ useDownload, register }) => this.ctx.patchState({ + useRegistrationCallback: !!(!useDownload && register) + })) + ).subscribe(); + + this.globalConfig.getOption('editRegistration').pipe( + filterNulls(), + tap(reg => this.editRegistration(reg as SpatialEntityJsonLd)) + ).subscribe(); + }); } async editRegistration(reg: SpatialEntityJsonLd): Promise { diff --git a/projects/ccf-rui/src/app/modules/header/header.component.spec.ts b/projects/ccf-rui/src/app/modules/header/header.component.spec.ts deleted file mode 100644 index 9f099223d..000000000 --- a/projects/ccf-rui/src/app/modules/header/header.component.spec.ts +++ /dev/null @@ -1,3 +0,0 @@ -describe('HeaderComponent', () => { - // Add tests -}); diff --git a/projects/ccf-rui/src/app/modules/right-sidebar/right-sidebar.component.spec.ts b/projects/ccf-rui/src/app/modules/right-sidebar/right-sidebar.component.spec.ts deleted file mode 100644 index 7fc59fc8b..000000000 --- a/projects/ccf-rui/src/app/modules/right-sidebar/right-sidebar.component.spec.ts +++ /dev/null @@ -1,3 +0,0 @@ -describe('RightSidebarComponent', () => { - // Add tests -}); diff --git a/projects/ccf-rui/src/app/shared/components/drawer/container/container.component.spec.ts b/projects/ccf-rui/src/app/shared/components/drawer/container/container.component.spec.ts deleted file mode 100644 index 59dcc4371..000000000 --- a/projects/ccf-rui/src/app/shared/components/drawer/container/container.component.spec.ts +++ /dev/null @@ -1,3 +0,0 @@ -describe('ContainerComponent', () => { - // Add tests -}); diff --git a/projects/ccf-rui/src/app/shared/components/drawer/content/content.component.spec.ts b/projects/ccf-rui/src/app/shared/components/drawer/content/content.component.spec.ts deleted file mode 100644 index 57f4eee0e..000000000 --- a/projects/ccf-rui/src/app/shared/components/drawer/content/content.component.spec.ts +++ /dev/null @@ -1,3 +0,0 @@ -describe('ContentComponent', () => { - // Add tests -}); diff --git a/projects/ccf-rui/src/app/shared/components/drawer/drawer/drawer.component.spec.ts b/projects/ccf-rui/src/app/shared/components/drawer/drawer/drawer.component.spec.ts deleted file mode 100644 index 62a823fbb..000000000 --- a/projects/ccf-rui/src/app/shared/components/drawer/drawer/drawer.component.spec.ts +++ /dev/null @@ -1,3 +0,0 @@ -describe('DrawerComponent', () => { - // Add tests -}); diff --git a/projects/ccf-rui/src/app/shared/components/drawer/toggle-button/toggle-button.component.spec.ts b/projects/ccf-rui/src/app/shared/components/drawer/toggle-button/toggle-button.component.spec.ts deleted file mode 100644 index 0cb3476ba..000000000 --- a/projects/ccf-rui/src/app/shared/components/drawer/toggle-button/toggle-button.component.spec.ts +++ /dev/null @@ -1,3 +0,0 @@ -describe('ToggleButtonComponent', () => { - // Add tests -}); diff --git a/projects/ccf-rui/src/index.html b/projects/ccf-rui/src/index.html index 056f12a3d..86f66f2ef 100644 --- a/projects/ccf-rui/src/index.html +++ b/projects/ccf-rui/src/index.html @@ -4,6 +4,10 @@ HuBMAP CCF Registration User Interface (CCF-RUI) + + + + - - - - diff --git a/projects/ccf-rui/src/webcomponent-async-inject-example.html b/projects/ccf-rui/src/webcomponent-async-inject-example.html new file mode 100644 index 000000000..28d3813eb --- /dev/null +++ b/projects/ccf-rui/src/webcomponent-async-inject-example.html @@ -0,0 +1,79 @@ + + + + + HuBMAP CCF Registration User Interface (CCF-RUI) + + + + + + + + + + + diff --git a/projects/ccf-rui/src/webcomponent-example.html b/projects/ccf-rui/src/webcomponent-example.html index 39a10df13..d59893903 100644 --- a/projects/ccf-rui/src/webcomponent-example.html +++ b/projects/ccf-rui/src/webcomponent-example.html @@ -8,8 +8,6 @@ - - -