Skip to content

Commit

Permalink
refactor: remove unused code (#1586)
Browse files Browse the repository at this point in the history
  • Loading branch information
derschnee68 committed May 15, 2024
1 parent d4ea5fb commit 0b4b554
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
<as-split-area [size]="60" *ngIf="selectedResources?.count > 0" cdkScrollable>
<div [ngSwitch]="viewMode">
<!-- single resource view -->
<app-resource
*ngSwitchCase="'single'"
[resourceIri]="selectedResources.resInfo[0].id"
[splitSizeChanged]="splitSizeChanged"></app-resource>
<app-resource *ngSwitchCase="'single'" [resourceIri]="selectedResources.resInfo[0].id"></app-resource>

<!-- intermediate view -->
<app-intermediate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<as-split direction="vertical">
<as-split-area>
<!-- note: This part is repeating twice (not added as component) because angular-split
library does not support addition div inside as-split -->
library does not support addition div inside as-split -->
<as-split direction="horizontal" (dragEnd)="splitSizeChanged = $event">
<as-split-area *ngFor="let res of topRow">
<app-resource [resourceIri]="res" [splitSizeChanged]="splitSizeChanged"></app-resource>
<app-resource [resourceIri]="res"></app-resource>
</as-split-area>
</as-split>
</as-split-area>
<as-split-area *ngIf="noOfResources > 3">
<as-split direction="horizontal" (dragEnd)="splitSizeChanged = $event">
<as-split-area *ngFor="let res of bottomRow">
<app-resource [resourceIri]="res" [splitSizeChanged]="splitSizeChanged"></app-resource>
<app-resource [resourceIri]="res"></app-resource>
</as-split-area>
</as-split>
</as-split-area>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
EventEmitter,
Input,
OnInit,
Output,
} from '@angular/core';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { DeleteResourceResponse, PermissionUtil, ReadLinkValue, ReadProject, ReadValue } from '@dasch-swiss/dsp-js';
import { DeleteResourceResponse, PermissionUtil, ReadLinkValue, ReadProject } from '@dasch-swiss/dsp-js';
import { AdminProjectsApiService } from '@dasch-swiss/vre/open-api';
import { DspResource, ResourceService } from '@dasch-swiss/vre/shared/app-common';
import {
Expand Down Expand Up @@ -52,9 +44,6 @@ export class ResourceToolbarComponent implements OnInit {

@Input() lastModificationDate: string;

@Output() regionChanged: EventEmitter<ReadValue> = new EventEmitter<ReadValue>();
@Output() regionDeleted: EventEmitter<void> = new EventEmitter<void>();

userCanDelete: boolean;
userCanEdit: boolean;
canReadComments: boolean;
Expand Down Expand Up @@ -106,9 +95,6 @@ export class ResourceToolbarComponent implements OnInit {
.pipe(filter(answer => !!answer))
.subscribe(answer => {
this._componentCommsService.emit(new EmitEvent(CommsEvents.resourceChanged));
if (this.isAnnotation) {
this.regionChanged.emit();
}
this._cd.markForCheck();
});
}
Expand Down Expand Up @@ -154,10 +140,6 @@ export class ResourceToolbarComponent implements OnInit {
const classId = this.resource.res.entityInfo.classes[this.resource.res.type]?.id;
this._store.dispatch(new LoadClassItemsCountAction(ontologyIri, classId));
this._componentCommsService.emit(new EmitEvent(CommsEvents.resourceDeleted));
// if it is an Annotation/Region which has been erases, we emit the
// regionChanged event, in order to refresh the page
this.regionDeleted.emit();

this._cd.markForCheck();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import {
SimpleChange,
ViewChild,
} from '@angular/core';
import { SplitSize } from '../../../results/results.component';

export interface PointerValue {
position: number;
time: number;
}

/**
* this component can be used in video and audio players
*/
Expand All @@ -40,9 +40,6 @@ export class AvTimelineComponent implements OnChanges {
// disable in case of missing file
@Input() disabled: boolean;

// split size changed
@Input() splitSizeChanged: SplitSize;

// send click position to parent
@Output() changed = new EventEmitter<number>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
[min]="0"
[max]="duration"
[resized]="cinemaMode"
[splitSizeChanged]="splitSizeChanged"
(move)="updatePreview($event)"
(mouseenter)="displayPreview(true)"
(dimension)="timelineDimension = $event"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { DspApiConnectionToken } from '@dasch-swiss/vre/shared/app-config';
import { NotificationService } from '@dasch-swiss/vre/shared/app-notification';
import { mergeMap } from 'rxjs/operators';
import { DialogComponent } from '../../../../main/dialog/dialog.component';
import { SplitSize } from '../../../results/results.component';
import {
EmitEvent,
Events,
Expand All @@ -51,8 +50,6 @@ export class VideoComponent implements OnChanges, AfterViewInit {

@Input() parentResource: ReadResource;

@Input() splitSizeChanged: SplitSize;

@Output() loaded = new EventEmitter<boolean>();

@ViewChild('videoEle') videoEle: ElementRef;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
[resource]="resource"
[lastModificationDate]="resource.res.lastModificationDate"
[adminPermissions]="isAdmin$ | async"
[showEditLabel]="false"
(regionChanged)="regionChanged.emit()"
(regionDeleted)="regionDeleted.emit()"></app-resource-toolbar>
<!-- TODO uncomment this on top -->
[showEditLabel]="false"></app-resource-toolbar>
</div>
<div class="resource-label">
<h4>{{ resource.res.label }}</h4>
Expand All @@ -37,7 +34,7 @@ <h4>{{ resource.res.label }}</h4>
</div>
<div class="infobar mat-caption" *ngIf="(project$ | async) as project">
Resource of the project
<a class="link" [title]="project.longname" (click)="openProject(project)" (mouseover)="previewProject()">
<a class="link" [title]="project.longname" (click)="openProject(project)">
<strong>{{ project?.shortname }}</strong></a
><span *ngIf="resourceAttachedUser || resource.res.creationDate"
>, created
Expand Down Expand Up @@ -98,7 +95,6 @@ <h4>{{ resource.res.label }}</h4>
*ngSwitchCase="representationConstants.movingImage"
[src]="representationsToDisplay[0]"
[parentResource]="resource.res"
[splitSizeChanged]="splitSizeChanged"
(loaded)="representationLoaded($event)">
</app-video>

Expand Down

0 comments on commit 0b4b554

Please sign in to comment.