Skip to content

Commit

Permalink
Merge pull request #1206 from Aam-Digital/tracking-install
Browse files Browse the repository at this point in the history
small fixes
  • Loading branch information
TheSlimvReal authored Apr 14, 2022
2 parents c642b12 + 7771289 commit 95c0eb9
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
[records]="records"
[columns]="columns"
[showEntity]="showDetails.bind(this)"
[getBackgroundColor]="getBackgroundColor"
[editable]="false"
>
</app-entity-subrecord>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,8 @@ export class ActivityAttendanceSectionComponent
forChild: this.forChild,
});
}

getBackgroundColor?: (rec: ActivityAttendance) => string = (
rec: ActivityAttendance
) => rec.getColor(this.forChild);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { AttendanceLogicalStatus } from "./attendance-status";
import { RecurringActivity } from "./recurring-activity";
import { defaultAttendanceStatusTypes } from "../../../core/config/default-config/default-attendance-status-types";
import { EventNote } from "./event-note";
import { WarningLevel } from "../../../core/entity/model/warning-level";
import {
getWarningLevelColor,
WarningLevel,
} from "../../../core/entity/model/warning-level";
import { Entity } from "../../../core/entity/model/entity";

/**
Expand Down Expand Up @@ -214,6 +217,10 @@ export class ActivityAttendance extends Entity {
return WarningLevel.OK;
}
}

public getColor(forChildId?: string): string {
return getWarningLevelColor(this.getWarningLevel(forChildId));
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/app/core/ui/ui/ui.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ app-search {
.site-logo {
width: 180px;
padding: 8px;
margin: auto;
}

.user-nav-button {
Expand Down
3 changes: 3 additions & 0 deletions src/app/pwa-install/pwa-install.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
mat-button
class="pwa-install-button"
style="background-color: #ff9800"
angulartics2On="click"
angularticsCategory="UserAction"
angularticsAction="install_app"
fxFlex
(click)="pwaInstallButtonClicked()"
>
Expand Down
4 changes: 2 additions & 2 deletions src/app/pwa-install/pwa-install.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { PwaInstallComponent } from "./pwa-install.component";
import { PwaInstallModule } from "./pwa-install.module";
import { PwaInstallService, PWAInstallType } from "./pwa-install.service";
import { MatSnackBar } from "@angular/material/snack-bar";
import { FontAwesomeTestingModule } from "@fortawesome/angular-fontawesome/testing";
import { Subject } from "rxjs";
import { take } from "rxjs/operators";
import { MockedTestingModule } from "../utils/mocked-testing.module";

describe("PwaInstallComponent", () => {
let mockPWAInstallService: jasmine.SpyObj<PwaInstallService>;
Expand All @@ -20,7 +20,7 @@ describe("PwaInstallComponent", () => {
);
mockSnackbar = jasmine.createSpyObj(["openFromTemplate"]);
await TestBed.configureTestingModule({
imports: [PwaInstallModule, FontAwesomeTestingModule],
imports: [PwaInstallModule, MockedTestingModule],
providers: [
{ provide: PwaInstallService, useValue: mockPWAInstallService },
{ provide: MatSnackBar, useValue: mockSnackbar },
Expand Down
2 changes: 2 additions & 0 deletions src/app/pwa-install/pwa-install.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { MatToolbarModule } from "@angular/material/toolbar";
import { PwaInstallService } from "./pwa-install.service";
import { MatSnackBarModule } from "@angular/material/snack-bar";
import { WINDOW_TOKEN } from "../utils/di-tokens";
import { Angulartics2Module } from "angulartics2";
@NgModule({
declarations: [PwaInstallComponent],
imports: [
Expand All @@ -21,6 +22,7 @@ import { WINDOW_TOKEN } from "../utils/di-tokens";
MatSidenavModule,
MatToolbarModule,
MatSnackBarModule,
Angulartics2Module,
],
providers: [PwaInstallService, { provide: WINDOW_TOKEN, useValue: window }],
exports: [PwaInstallComponent],
Expand Down

0 comments on commit 95c0eb9

Please sign in to comment.