mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-10 14:11:17 +00:00
[ACS-10116] [ACA] Search page renders HTML from the Description,Title field instead of showing it as plain text
This commit is contained in:
@@ -29,6 +29,7 @@ import { first } from 'rxjs/operators';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
import { SearchResultsRowComponent } from './search-results-row.component';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { ResultNode } from '@alfresco/js-api/typings';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-datatable-cell-badges',
|
||||
@@ -241,7 +242,7 @@ describe('SearchResultsRowComponent', () => {
|
||||
});
|
||||
});
|
||||
|
||||
function createMaliciousEntry(overrides: any): ResultSetRowEntry {
|
||||
function createMaliciousEntry(overrides: Partial<ResultNode>): ResultSetRowEntry {
|
||||
return {
|
||||
entry: {
|
||||
id: 'test-entry',
|
||||
|
@@ -47,14 +47,6 @@ import { DomSanitizer } from '@angular/platform-browser';
|
||||
host: { class: 'aca-search-results-row' }
|
||||
})
|
||||
export class SearchResultsRowComponent implements OnInit {
|
||||
private settings = inject(AppSettingsService);
|
||||
private readonly sanitizer = inject(DomSanitizer);
|
||||
|
||||
private readonly highlightPrefix = "<span class='aca-highlight'>";
|
||||
private readonly highlightPostfix = '</span>';
|
||||
|
||||
private node: NodeEntry;
|
||||
|
||||
@Input({ required: true })
|
||||
context: any;
|
||||
|
||||
@@ -68,7 +60,13 @@ export class SearchResultsRowComponent implements OnInit {
|
||||
contentStripped = '';
|
||||
isFile = false;
|
||||
|
||||
private settings = inject(AppSettingsService);
|
||||
private node: NodeEntry;
|
||||
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
private readonly sanitizer = inject(DomSanitizer);
|
||||
private readonly highlightPrefix = "<span class='aca-highlight'>";
|
||||
private readonly highlightPostfix = '</span>';
|
||||
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
@@ -135,8 +133,6 @@ export class SearchResultsRowComponent implements OnInit {
|
||||
if (title !== name) {
|
||||
const sanitizedTitle = this.sanitizer.sanitize(SecurityContext.HTML, title);
|
||||
this.title$.next(sanitizedTitle ? ` ( ${sanitizedTitle} )` : '');
|
||||
this.title$.next(title ? ` ( ${title} )` : '');
|
||||
this.titleStripped = this.stripHighlighting(title);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user