RED-4590 - sonar fixes

This commit is contained in:
Valentin Mihai 2022-07-18 16:34:55 +03:00
parent 02b0d96012
commit 97c6e331e2
17 changed files with 11 additions and 33 deletions

View File

@ -18,5 +18,5 @@ form {
/* target the input field inexplicably to throw Chrome's AI off.
* feel free to use a more complicated selector */
input[name='keySecret']:not(:placeholder-shown) {
font-family: 'secret';
font-family: 'secret', serif;
}

View File

@ -193,7 +193,7 @@ export class ComboSeriesVerticalComponent implements OnChanges {
return item !== undefined;
}
trackBy(index, bar): string {
trackBy(_index, bar): string {
return bar.label;
}
}

View File

@ -181,7 +181,6 @@ export class ConfigService {
) {
const allDistinctWorkflowFileStatuses = new Set<WorkflowFileStatus>();
const allDistinctPeople = new Set<string>();
const allDistinctAddedDates = new Set<string>();
const allDistinctNeedsWork = new Set<string>();
const allDistinctProcessingTypes = new Set<ProcessingType>();
@ -192,7 +191,6 @@ export class ConfigService {
entities.forEach(file => {
allDistinctPeople.add(file.assignee);
allDistinctWorkflowFileStatuses.add(file.workflowStatus);
allDistinctAddedDates.add(dayjs(file.added).format('DD/MM/YYYY'));
if (file.analysisRequired) {
allDistinctNeedsWork.add('analysis');

View File

@ -166,7 +166,7 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnDestroy
}
get #allPages() {
return Array.from({ length: this.file?.numberOfPages }, (x, i) => i + 1);
return Array.from({ length: this.file?.numberOfPages }, (_x, i) => i + 1);
}
private static _scrollToFirstElement(elements: HTMLElement[], mode: 'always' | 'if-needed' = 'if-needed') {

View File

@ -4,20 +4,6 @@
<div class="dialog-content">
<div translate="import-redactions-dialog.details" class="mb-24"></div>
<iqser-upload-file (fileChanged)="fileChanged($event)"></iqser-upload-file>
<!-- <div class="only-for-pages" *ngIf="fileToImport">-->
<!-- <mat-checkbox-->
<!-- (change)="onlyForSpecificPages = !onlyForSpecificPages"-->
<!-- [checked]="onlyForSpecificPages"-->
<!-- class="filter-menu-checkbox"-->
<!-- color="primary"-->
<!-- >-->
<!-- {{ 'import-redactions-dialog.only-for-specific-pages' | translate }}-->
<!-- </mat-checkbox>-->
<!-- <div *ngIf="onlyForSpecificPages" class="iqser-input-group datepicker-wrapper">-->
<!-- <input />-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="dialog-actions">

View File

@ -211,7 +211,8 @@ export class AnnotationActionsService {
return this.convertRecommendationToAnnotation($event, [recommendation]);
}
const text = annotation.rectangle ? annotation.value : annotation.isImage ? 'Image' : textAndPositions.text;
const isImageText = annotation.isImage ? 'Image' : textAndPositions.text;
const text = annotation.rectangle ? annotation.value : isImageText;
const data = { annotation, text };
this._dialogService.openDialog('resizeAnnotation', $event, data, (result: { comment: string; updateDictionary: boolean }) => {

View File

@ -22,7 +22,8 @@ import { type ManualRedactionEntryType } from '@models/file/manual-redaction-ent
import { NGXLogger } from 'ngx-logger';
function getResponseType(error: boolean, isConflict: boolean) {
return error ? (isConflict ? 'conflictError' : 'error') : 'success';
const isConflictError = isConflict ? 'conflictError' : 'error';
return error ? isConflictError : 'success';
}
function getDictionaryMessage(action: DictionaryActions, error = false, isConflict = false): string {

View File

@ -80,7 +80,7 @@ export class StampService {
watermark.orientation,
watermark.opacity,
watermark.hexColor,
Array.from({ length: await document.getPageCount() }, (x, i) => i + 1),
Array.from({ length: await document.getPageCount() }, (_x, i) => i + 1),
this._licenseService.activeLicenseKey,
);
}

View File

@ -16,9 +16,7 @@
<mat-icon svgIcon="iqser:search"></mat-icon>
</div>
<div *ngIf="searchText.length > 0" class="with-input">
<div class="search-match-text">
{{ currentMatch + '/' + findMatches.length }}
</div>
{{ currentMatch + '/' + findMatches.length }}
<mat-icon (click)="previousSearchMatch()" class="pointer" svgIcon="red:arrow-up"></mat-icon>
<mat-icon (click)="nextSearchMatch()" class="pointer" svgIcon="iqser:arrow-down"></mat-icon>
<mat-icon (click)="searchChanged(''); inputElement.focus()" class="pointer" svgIcon="iqser:close"></mat-icon>

View File

@ -72,9 +72,6 @@ form {
display: flex;
justify-content: center;
align-items: center;
.search-match-text {
}
}
mat-icon {

View File

@ -10,7 +10,7 @@ function getInitials(name: string) {
const splittedName = name.split(' ').filter(value => value !== ' ' && value !== '');
return splittedName
.filter((value, index) => index < 2)
.filter((_value, index) => index < 2)
.map(str => str[0])
.join('');
}

View File

@ -17,7 +17,6 @@ import { TrashDialogService } from '../services/trash-dialog.service';
@Component({
templateUrl: './trash-screen.component.html',
styleUrls: ['./trash-screen.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: listingProvidersFactory({
entitiesService: TrashService,

View File

@ -9,7 +9,6 @@ import { DOSSIER_ID } from '../../../tokens';
@Component({
templateUrl: './file-drop.component.html',
styleUrls: ['./file-drop.component.scss'],
})
export class FileDropComponent {
constructor(

View File

@ -3,7 +3,6 @@ import { MissingTranslationHandler, MissingTranslationHandlerParams } from '@ngx
export class REDMissingTranslationHandler implements MissingTranslationHandler {
handle(params: MissingTranslationHandlerParams): any {
const missingKey = params.key;
// console.error('Missing translation: ' + missingKey);
return `?${missingKey}?`;
}
}

@ -1 +1 @@
Subproject commit 477e8ea5ae97244703dbfe04a4ee98daa8d5f185
Subproject commit d3e45f5c9868f5ada0af084d93b42f9e92d68c5e