From fc98bf57965fae174a7e04f402cf557284815288 Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Tue, 7 Feb 2023 12:57:22 +0100 Subject: [PATCH 1/3] MOBILE-4077 ReportBuilder: Sort reports list and update lang strings --- scripts/langindex.json | 6 +++--- src/core/features/reportbuilder/classes/reports-source.ts | 2 +- src/core/features/reportbuilder/lang.json | 2 +- src/core/features/reportbuilder/pages/list/list.html | 2 +- .../reportbuilder/services/handlers/reportbuilder.ts | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/langindex.json b/scripts/langindex.json index 325e56d42..b451b9660 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -1653,9 +1653,9 @@ "core.currentdevice": "local_moodlemobileapp", "core.custom": "form", "core.reportbuilder.modifiedby": "tool_reportbuilder", - "core.reportbuilder.reportstab": "tool_reportbuilder", - "core.reportbuilder.reportsource": "tool_reportbuilder", - "core.reportbuilder.timecreated": "tool_reportbuilder", + "core.reportbuilder.reports": "moodle", + "core.reportbuilder.reportsource": "moodle", + "core.reportbuilder.timecreated": "moodle", "core.reportbuilder.showcolumns": "local_moodlemobileapp", "core.reportbuilder.hidecolumns": "local_moodlemobileapp", "core.datastoredoffline": "local_moodlemobileapp", diff --git a/src/core/features/reportbuilder/classes/reports-source.ts b/src/core/features/reportbuilder/classes/reports-source.ts index 31449689f..04f5e27ae 100644 --- a/src/core/features/reportbuilder/classes/reports-source.ts +++ b/src/core/features/reportbuilder/classes/reports-source.ts @@ -41,7 +41,7 @@ export class CoreReportBuilderReportsSource extends CoreRoutedItemsManagerSource */ protected setItems(reports: CoreReportBuilderReport[], hasMoreItems: boolean): void { const sortedReports = reports.slice(0); - reports.sort((a, b) => a.timecreated < b.timecreated ? 1 : -1); + sortedReports.sort((a, b) => a.timemodified < b.timemodified ? 1 : -1); super.setItems(sortedReports, hasMoreItems); } diff --git a/src/core/features/reportbuilder/lang.json b/src/core/features/reportbuilder/lang.json index 299a7a10f..3ff518a5f 100644 --- a/src/core/features/reportbuilder/lang.json +++ b/src/core/features/reportbuilder/lang.json @@ -1,6 +1,6 @@ { "modifiedby": "Modified by", - "reportstab": "Reports", + "reports": "Reports", "reportsource": "Report source", "timecreated": "Time created", "showcolumns": "Show columns", diff --git a/src/core/features/reportbuilder/pages/list/list.html b/src/core/features/reportbuilder/pages/list/list.html index 832fc49d5..85295b1b6 100644 --- a/src/core/features/reportbuilder/pages/list/list.html +++ b/src/core/features/reportbuilder/pages/list/list.html @@ -4,7 +4,7 @@ -

{{ 'core.reportbuilder.reportstab' | translate }}

+

{{ 'core.reportbuilder.reports' | translate }}

diff --git a/src/core/features/reportbuilder/services/handlers/reportbuilder.ts b/src/core/features/reportbuilder/services/handlers/reportbuilder.ts index 4a463f46e..9aacb15ab 100644 --- a/src/core/features/reportbuilder/services/handlers/reportbuilder.ts +++ b/src/core/features/reportbuilder/services/handlers/reportbuilder.ts @@ -45,11 +45,11 @@ export class CoreReportBuilderHandlerService implements CoreUserProfileHandler { return { class: 'core-report-builder', icon: 'fa-list-alt', - title: 'core.reportbuilder.reportstab', + title: 'core.reportbuilder.reports', action: async (event): Promise => { event.preventDefault(); event.stopPropagation(); - await CoreNavigator.navigate(`/${CoreReportBuilderHandlerService.PAGE_NAME}`); + await CoreNavigator.navigateToSitePath(CoreReportBuilderHandlerService.PAGE_NAME); }, }; } From 9a16548826eba30841b40c08feebabc6b9f187f1 Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Tue, 7 Feb 2023 12:58:00 +0100 Subject: [PATCH 2/3] MOBILE-4077 ReportBuilder: Fix routing in mainmenu --- .../features/reportbuilder/reportbuilder.module.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/features/reportbuilder/reportbuilder.module.ts b/src/core/features/reportbuilder/reportbuilder.module.ts index 833c8df1f..06dfaedf2 100644 --- a/src/core/features/reportbuilder/reportbuilder.module.ts +++ b/src/core/features/reportbuilder/reportbuilder.module.ts @@ -13,7 +13,9 @@ // limitations under the License. import { APP_INITIALIZER, NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; +import { Routes } from '@angular/router'; +import { CoreMainMenuRoutingModule } from '@features/mainmenu/mainmenu-routing.module'; +import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreUserDelegate } from '@features/user/services/user-delegate'; import { CoreReportBuilderHandler, CoreReportBuilderHandlerService } from './services/handlers/reportbuilder'; @@ -25,7 +27,11 @@ const routes: Routes = [ ]; @NgModule({ - imports: [RouterModule.forChild(routes)], + imports: [ + CoreMainMenuRoutingModule.forChild({ children: routes }), + CoreMainMenuTabRoutingModule.forChild(routes), + ], + exports: [CoreMainMenuRoutingModule], providers: [ { provide: APP_INITIALIZER, From cbbc5d0aaeaa72f728f6101d98597d4db1fcd0c7 Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Tue, 7 Feb 2023 14:53:52 +0100 Subject: [PATCH 3/3] MOBILE-4077 ReportBuilder: Add filter advice in report-summary --- scripts/langindex.json | 1 + .../report-summary/report-summary.html | 17 +++++++++++++---- .../report-summary/report-summary.scss | 14 ++++++++++++++ .../components/report-summary/report-summary.ts | 1 + src/core/features/reportbuilder/lang.json | 1 + .../reportbuilder/reportbuilder.module.ts | 1 - 6 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 src/core/features/reportbuilder/components/report-summary/report-summary.scss diff --git a/scripts/langindex.json b/scripts/langindex.json index b451b9660..bc5b434d3 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -1656,6 +1656,7 @@ "core.reportbuilder.reports": "moodle", "core.reportbuilder.reportsource": "moodle", "core.reportbuilder.timecreated": "moodle", + "core.reportbuilder.filtersapplied": "local_moodlemobileapp", "core.reportbuilder.showcolumns": "local_moodlemobileapp", "core.reportbuilder.hidecolumns": "local_moodlemobileapp", "core.datastoredoffline": "local_moodlemobileapp", diff --git a/src/core/features/reportbuilder/components/report-summary/report-summary.html b/src/core/features/reportbuilder/components/report-summary/report-summary.html index 7c37437c4..162a46a58 100644 --- a/src/core/features/reportbuilder/components/report-summary/report-summary.html +++ b/src/core/features/reportbuilder/components/report-summary/report-summary.html @@ -22,10 +22,6 @@ - - - @@ -37,3 +33,16 @@ + + + + +

+ + + +

+
+
+
diff --git a/src/core/features/reportbuilder/components/report-summary/report-summary.scss b/src/core/features/reportbuilder/components/report-summary/report-summary.scss new file mode 100644 index 000000000..32bb1fe4e --- /dev/null +++ b/src/core/features/reportbuilder/components/report-summary/report-summary.scss @@ -0,0 +1,14 @@ +@import "~theme/globals"; + +.filters-info { + padding-bottom: 1rem; +} + +ion-footer { + ion-icon { + font-size: 16px; + color: $blue; + margin-right: .3rem; + vertical-align: middle; + } +} diff --git a/src/core/features/reportbuilder/components/report-summary/report-summary.ts b/src/core/features/reportbuilder/components/report-summary/report-summary.ts index 712914e3a..a08e8cd95 100644 --- a/src/core/features/reportbuilder/components/report-summary/report-summary.ts +++ b/src/core/features/reportbuilder/components/report-summary/report-summary.ts @@ -21,6 +21,7 @@ import { ModalController } from '@singletons'; @Component({ selector: 'core-report-builder-report-summary', templateUrl: './report-summary.html', + styleUrls: ['./report-summary.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class CoreReportBuilderReportSummaryComponent implements OnInit { diff --git a/src/core/features/reportbuilder/lang.json b/src/core/features/reportbuilder/lang.json index 3ff518a5f..08f70940e 100644 --- a/src/core/features/reportbuilder/lang.json +++ b/src/core/features/reportbuilder/lang.json @@ -1,6 +1,7 @@ { "modifiedby": "Modified by", "reports": "Reports", + "filtersapplied": "There may be filters applied to this view. To edit filters or change the sorting order, open this report on your browser.", "reportsource": "Report source", "timecreated": "Time created", "showcolumns": "Show columns", diff --git a/src/core/features/reportbuilder/reportbuilder.module.ts b/src/core/features/reportbuilder/reportbuilder.module.ts index 06dfaedf2..a905a6ced 100644 --- a/src/core/features/reportbuilder/reportbuilder.module.ts +++ b/src/core/features/reportbuilder/reportbuilder.module.ts @@ -28,7 +28,6 @@ const routes: Routes = [ @NgModule({ imports: [ - CoreMainMenuRoutingModule.forChild({ children: routes }), CoreMainMenuTabRoutingModule.forChild(routes), ], exports: [CoreMainMenuRoutingModule],