Skip to content

Commit

Permalink
Merge pull request #609 from ReliefApplications/dev-refactor-models
Browse files Browse the repository at this point in the history
Dev refactor models
  • Loading branch information
bamoure authored Apr 30, 2019
2 parents c5ba5e7 + 69cb280 commit 72ff042
Show file tree
Hide file tree
Showing 338 changed files with 15,814 additions and 16,257 deletions.
109 changes: 78 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions src/app/app-injector.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {Injector} from '@angular/core';

/**
* Allows for retrieving singletons using `AppInjector.get(MyService)` (whereas
* `ReflectiveInjector.resolveAndCreate(MyService)` would create a new instance
* of the service).
*/
export let AppInjector: Injector;

/**
* Helper to set the exported {@link AppInjector}, needed as ES6 modules export
* immutable bindings (see http://2ality.com/2015/07/es6-module-exports.html) for
* which trying to make changes after using `import {AppInjector}` would throw:
* "TS2539: Cannot assign to 'AppInjector' because it is not a variable".
*/
export function setAppInjector(injector: Injector) {
if (AppInjector) {
// Should not happen
console.error('Programming error: AppInjector was already set');
}
else {
AppInjector = injector;
}
}
28 changes: 14 additions & 14 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@
<mat-list-item *ngIf="!smallScreenMode" routerLink="/">
<img src="assets/images/bms_logo.png" mat-list-icon>
</mat-list-item>
<mat-list-item [ngClass]="{selected: router.url ==='/'}" routerLink="/">
<span class="full-width" *ngIf="isShowing">{{menu.home | titlecase}}</span>
<mat-list-item [ngClass]="{selected: matchUrl() === ''}" routerLink="/">
<span class="full-width" *ngIf="isShowing">{{language.home | titlecase}}</span>
<mat-icon mat-list-icon>home</mat-icon>
</mat-list-item>
<mat-list-item [ngClass]="{selected: router.url ==='/projects'}" routerLink="/projects">
<span class="full-width" *ngIf="isShowing">{{menu.projects | titlecase}}</span>
<mat-list-item [ngClass]="{selected: matchUrl() === 'projects'}" routerLink="/projects">
<span class="full-width" *ngIf="isShowing">{{language.projects | titlecase}}</span>
<mat-icon mat-list-icon>assignment</mat-icon>
</mat-list-item>
<mat-list-item [ngClass]="{selected: router.url ==='/beneficiaries'}" routerLink="/beneficiaries">
<span class="full-width" *ngIf="isShowing">{{menu.beneficiaries | titlecase}}</span>
<mat-list-item [ngClass]="{selected: matchUrl() === 'beneficiaries'}" routerLink="/beneficiaries">
<span class="full-width" *ngIf="isShowing">{{language.beneficiaries | titlecase}}</span>
<mat-icon mat-list-icon>supervisor_account</mat-icon>
</mat-list-item>
<mat-list-item [ngClass]="{selected: router.url ==='/reports'}" routerLink="/reports">
<span class="full-width" *ngIf="isShowing">{{menu.reports | titlecase}}</span>
<mat-list-item [ngClass]="{selected: matchUrl() === 'reports'}" routerLink="/reports">
<span class="full-width" *ngIf="isShowing">{{language.reports | titlecase}}</span>
<mat-icon mat-list-icon>timeline</mat-icon>
</mat-list-item>
<!-- <mat-list-item [ngClass]="{selected: router.url ==='/vouchers'}" routerLink="/vouchers">
<span class="full-width" *ngIf="isShowing">{{menu.voucher | titlecase}}</span>
<mat-list-item [ngClass]="{selected: matchUrl() === 'vouchers'}" routerLink="/vouchers">
<span class="full-width" *ngIf="isShowing">{{language.voucher | titlecase}}</span>
<mat-icon mat-list-icon>local_activity</mat-icon>
</mat-list-item> -->
<mat-list-item *ngIf="userService.hasRights('ROLE_VIEW_ADMIN_SETTINGS')" [ngClass]="{selected: router.url ==='/settings'}" routerLink="/settings">
<span class="full-width" *ngIf="isShowing">{{menu.settings | titlecase}}</span>
</mat-list-item>
<mat-list-item *ngIf="userService.hasRights('ROLE_VIEW_ADMIN_SETTINGS')" [ngClass]="{selected: matchUrl() === 'settings'}" routerLink="/settings">
<span class="full-width" *ngIf="isShowing">{{language.settings | titlecase}}</span>
<mat-icon mat-list-icon>settings</mat-icon>
</mat-list-item>
</mat-nav-list>
</mat-sidenav>


<mat-sidenav-content class="page-content-wrapper" [ngClass]="{noMargin: !smallScreenMode && router.url ==='/login'}">
<mat-sidenav-content class="page-content-wrapper" [ngClass]="{'no-margin': !smallScreenMode && router.url ==='/login'}">
<mat-toolbar *ngIf="!smallScreenMode && router.url !=='/login'">
<app-header *ngIf="userService.currentUser"></app-header>
</mat-toolbar>
Expand Down
5 changes: 3 additions & 2 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
}
}

mat-sidenav-content.noMargin {
margin:0 !important;
mat-sidenav-content.no-margin {
margin: 0 !important;
}

@media only screen and (max-width: 750px) {
Expand All @@ -88,3 +88,4 @@ mat-sidenav-content.noMargin {
}
}
}

Loading

0 comments on commit 72ff042

Please sign in to comment.