Merge pull request #3553 from alfonso-salces/MOBILE-4077

MOBILE-4077 ReportBuilder: Fix report name format
main
Noel De Martin 2023-02-20 16:19:41 +01:00 committed by GitHub
commit 8c93c800e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 10 deletions

View File

@ -4,9 +4,10 @@
<ion-label>
<p class="item-heading" *ngIf="columnIndex !== 0 || (columnIndex === 0 && showFirstTitle)"> {{ header }} </p>
<h2 *ngIf="columnIndex === 0">
<core-format-text [text]="column" contextLevel="site" [contextInstanceId]="contextId"></core-format-text>
<core-format-text [text]="column" [contextLevel]="source" [contextInstanceId]="contextId"></core-format-text>
</h2>
<core-format-text *ngIf="columnIndex !== 0" [text]="column" contextLevel="site" [contextInstanceId]="contextId"></core-format-text>
<core-format-text *ngIf="columnIndex !== 0" [text]="column" [contextLevel]="source" [contextInstanceId]="contextId">
</core-format-text>
</ion-label>
<ion-icon [class.expandable-status-icon-expanded]="!isExpanded" slot="end" aria-hidden="true" name="fas-chevron-up"
class="expandable-status-icon" *ngIf="isExpandable" flip-rtl>

View File

@ -29,6 +29,7 @@ export class CoreReportBuilderReportColumnComponent implements OnInit {
@Input() column!: string | number;
@Input() contextId!: number;
@Input() header!: string;
@Input() source!: string;
@Output() onToggleRow: EventEmitter<number> = new EventEmitter();
ngOnInit(): void {

View File

@ -14,7 +14,7 @@
<core-report-builder-report-column *ngFor="let column of row.columns | slice:0:row.isExpanded ?
row.columns.length : state.cardVisibleColumns; let columnIndex = index" [columnIndex]="columnIndex"
[rowIndex]="rowIndex" [isExpandable]="columnIndex === 0 && row.columns.length > state.cardVisibleColumns"
[isExpanded]="row.isExpanded" [showFirstTitle]="state.cardviewShowFirstTitle"
[isExpanded]="row.isExpanded" [showFirstTitle]="state.cardviewShowFirstTitle" [source]="source$ | async"
[contextId]="state.report.details.contextid" [header]="state.report.data.headers[columnIndex]" [column]="column"
(onToggleRow)="toggleRow(rowIndex)">
</core-report-builder-report-column>
@ -34,7 +34,7 @@
<tbody>
<tr *ngFor="let row of state.report.data.rows">
<td *ngFor="let column of row.columns">
<core-format-text [text]="column" [contextLevel]="'site'"
<core-format-text [text]="column" [contextLevel]="source$ | async"
[contextInstanceId]="state.report.details.contextid">
</core-format-text>
</td>

View File

@ -25,7 +25,8 @@ import { CoreNavigator } from '@services/navigator';
import { CoreScreen } from '@services/screen';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreUtils } from '@services/utils/utils';
import { BehaviorSubject } from 'rxjs';
import { BehaviorSubject, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
@Component({
selector: 'core-report-builder-report-detail',
@ -55,6 +56,19 @@ export class CoreReportBuilderReportDetailComponent implements OnInit {
page: 0,
});
source$: Observable<string>;
constructor() {
this.source$ = this.state$.pipe(
map(state => {
const splittedSource = state.report?.details.source.split('\\');
const source = splittedSource?.[splittedSource?.length - 1];
return source ?? 'system';
}),
);
}
/**
* @inheritdoc
*/

View File

@ -39,9 +39,8 @@
<ion-label>
<p>
<ion-icon name="fas-info-circle" aria-hidden="true"></ion-icon>
<core-format-text [text]="'core.reportbuilder.filtersapplied' | translate: { $a: reportUrl }" contextLevel="report"
[contextInstanceId]="reportDetail.id">
</core-format-text>
<core-format-text [text]="'core.reportbuilder.filtersapplied' | translate: { $a: reportUrl }" [filter]="false"
[clean]="true"></core-format-text>
</p>
</ion-label>
</ion-item>

View File

@ -17,7 +17,9 @@
<ion-item [attr.aria-current]="reports.getItemAriaCurrent(report)" [detail]="true" class="ion-text-wrap" [button]="true"
*ngFor="let report of reports.items" (click)="reports.select(report)">
<ion-label>
<p class="item-heading">{{ report.name }}</p>
<p class="item-heading">
<core-format-text [clean]="true" [text]="report.name" [filter]="false"></core-format-text>
</p>
<p>{{ report.sourcename }}</p>
</ion-label>
</ion-item>

View File

@ -9,7 +9,9 @@
</ion-button>
</ion-buttons>
<ion-title *ngIf="reportDetail">
<h1> {{ reportDetail.name }} </h1>
<h1>
<core-format-text [clean]="true" [text]="reportDetail.name" [filter]="false"></core-format-text>
</h1>
<p class="subheading"> {{ reportDetail.sourcename }} </p>
</ion-title>
</ion-toolbar>