From af73fc9a664f976abd2b9ffd1a8735827998c6c9 Mon Sep 17 00:00:00 2001 From: Mutugi <48474421+Mutugiii@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:37:07 +0300 Subject: [PATCH] all: smoother empty tables (fixes #7882) (#7883) Co-authored-by: dogi --- package.json | 6 +++--- src/app/courses/courses.component.html | 9 ++++----- src/app/courses/courses.component.ts | 3 --- .../enroll-courses/courses-enroll.component.html | 7 +------ .../enroll-courses/courses-enroll.component.ts | 2 -- src/app/feedback/feedback.component.html | 11 +++++------ src/app/feedback/feedback.component.ts | 2 -- src/app/health/health-list.component.html | 7 +------ src/app/health/health-list.component.ts | 2 -- .../certifications/certifications.component.html | 8 ++++---- .../certifications/certifications.component.ts | 2 -- .../manager-dashboard/manager-fetch.component.html | 8 ++++---- src/app/manager-dashboard/manager-fetch.component.ts | 2 -- src/app/meetups/meetups.component.html | 8 ++++---- src/app/meetups/meetups.component.ts | 2 -- src/app/notifications/notifications.component.html | 8 ++++---- src/app/notifications/notifications.component.ts | 2 -- src/app/resources/resources.component.html | 8 ++++---- src/app/resources/resources.component.ts | 3 --- src/app/submissions/submissions.component.html | 8 ++++---- src/app/submissions/submissions.component.ts | 3 --- src/app/surveys/surveys.component.html | 10 +++++----- src/app/surveys/surveys.component.ts | 2 -- src/app/teams/teams.component.html | 8 ++++---- src/app/teams/teams.component.ts | 2 -- src/app/users/users-table.component.html | 3 +++ src/app/users/users.component.html | 7 +------ src/app/users/users.component.ts | 1 - 28 files changed, 51 insertions(+), 93 deletions(-) diff --git a/package.json b/package.json index 5a3593831e..cd6d82b9d9 100755 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "planet", "license": "AGPL-3.0", - "version": "0.15.83", + "version": "0.15.84", "myplanet": { - "latest": "v0.21.28", - "min": "v0.20.28" + "latest": "v0.21.29", + "min": "v0.20.29" }, "scripts": { "ng": "ng", diff --git a/src/app/courses/courses.component.html b/src/app/courses/courses.component.html index 840bcd8da2..554f750401 100644 --- a/src/app/courses/courses.component.html +++ b/src/app/courses/courses.component.html @@ -104,7 +104,7 @@ -
+
@@ -231,15 +231,14 @@

+ +
No Course Found
+ -

- -
No Course Found
-
diff --git a/src/app/courses/courses.component.ts b/src/app/courses/courses.component.ts index 51f489444e..f036d867cb 100644 --- a/src/app/courses/courses.component.ts +++ b/src/app/courses/courses.component.ts @@ -88,7 +88,6 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes userShelf: any = []; private onDestroy$ = new Subject(); planetType = this.planetConfiguration.planetType; - emptyData = false; isAuthorized = false; tagFilter = new FormControl([]); tagFilterValue = []; @@ -158,7 +157,6 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes this.userShelf = this.userService.shelf; this.courses.data = this.setupList(courses, this.userShelf.courseIds) .filter((course: any) => this.excludeIds.indexOf(course._id) === -1); - this.emptyData = !this.courses.data.length; this.dialogsLoadingService.stop(); }); this.selection.changed.subscribe(({ source }) => { @@ -335,7 +333,6 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes removeFilteredFromSelection() { this.selection.deselect(...selectedOutOfFilter(this.courses.filteredData, this.selection, this.paginator)); - this.emptyData = this.courses.filteredData.length === 0; } onSearchChange({ items, category }) { diff --git a/src/app/courses/enroll-courses/courses-enroll.component.html b/src/app/courses/enroll-courses/courses-enroll.component.html index fab9af1283..e05788bd80 100644 --- a/src/app/courses/enroll-courses/courses-enroll.component.html +++ b/src/app/courses/enroll-courses/courses-enroll.component.html @@ -13,10 +13,5 @@ - - - - -
No User Found
-
+ diff --git a/src/app/courses/enroll-courses/courses-enroll.component.ts b/src/app/courses/enroll-courses/courses-enroll.component.ts index dbcb54e23d..79fc7e7319 100644 --- a/src/app/courses/enroll-courses/courses-enroll.component.ts +++ b/src/app/courses/enroll-courses/courses-enroll.component.ts @@ -22,7 +22,6 @@ export class CoursesEnrollComponent { course: any; members: any[] = []; tableState = new TableState(); - emptyData = false; userTableColumns = [ 'profile', 'name', @@ -82,7 +81,6 @@ export class CoursesEnrollComponent { ), planet: planets.find(planet => planet.doc.code === user.doc.planetCode) })).filter(doc => doc.planet !== undefined && (doc.activityDates.createdDate || shelfUsers.find((u: any) => u._id === doc._id))); - this.emptyData = this.members.length === 0; } exportCSV() { diff --git a/src/app/feedback/feedback.component.html b/src/app/feedback/feedback.component.html index f98b6ffdc2..3990964b1d 100644 --- a/src/app/feedback/feedback.component.html +++ b/src/app/feedback/feedback.component.html @@ -63,7 +63,7 @@ -
+
@@ -148,12 +148,11 @@ - - + + +
No Feedback Found
+
- -
No Feedback Found
-
diff --git a/src/app/feedback/feedback.component.ts b/src/app/feedback/feedback.component.ts index d7ac201d0c..494792b1d6 100644 --- a/src/app/feedback/feedback.component.ts +++ b/src/app/feedback/feedback.component.ts @@ -53,7 +53,6 @@ export class FeedbackComponent implements OnInit, AfterViewInit, OnDestroy { @ViewChild(MatSort) sort: MatSort; user: any = {}; private onDestroy$ = new Subject(); - emptyData = false; users = []; deviceType: DeviceType; deviceTypes: typeof DeviceType = DeviceType; @@ -115,7 +114,6 @@ export class FeedbackComponent implements OnInit, AfterViewInit, OnDestroy { const selector = !this.user.isUserAdmin ? { 'owner': this.user.name } : { '_id': { '$gt': null } }; this.couchService.findAll(this.dbName, findDocuments(selector, 0, [ { 'openTime': 'desc' } ])).subscribe((feedbackData: any[]) => { this.feedback.data = feedbackData.map(feedback => ({ ...feedback, user: this.users.find(u => u.doc.name === feedback.owner) })); - this.emptyData = !this.feedback.data.length; this.dialogsLoadingService.stop(); }, (error) => this.message = $localize`There is a problem of getting data.`); } diff --git a/src/app/health/health-list.component.html b/src/app/health/health-list.component.html index 4cbda7cc81..1ed73b87bd 100644 --- a/src/app/health/health-list.component.html +++ b/src/app/health/health-list.component.html @@ -10,10 +10,5 @@
- - - - -
No User Found
-
+
diff --git a/src/app/health/health-list.component.ts b/src/app/health/health-list.component.ts index 0cc6a03bc5..7b23924d05 100644 --- a/src/app/health/health-list.component.ts +++ b/src/app/health/health-list.component.ts @@ -16,7 +16,6 @@ export class HealthListComponent implements OnInit, OnDestroy { users: any[] = []; displayedColumns = [ 'profile', 'name', 'contact', 'birthDate', 'lastVisit' ]; tableState = new TableState(); - emptyData = true; healthRequests: string[] = []; constructor( @@ -29,7 +28,6 @@ export class HealthListComponent implements OnInit, OnDestroy { ngOnInit() { this.usersService.usersListener().pipe(takeUntil(this.onDestroy$)).subscribe(users => { this.users = users; - this.emptyData = this.users.length === 0; }); this.usersService.requestUserData(); } diff --git a/src/app/manager-dashboard/certifications/certifications.component.html b/src/app/manager-dashboard/certifications/certifications.component.html index 3b77224266..2795550906 100644 --- a/src/app/manager-dashboard/certifications/certifications.component.html +++ b/src/app/manager-dashboard/certifications/certifications.component.html @@ -15,7 +15,7 @@ add -
+
Certification Name @@ -34,13 +34,13 @@ + +
No Certifications Found
+
- -
No Certifications Found
-
diff --git a/src/app/manager-dashboard/certifications/certifications.component.ts b/src/app/manager-dashboard/certifications/certifications.component.ts index d2e0a06ef4..c1bccf735a 100644 --- a/src/app/manager-dashboard/certifications/certifications.component.ts +++ b/src/app/manager-dashboard/certifications/certifications.component.ts @@ -13,7 +13,6 @@ export class CertificationsComponent implements OnInit, AfterViewInit { certifications = new MatTableDataSource(); selection = new SelectionModel(true, []); - emptyData = false; displayedColumns = [ 'name', 'action' @@ -54,7 +53,6 @@ export class CertificationsComponent implements OnInit, AfterViewInit { getCertifications() { this.certificationsService.getCertifications().subscribe((certifications: any) => { this.certifications.data = certifications; - this.emptyData = !this.certifications.data.length; }); } diff --git a/src/app/manager-dashboard/manager-fetch.component.html b/src/app/manager-dashboard/manager-fetch.component.html index e8870be32b..285a4fdb5c 100644 --- a/src/app/manager-dashboard/manager-fetch.component.html +++ b/src/app/manager-dashboard/manager-fetch.component.html @@ -11,7 +11,7 @@ -
+
@@ -41,6 +41,9 @@ + +
No Record Found
+
- -
No Record Found
-
diff --git a/src/app/manager-dashboard/manager-fetch.component.ts b/src/app/manager-dashboard/manager-fetch.component.ts index 6d02ce7757..b2dde6d9c0 100644 --- a/src/app/manager-dashboard/manager-fetch.component.ts +++ b/src/app/manager-dashboard/manager-fetch.component.ts @@ -32,7 +32,6 @@ export class ManagerFetchComponent implements OnInit, AfterViewInit { planetConfiguration = this.stateService.configuration; displayedColumns = [ 'select', 'item', 'date' ]; pushedItems = new MatTableDataSource(); - emptyData = false; constructor( private couchService: CouchService, @@ -46,7 +45,6 @@ export class ManagerFetchComponent implements OnInit, AfterViewInit { ngOnInit() { this.managerService.getPushedList().subscribe((pushedList: any) => { this.pushedItems.data = pushedList; - this.emptyData = !this.pushedItems.data.length; }); } diff --git a/src/app/meetups/meetups.component.html b/src/app/meetups/meetups.component.html index f797434d05..36d84e5b81 100644 --- a/src/app/meetups/meetups.component.html +++ b/src/app/meetups/meetups.component.html @@ -34,7 +34,7 @@ -
+
@@ -103,6 +103,9 @@

+ +
No Meetups Found
+ (page)="onPaginateChange($event)">

- -
No Meetups Found
-
diff --git a/src/app/meetups/meetups.component.ts b/src/app/meetups/meetups.component.ts index 3bc929eee7..33210263a6 100644 --- a/src/app/meetups/meetups.component.ts +++ b/src/app/meetups/meetups.component.ts @@ -43,7 +43,6 @@ export class MeetupsComponent implements OnInit, AfterViewInit, OnDestroy { getOpts = this.parent ? { domain: this.stateService.configuration.parentDomain } : {}; pageEvent: PageEvent; currentUser = this.userService.get(); - emptyData = false; selectedNotJoined = 0; selectedJoined = 0; isAuthorized = false; @@ -69,7 +68,6 @@ export class MeetupsComponent implements OnInit, AfterViewInit, OnDestroy { // Sort in descending createdDate order, so the new meetup can be shown on the top meetups.sort((a, b) => b.createdDate - a.createdDate); this.meetups.data = meetups; - this.emptyData = !this.meetups.data.length; this.dialogsLoadingService.stop(); }); this.meetupService.updateMeetups({ opts: this.getOpts }); diff --git a/src/app/notifications/notifications.component.html b/src/app/notifications/notifications.component.html index 14635947b7..3788896032 100644 --- a/src/app/notifications/notifications.component.html +++ b/src/app/notifications/notifications.component.html @@ -11,7 +11,7 @@ - + @@ -37,13 +37,13 @@ + +
No Notification Found
+
- -
No Notification Found
-
diff --git a/src/app/notifications/notifications.component.ts b/src/app/notifications/notifications.component.ts index 0dec83f4c4..19198b770b 100644 --- a/src/app/notifications/notifications.component.ts +++ b/src/app/notifications/notifications.component.ts @@ -22,7 +22,6 @@ export class NotificationsComponent implements OnInit, AfterViewInit { notifications = new MatTableDataSource(); displayedColumns = [ 'message', 'read' ]; private onDestroy$ = new Subject(); - emptyData = false; notificationStatus = [ 'All', 'Read', 'Unread' ]; filter = { 'status': '' }; anyUnread = true; @@ -65,7 +64,6 @@ export class NotificationsComponent implements OnInit, AfterViewInit { .subscribe(notifications => { this.notifications.data = notifications; this.anyUnread = this.notifications.data.some(notification => notification.status === 'unread'); - this.emptyData = !this.notifications.data.length; }, (err) => console.log(err.error.reason)); } diff --git a/src/app/resources/resources.component.html b/src/app/resources/resources.component.html index 50375e431e..7d8ad39798 100644 --- a/src/app/resources/resources.component.html +++ b/src/app/resources/resources.component.html @@ -103,7 +103,7 @@ -
+
@@ -208,6 +208,9 @@

+ +
No Resource Found
+ (page)="onPaginateChange($event)">

- -
No Resource Found
-
diff --git a/src/app/resources/resources.component.ts b/src/app/resources/resources.component.ts index 27a9975646..91cae48c56 100644 --- a/src/app/resources/resources.component.ts +++ b/src/app/resources/resources.component.ts @@ -71,7 +71,6 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy { this.removeFilteredFromSelection(); } myView = this.route.snapshot.data.view; - emptyData = false; selectedNotAdded = 0; selectedAdded = 0; selectedSync = []; @@ -138,7 +137,6 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy { (resource.doc.private === true && (resource.doc.privateFor || {}).users === this.userService.get()._id) : resource.doc.private !== true) ); - this.emptyData = !this.resources.data.length; this.resources.paginator = this.paginator; this.dialogsLoadingService.stop(); }); @@ -168,7 +166,6 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy { removeFilteredFromSelection() { this.selection.deselect(...selectedOutOfFilter(this.resources.filteredData, this.selection, this.paginator)); - this.emptyData = this.resources.filteredData.length === 0; } diff --git a/src/app/submissions/submissions.component.html b/src/app/submissions/submissions.component.html index 2a977bab28..950e0b2fbf 100644 --- a/src/app/submissions/submissions.component.html +++ b/src/app/submissions/submissions.component.html @@ -54,7 +54,7 @@