diff --git a/src/app/main/header/header.component.ts b/src/app/main/header/header.component.ts index 79969c4982..e869e22c7e 100644 --- a/src/app/main/header/header.component.ts +++ b/src/app/main/header/header.component.ts @@ -41,7 +41,7 @@ export class HeaderComponent implements OnInit, OnDestroy { private _session: SessionService ) { - // create tool icons to use them in mat-icons + // create own logo icon to use them in mat-icons this._matIconRegistry.addSvgIcon( 'dasch_icon_black', this._domSanitizer.bypassSecurityTrustResourceUrl('/assets/images/dasch-icon-black.svg') diff --git a/src/app/workspace/resource/representation/add-region-form/add-region-form.component.html b/src/app/workspace/resource/representation/add-region-form/add-region-form.component.html index df0675aa32..1012a91335 100644 --- a/src/app/workspace/resource/representation/add-region-form/add-region-form.component.html +++ b/src/app/workspace/resource/representation/add-region-form/add-region-form.component.html @@ -1,10 +1,10 @@
- Label * + Label - Comment * + Comment diff --git a/src/app/workspace/resource/representation/still-image/still-image.component.html b/src/app/workspace/resource/representation/still-image/still-image.component.html index 5587fa61a1..3e60c3308e 100644 --- a/src/app/workspace/resource/representation/still-image/still-image.component.html +++ b/src/app/workspace/resource/representation/still-image/still-image.component.html @@ -40,7 +40,7 @@ fullscreen diff --git a/src/app/workspace/resource/representation/still-image/still-image.component.spec.ts b/src/app/workspace/resource/representation/still-image/still-image.component.spec.ts index 117cf22da5..691a55edf5 100644 --- a/src/app/workspace/resource/representation/still-image/still-image.component.spec.ts +++ b/src/app/workspace/resource/representation/still-image/still-image.component.spec.ts @@ -1,3 +1,4 @@ +import { HttpClientModule } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; @@ -5,6 +6,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MatToolbarModule } from '@angular/material/toolbar'; import { By } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { Constants, ReadGeomValue, ReadResource, ReadValue } from '@dasch-swiss/dsp-js'; import { AppInitService } from 'src/app/app-init.service'; import { DspApiConnectionToken } from 'src/app/main/declarations/dsp-api-tokens'; @@ -120,8 +122,13 @@ describe('StillImageComponent', () => { }; TestBed.configureTestingModule({ - declarations: [StillImageComponent, TestHostComponent], + declarations: [ + StillImageComponent, + TestHostComponent + ], imports: [ + BrowserAnimationsModule, + HttpClientModule, MatDialogModule, MatIconModule, MatSnackBarModule, diff --git a/src/app/workspace/resource/representation/still-image/still-image.component.ts b/src/app/workspace/resource/representation/still-image/still-image.component.ts index 4332b749b2..e11152b7cf 100644 --- a/src/app/workspace/resource/representation/still-image/still-image.component.ts +++ b/src/app/workspace/resource/representation/still-image/still-image.component.ts @@ -10,23 +10,31 @@ import { SimpleChanges } from '@angular/core'; import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; +import { MatIconRegistry } from '@angular/material/icon'; +import { DomSanitizer } from '@angular/platform-browser'; import { - Constants, CreateColorValue, CreateGeomValue, CreateLinkValue, - CreateResource, CreateTextValueAsString, KnoraApiConnection, - Point2D, ReadColorValue, ReadFileValue, + Constants, + CreateColorValue, + CreateGeomValue, + CreateLinkValue, + CreateResource, + CreateTextValueAsString, + KnoraApiConnection, + Point2D, + ReadColorValue, + ReadFileValue, ReadGeomValue, ReadResource, ReadStillImageFileValue, - ReadValue, RegionGeometry } from '@dasch-swiss/dsp-js'; +import * as OpenSeadragon from 'openseadragon'; import { DspApiConnectionToken } from 'src/app/main/declarations/dsp-api-tokens'; import { DialogComponent } from 'src/app/main/dialog/dialog.component'; import { ErrorHandlerService } from 'src/app/main/error/error-handler.service'; +import { NotificationService } from 'src/app/main/services/notification.service'; import { DspCompoundPosition } from '../../dsp-resource'; import { FileRepresentation } from '../file-representation'; -import * as OpenSeadragon from 'openseadragon'; -import { NotificationService } from 'src/app/main/services/notification.service'; /** @@ -119,15 +127,23 @@ export class StillImageComponent implements OnChanges, OnDestroy { constructor( @Inject(DspApiConnectionToken) private _dspApiConnection: KnoraApiConnection, - private _elementRef: ElementRef, private _dialog: MatDialog, + private _domSanitizer: DomSanitizer, + private _elementRef: ElementRef, private _errorHandler: ErrorHandlerService, + private _matIconRegistry: MatIconRegistry, private _notification: NotificationService ) { OpenSeadragon.setString('Tooltips.Home', ''); OpenSeadragon.setString('Tooltips.ZoomIn', ''); OpenSeadragon.setString('Tooltips.ZoomOut', ''); OpenSeadragon.setString('Tooltips.FullPage', ''); + + // own draw region icon; because it does not exist in the material icons + this._matIconRegistry.addSvgIcon( + 'draw_region_icon', + this._domSanitizer.bypassSecurityTrustResourceUrl('/assets/images/draw-region-icon.svg') + ); } /** * calculates the surface of a rectangular region. diff --git a/src/assets/images/draw-region-icon.svg b/src/assets/images/draw-region-icon.svg new file mode 100644 index 0000000000..8192422b06 --- /dev/null +++ b/src/assets/images/draw-region-icon.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file