Merge pull request #4007 from NoelDeMartin/MOBILE-4569

MOBILE-4569 grades: Remove actions menu
main
Dani Palou 2024-04-11 11:54:22 +02:00 committed by GitHub
commit fb1600aa66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View File

@ -118,6 +118,12 @@ export class CoreGradesHelperProvider {
row.gradeClass = column.class.includes('gradepass') ? 'text-success' :
(column.class.includes('gradefail') ? 'text-danger' : '');
if (content.includes('action-menu')) {
content = CoreTextUtils.processHTML(content, (element) => {
element.querySelector('.action-menu')?.parentElement?.remove();
});
}
if (content.includes('fa-check')) {
row.gradeIcon = 'fas-check';
row.gradeIconAlt = Translate.instant('core.grades.pass');

View File

@ -273,6 +273,21 @@ export class CoreTextUtilsProvider {
return Translate.instant('core.humanreadablesize', { size: bytes, unit: units[keys[pos]] });
}
/**
* Process HTML string.
*
* @param text HTML string.
* @param process Method to process the HTML.
* @returns Processed HTML string.
*/
processHTML(text: string, process: (element: HTMLElement) => unknown): string {
const element = this.convertToElement(text);
process(element);
return element.innerHTML;
}
/**
* Clean HTML tags.
*