fix: multiple bugs in home/core/institution modules (#1225)

Fixes: #1224
This commit is contained in:
Karan Takalkar
2020-08-25 02:16:25 +05:30
committed by GitHub
parent 2f654ef664
commit f215e1aa96
32 changed files with 80 additions and 69 deletions
+2
View File
@@ -34,6 +34,7 @@ import { OrganizationModule } from './organization/organization.module';
import { TemplatesModule } from './templates/templates.module'; import { TemplatesModule } from './templates/templates.module';
import { UsersModule } from './users/users.module'; import { UsersModule } from './users/users.module';
import { ReportsModule } from './reports/reports.module'; import { ReportsModule } from './reports/reports.module';
import { SearchModule } from './search/search.module';
import { NotificationsModule } from './notifications/notifications.module'; import { NotificationsModule } from './notifications/notifications.module';
import { CollectionsModule } from './collections/collections.module'; import { CollectionsModule } from './collections/collections.module';
import { ProfileModule } from './profile/profile.module'; import { ProfileModule } from './profile/profile.module';
@@ -73,6 +74,7 @@ import { AppRoutingModule } from './app-routing.module';
TemplatesModule, TemplatesModule,
UsersModule, UsersModule,
NotificationsModule, NotificationsModule,
SearchModule,
CollectionsModule, CollectionsModule,
TasksModule, TasksModule,
AppRoutingModule, AppRoutingModule,
@@ -107,6 +107,10 @@ const routes: Routes = [
centersActionData: CenterActionsResolver centersActionData: CenterActionsResolver
} }
}, },
{
path: 'savingsaccounts',
loadChildren: () => import('../savings/savings.module').then(m => m.SavingsModule)
}
] ]
} }
] ]
@@ -4,7 +4,7 @@
<div class="profile-image-container"> <div class="profile-image-container">
<div> <div>
<img mat-card-md-image class="profile-image" <img mat-card-md-image class="profile-image"
src='../../../assets/images/center_placeholder.png'> src='assets/images/center_placeholder.png'>
</div> </div>
</div> </div>
<div class="mat-typography center-card-title"> <div class="mat-typography center-card-title">
@@ -46,7 +46,7 @@
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="groupsColumns"></tr> <tr mat-header-row *matHeaderRowDef="groupsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: groupsColumns;"></tr> <tr mat-row *matRowDef="let row; columns: groupsColumns;" [routerLink]="['/groups', row.id, 'general']"></tr>
</table> </table>
</ng-container> </ng-container>
@@ -129,7 +129,7 @@
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="savingsAccountColumns"></tr> <tr mat-header-row *matHeaderRowDef="savingsAccountColumns"></tr>
<tr mat-row *matRowDef="let row; columns: savingsAccountColumns;"></tr> <tr mat-row *matRowDef="let row; columns: savingsAccountColumns;" [routerLink]="['../', 'savingsaccounts', row.id, 'transactions']"></tr>
</table> </table>
</ng-container> </ng-container>
@@ -314,7 +314,7 @@
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="closedSavingsColumns"></tr> <tr mat-header-row *matHeaderRowDef="closedSavingsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: closedSavingsColumns;"></tr> <tr mat-row *matRowDef="let row; columns: closedSavingsColumns;" [routerLink]="['../', 'savingsaccounts', row.id, 'transactions']"></tr>
</table> </table>
@@ -597,7 +597,7 @@
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="closedSharesColumns"></tr> <tr mat-header-row *matHeaderRowDef="closedSharesColumns"></tr>
<tr mat-row *matRowDef="let row; columns: closedSharesColumns;"></tr> <tr mat-row *matRowDef="let row; columns: closedSharesColumns;" [routerLink]="['../', 'shares-accounts', row.id, 'transactions']"></tr>
</table> </table>
@@ -6,10 +6,11 @@ import { FormGroup, FormBuilder, Validators } from '@angular/forms';
/** Custom Components */ /** Custom Components */
import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component'; import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component';
import { EditNotesDialogComponent } from '../custom-dialogs/edit-notes-dialog/edit-notes-dialog.component';
/** Custom Services */ /** Custom Services */
import { ClientsService } from '../../clients.service'; import { ClientsService } from '../../clients.service';
import { EditNotesDialogComponent } from '../custom-dialogs/edit-notes-dialog/edit-notes-dialog.component'; import { AuthenticationService } from 'app/core/authentication/authentication.service';
/** /**
* Notes Tab Component * Notes Tab Component
@@ -37,13 +38,16 @@ export class NotesTabComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route * @param {ActivatedRoute} route Activated Route
* @param {FormBuilder} formBuilder Form Builder * @param {FormBuilder} formBuilder Form Builder
* @param {ClientsService} clientsService Clients Service * @param {ClientsService} clientsService Clients Service
* @param {AuthenticationService} authenticationService Authentication Service
* @param {MatDialog} dialog Mat Dialog * @param {MatDialog} dialog Mat Dialog
*/ */
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private formBuilder: FormBuilder, private formBuilder: FormBuilder,
private clientsService: ClientsService, private clientsService: ClientsService,
private authenticationService: AuthenticationService,
public dialog: MatDialog) { public dialog: MatDialog) {
this.username = JSON.parse(sessionStorage.getItem('mifosXCredentials')).username; const credentials = this.authenticationService.getCredentials();
this.username = credentials.username;
this.clientId = this.route.parent.snapshot.params['clientId']; this.clientId = this.route.parent.snapshot.params['clientId'];
this.route.data.subscribe((data: { clientNotes: any }) => { this.route.data.subscribe((data: { clientNotes: any }) => {
this.clientNotes = data.clientNotes; this.clientNotes = data.clientNotes;
-2
View File
@@ -46,8 +46,6 @@ import { ContentComponent } from './shell/content/content.component';
@NgModule({ @NgModule({
imports: [ imports: [
SharedModule, SharedModule,
SearchModule,
NotificationsModule,
HttpClientModule, HttpClientModule,
TranslateModule, TranslateModule,
RouterModule RouterModule
@@ -32,14 +32,13 @@
<div class="app-sidenav"> <div class="app-sidenav">
<!-- TODO: Generate frequently accessed routes dynamically -->
<div class="mt-1 mb-1 nav-item-sep"> <div class="mt-1 mb-1 nav-item-sep">
<mat-divider></mat-divider> <mat-divider></mat-divider>
<span class="text-muted icon-menu-title">Frequently Accessed</span> <span class="text-muted icon-menu-title">Frequently Accessed</span>
</div> </div>
<div class="icon-menu"> <div class="icon-menu">
<div class="icon-menu-item" *ngFor="let activity of mappedActivities"> <div class="icon-menu-item" *ngFor="let activity of mappedActivities">
<button mat-flat-button [matTooltip]="activity.toolTip" [routerLink]="[activity.path]"> <button mat-raised-button [matTooltip]="activity.toolTip" [routerLink]="[activity.path]">
<fa-icon [icon]="activity.icon" size="lg"></fa-icon> <fa-icon [icon]="activity.icon" size="lg"></fa-icon>
</button> </button>
</div> </div>
@@ -99,6 +98,12 @@
</mat-icon> </mat-icon>
<a matLine>Chart of Accounts</a> <a matLine>Chart of Accounts</a>
</mat-list-item> </mat-list-item>
<mat-list-item (click)="showKeyboardShortcuts()">
<mat-icon matListIcon>
<fa-icon icon="keyboard" size="sm"></fa-icon>
</mat-icon>
<a matLine>Keyboard Shortcuts</a>
</mat-list-item>
<mat-list-item> <mat-list-item>
<mat-icon matListIcon (click)="help()"> <mat-icon matListIcon (click)="help()">
<fa-icon icon="question-circle" size="sm"></fa-icon> <fa-icon icon="question-circle" size="sm"></fa-icon>
@@ -1,7 +1,11 @@
/** Angular Imports */ /** Angular Imports */
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
/** Custom Components */
import { KeyboardShortcutsDialogComponent } from 'app/shared/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component';
/** Custom Services */ /** Custom Services */
import { AuthenticationService } from '../../authentication/authentication.service'; import { AuthenticationService } from '../../authentication/authentication.service';
@@ -32,9 +36,11 @@ export class SidenavComponent implements OnInit {
/** /**
* @param {Router} router Router for navigation. * @param {Router} router Router for navigation.
* @param {MatDialog} dialog Mat Dialog
* @param {AuthenticationService} authenticationService Authentication Service. * @param {AuthenticationService} authenticationService Authentication Service.
*/ */
constructor(private router: Router, constructor(private router: Router,
public dialog: MatDialog,
private authenticationService: AuthenticationService) { private authenticationService: AuthenticationService) {
this.userActivity = JSON.parse(localStorage.getItem('mifosXLocation')); this.userActivity = JSON.parse(localStorage.getItem('mifosXLocation'));
} }
@@ -63,6 +69,14 @@ export class SidenavComponent implements OnInit {
window.open('https://mifosforge.jira.com/wiki/spaces/docs/pages/52035622/User+Manual', '_blank'); window.open('https://mifosforge.jira.com/wiki/spaces/docs/pages/52035622/User+Manual', '_blank');
} }
/**
* Opens Keyboard shortcuts dialog.
*/
showKeyboardShortcuts() {
const dialogRef = this.dialog.open(KeyboardShortcutsDialogComponent);
dialogRef.afterClosed().subscribe((response: any) => {});
}
/** /**
* Returns top three frequent activities. * Returns top three frequent activities.
*/ */
@@ -49,10 +49,6 @@
<mifosx-notifications-tray fxHide.lt-md></mifosx-notifications-tray> <mifosx-notifications-tray fxHide.lt-md></mifosx-notifications-tray>
<button mat-icon-button class="ml-1 img-button" matTooltip="Keyboard Shortcuts" (click)="showKeyboardShortcuts()">
<img src="assets/images/keyboard_placeholder.png">
</button>
<button mat-icon-button class="ml-1 img-button" [matMenuTriggerFor]="applicationMenu"> <button mat-icon-button class="ml-1 img-button" [matMenuTriggerFor]="applicationMenu">
<img src="assets/images/user_placeholder.png"> <img src="assets/images/user_placeholder.png">
</button> </button>
@@ -11,7 +11,6 @@ import { map } from 'rxjs/operators';
/** Custom Services */ /** Custom Services */
import { AuthenticationService } from '../../authentication/authentication.service'; import { AuthenticationService } from '../../authentication/authentication.service';
import { KeyboardShortcutsDialogComponent } from 'app/shared/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component';
/** /**
* Toolbar component. * Toolbar component.
@@ -88,12 +87,4 @@ export class ToolbarComponent implements OnInit {
window.open('https://mifosforge.jira.com/wiki/spaces/docs/pages/52035622/User+Manual', '_blank'); window.open('https://mifosforge.jira.com/wiki/spaces/docs/pages/52035622/User+Manual', '_blank');
} }
/**
* Opens Keyboard shortcuts dialog.
*/
showKeyboardShortcuts() {
const dialogRef = this.dialog.open(KeyboardShortcutsDialogComponent);
dialogRef.afterClosed().subscribe((response: any) => {});
}
} }
+6 -1
View File
@@ -133,10 +133,15 @@ const routes: Routes = [
groupActionData: GroupActionsResolver groupActionData: GroupActionsResolver
} }
}, },
{
path: 'loans',
data: { title: extract('Loans'), breadcrumb: 'loans', routeParamBreadcrumb: false },
loadChildren: () => import('../loans/loans.module').then(m => m.LoansModule)
},
{ {
path: 'savingsaccounts', path: 'savingsaccounts',
loadChildren: () => import('../savings/savings.module').then(m => m.SavingsModule) loadChildren: () => import('../savings/savings.module').then(m => m.SavingsModule)
}, }
] ]
} }
] ]
@@ -136,7 +136,7 @@
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="openLoansColumns"></tr> <tr mat-header-row *matHeaderRowDef="openLoansColumns"></tr>
<tr mat-row *matRowDef="let row; columns: openLoansColumns;"></tr> <tr mat-row *matRowDef="let row; columns: openLoansColumns;" [routerLink]="['../', 'loans', row.id, 'general']"></tr>
</table> </table>
@@ -187,7 +187,7 @@
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="closedLoansColumns"></tr> <tr mat-header-row *matHeaderRowDef="closedLoansColumns"></tr>
<tr mat-row *matRowDef="let row; columns: closedLoansColumns;"></tr> <tr mat-row *matRowDef="let row; columns: closedLoansColumns;" [routerLink]="['../', 'loans', row.id, 'general']"></tr>
</table> </table>
@@ -280,7 +280,7 @@
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="closedSavingsColumns"></tr> <tr mat-header-row *matHeaderRowDef="closedSavingsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: closedSavingsColumns;"></tr> <tr mat-row *matRowDef="let row; columns: closedSavingsColumns;" [routerLink]="['../', 'savingsaccounts', row.id, 'transactions']"></tr>
</table> </table>
+9 -18
View File
@@ -37,21 +37,21 @@ export class KeyboardShortcutsConfiguration {
id: 'runReport' id: 'runReport'
}, },
// Checker Inbox & Pending Tasks - ctrl + alt + i // Checker Inbox & Pending Tasks - ctrl + alt + i
// { {
// title: 'Checker Inbox & Pending Tasks', title: 'Checker Inbox & Pending Tasks',
// ctrlKey: true, ctrlKey: true,
// shiftKey: false, shiftKey: false,
// altKey: true, altKey: true,
// key: 'i, key: 'i',
// route: '' route: 'checker-inbox-and-tasks/checker-inbox'
// }, },
// Collection Sheet- ctrl + alt + o // Collection Sheet- ctrl + alt + o
// { // {
// title: 'Collection Sheet', // title: 'Collection Sheet',
// ctrlKey: true, // ctrlKey: true,
// shiftKey: false, // shiftKey: false,
// altKey: true, // altKey: true,
// key: 'o, // key: 'o',
// route: '' // route: ''
// }, // },
// Create Client - ctrl + alt + c // Create Client - ctrl + alt + c
@@ -146,15 +146,6 @@ export class KeyboardShortcutsConfiguration {
route: '', route: '',
id: 'cancel' id: 'cancel'
}, },
// Search - alt + x
// {
// title: 'Search'
// ctrlKey: true,
// shiftKey: false,
// altKey: true,
// key: 88,
// route: ''
// },
// Help - ctrl + alt + h // Help - ctrl + alt + h
{ {
title: 'Help', title: 'Help',
@@ -6,8 +6,8 @@
<div class="profile-image-container"> <div class="profile-image-container">
<div> <div>
<img mat-card-md-image class="profile-image" matTooltip="Recurring Deposits Account" <img mat-card-md-image class="profile-image" matTooltip="Loans Account"
[src]="'assets/images/loans.png'"> [src]="'assets/images/loans_account_placeholder.png'">
</div> </div>
</div> </div>
@@ -8,23 +8,18 @@ import { NotificationsRoutingModule } from './notifications-routing.module';
/** Custom Components */ /** Custom Components */
import { NotificationsPageComponent } from './notifications-page/notifications-page.component'; import { NotificationsPageComponent } from './notifications-page/notifications-page.component';
import { NotificationsTrayComponent } from './notifications-tray/notifications-tray.component';
/** /**
* Notifications Module * Notifications Module
*/ */
@NgModule({ @NgModule({
declarations: [ declarations: [
NotificationsPageComponent, NotificationsPageComponent
NotificationsTrayComponent
], ],
imports: [ imports: [
SharedModule, SharedModule,
PipesModule, PipesModule,
NotificationsRoutingModule NotificationsRoutingModule
],
exports: [
NotificationsTrayComponent
] ]
}) })
export class NotificationsModule { } export class NotificationsModule { }
+4
View File
@@ -12,6 +12,10 @@ export class UrlToStringPipe implements PipeTransform {
transform(url: string): any { transform(url: string): any {
url = decodeURIComponent(url); url = decodeURIComponent(url);
if (url.includes('search?query')) {
const query = url.substring(url.indexOf('=') + 1, url.indexOf('&'));
return 'Search ' + query;
}
const urlSubstrings: string[] = url.slice(1).split('/'); const urlSubstrings: string[] = url.slice(1).split('/');
const stringRepresentation = const stringRepresentation =
urlSubstrings urlSubstrings
+1 -5
View File
@@ -6,20 +6,16 @@ import { SharedModule } from '../shared/shared.module';
import { SearchRoutingModule } from './search-routing.module'; import { SearchRoutingModule } from './search-routing.module';
/** Custom Components */ /** Custom Components */
import { SearchToolComponent } from './search-tool/search-tool.component';
import { SearchPageComponent } from './search-page/search-page.component'; import { SearchPageComponent } from './search-page/search-page.component';
/** /**
* Search Module * Search Module
*/ */
@NgModule({ @NgModule({
declarations: [SearchToolComponent, SearchPageComponent], declarations: [SearchPageComponent],
imports: [ imports: [
SharedModule, SharedModule,
SearchRoutingModule SearchRoutingModule
],
exports: [
SearchToolComponent
] ]
}) })
export class SearchModule { } export class SearchModule { }
+4 -2
View File
@@ -95,7 +95,8 @@ import {
faArrowDown, faArrowDown,
faFolderOpen, faFolderOpen,
faIdBadge, faIdBadge,
faAddressCard faAddressCard,
faKeyboard
} from '@fortawesome/free-solid-svg-icons'; } from '@fortawesome/free-solid-svg-icons';
/** /**
@@ -201,7 +202,8 @@ export class IconsModule {
faArrowDown, faArrowDown,
faFolderOpen, faFolderOpen,
faIdBadge, faIdBadge,
faAddressCard faAddressCard,
faKeyboard
); );
} }
@@ -18,6 +18,4 @@
<span class="time">[{{ notification.createdAt }}]</span> <span class="time">[{{ notification.createdAt }}]</span>
</button> </button>
<button mat-menu-item class="view-all" [routerLink]="['/notifications']">View All Notifications</button>
</mat-menu> </mat-menu>
@@ -10,10 +10,10 @@
[mat-menu-item] { [mat-menu-item] {
height: 5rem; height: 5rem;
line-height: 2.2rem; line-height: 2.2rem;
.time{ .time {
font-size: small; font-size: small;
} }
&.unread, &.view-all { &.unread {
background-color: #E0F7FF !important; background-color: #E0F7FF !important;
} }
} }
@@ -5,7 +5,7 @@ import { Component, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core';
import { forkJoin } from 'rxjs'; import { forkJoin } from 'rxjs';
/** Custom Services */ /** Custom Services */
import { NotificationsService } from '../notifications.service'; import { NotificationsService } from 'app/notifications/notifications.service';
/** /**
* Notifications Tray Component * Notifications Tray Component
+9 -3
View File
@@ -16,12 +16,14 @@ import { ChangePasswordDialogComponent } from './change-password-dialog/change-p
import { EnableDialogComponent } from './enable-dialog/enable-dialog.component'; import { EnableDialogComponent } from './enable-dialog/enable-dialog.component';
import { DisableDialogComponent } from './disable-dialog/disable-dialog.component'; import { DisableDialogComponent } from './disable-dialog/disable-dialog.component';
import { ConfirmationDialogComponent } from './confirmation-dialog/confirmation-dialog.component'; import { ConfirmationDialogComponent } from './confirmation-dialog/confirmation-dialog.component';
import { ErrorDialogComponent } from './error-dialog/error-dialog.component';
import { NotificationsTrayComponent } from './notifications-tray/notifications-tray.component';
import { SearchToolComponent } from './search-tool/search-tool.component';
import { KeyboardShortcutsDialogComponent } from './keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component'; import { KeyboardShortcutsDialogComponent } from './keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component';
/** Custom Modules */ /** Custom Modules */
import { IconsModule } from './icons.module'; import { IconsModule } from './icons.module';
import { MaterialModule } from './material.module'; import { MaterialModule } from './material.module';
import { ErrorDialogComponent } from './error-dialog/error-dialog.component';
/** /**
* Shared Module * Shared Module
@@ -49,19 +51,23 @@ import { ErrorDialogComponent } from './error-dialog/error-dialog.component';
DisableDialogComponent, DisableDialogComponent,
ConfirmationDialogComponent, ConfirmationDialogComponent,
KeyboardShortcutsDialogComponent, KeyboardShortcutsDialogComponent,
ErrorDialogComponent ErrorDialogComponent,
NotificationsTrayComponent,
SearchToolComponent
], ],
exports: [ exports: [
FileUploadComponent, FileUploadComponent,
FooterComponent, FooterComponent,
LanguageSelectorComponent, LanguageSelectorComponent,
ThemePickerComponent, ThemePickerComponent,
NotificationsTrayComponent,
SearchToolComponent,
ErrorDialogComponent,
CommonModule, CommonModule,
IconsModule, IconsModule,
MaterialModule, MaterialModule,
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
ErrorDialogComponent
] ]
}) })
export class SharedModule { } export class SharedModule { }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB