type refactor and sql compatibility

This commit is contained in:
Timo Bejan 2021-09-30 09:37:22 +03:00
parent e7541a00d4
commit 4d51e8475d
6 changed files with 17 additions and 8 deletions

View File

@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, TemplateRef } from '@angular/core';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, TemplateRef } from '@angular/core';
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
import { IqserEventTarget } from '@iqser/common-ui';
@ -8,7 +8,7 @@ import { IqserEventTarget } from '@iqser/common-ui';
styleUrls: ['./annotations-list.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AnnotationsListComponent {
export class AnnotationsListComponent implements OnChanges {
@Input() annotations: AnnotationWrapper[];
@Input() selectedAnnotations: AnnotationWrapper[];
@Input() annotationActionsTemplate: TemplateRef<unknown>;
@ -45,4 +45,8 @@ export class AnnotationsListComponent {
isSelected(annotationId: string): boolean {
return !!this.selectedAnnotations?.find(a => a?.annotationId === annotationId);
}
ngOnChanges(changes: any): void {
console.log('changeeees', changes);
}
}

View File

@ -173,7 +173,6 @@
<redaction-annotations-list
(deselectAnnotations)="deselectAnnotations.emit($event)"
(pagesPanelActive)="pagesPanelActive = $event"
(selectAnnotations)="selectAnnotations.emit($event)"
[(multiSelectActive)]="multiSelectActive"
[activeViewerPage]="activeViewerPage"
[annotationActionsTemplate]="annotationActionsTemplate"
@ -196,7 +195,7 @@
<ng-template #annotationFilterActionTemplate let-filter="filter">
<iqser-circle-button
(action)="toggleSkipped.emit($event)"
*ngIf="filter.key === 'skipped'"
*ngIf="filter.id === 'skipped'"
[icon]="hideSkipped ? 'red:visibility-off' : 'red:visibility'"
[type]="circleButtonTypes.dark"
></iqser-circle-button>

View File

@ -57,6 +57,7 @@ export class FileWorkloadComponent {
@Input()
set annotations(value: AnnotationWrapper[]) {
console.log(value);
this._annotations$.next(value);
}
@ -95,6 +96,7 @@ export class FileWorkloadComponent {
private get _displayedAnnotations$(): Observable<Map<number, AnnotationWrapper[]>> {
const primary$ = this._filterService.getFilterModels$('primaryFilters');
const secondary$ = this._filterService.getFilterModels$('secondaryFilters');
console.log('============', primary$, secondary$);
return combineLatest([this._annotations$, primary$, secondary$]).pipe(
map(([annotations, primary, secondary]) => this._filterAnnotations(annotations, primary, secondary))
);
@ -231,6 +233,7 @@ export class FileWorkloadComponent {
primary: INestedFilter[],
secondary: INestedFilter[] = []
): Map<number, AnnotationWrapper[]> {
console.log(this.displayedAnnotations, this.displayedPages, this.annotations);
if (!primary) {
return;
}

View File

@ -198,7 +198,7 @@
<ng-template #annotationFilterTemplate let-filter="filter">
<redaction-type-filter *ngIf="filter.topLevelFilter" [filter]="filter"></redaction-type-filter>
<ng-container *ngIf="!filter.topLevelFilter">
<redaction-dictionary-annotation-icon [dictionaryKey]="filter.key"></redaction-dictionary-annotation-icon>
{{ filter.key | humanize: false }}
<redaction-dictionary-annotation-icon [dictionaryKey]="filter.id"></redaction-dictionary-annotation-icon>
{{ filter.id | humanize: false }}
</ng-container>
</ng-template>

View File

@ -289,6 +289,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
this.annotationData = newAnnotationsData;
const annotationFilters = this._annotationProcessingService.getAnnotationFilter(this.annotations);
const primaryFilters = this._filterService.getGroup('primaryFilters')?.filters;
console.log(annotationFilters);
this._filterService.addFilterGroup({
slug: 'primaryFilters',
filterTemplate: this._filterTemplate,
@ -300,6 +301,8 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
filterTemplate: this._filterTemplate,
filters: processFilters(secondaryFilters, AnnotationProcessingService.secondaryAnnotationFilters)
});
console.log(this.annotations);
console.log(this.appStateService.activeFile);
console.log('[REDACTION] Process time: ' + (new Date().getTime() - processStartTime) + 'ms');
console.log(
'[REDACTION] Annotation Redraw and filter rebuild time: ' +

View File

@ -1,7 +1,7 @@
{
"ADMIN_CONTACT_NAME": null,
"ADMIN_CONTACT_URL": null,
"API_URL": "https://dom1.iqser.cloud/redaction-gateway-v1",
"API_URL": "https://dev-06.iqser.cloud/redaction-gateway-v1",
"APP_NAME": "RedactManager",
"AUTO_READ_TIME": 1.5,
"BACKEND_APP_VERSION": "4.4.40",
@ -17,7 +17,7 @@
"MAX_RETRIES_ON_SERVER_ERROR": 3,
"OAUTH_CLIENT_ID": "redaction",
"OAUTH_IDP_HINT": null,
"OAUTH_URL": "https://dom1.iqser.cloud/auth/realms/redaction",
"OAUTH_URL": "https://dev-06.iqser.cloud/auth/realms/redaction",
"RECENT_PERIOD_IN_HOURS": 24,
"SELECTION_MODE": "structural"
}