Skip to content

Commit

Permalink
Merge pull request #51 from Resgrid/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ucswift authored Aug 18, 2024
2 parents 7c30514 + 483598d commit 5761e43
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 80 deletions.
11 changes: 0 additions & 11 deletions android/.idea/other.xml

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

3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@
"cli": {
"schematicCollections": [
"@ionic/angular-toolkit"
]
],
"analytics": false
},
"schematics": {
"@ionic/angular-toolkit:component": {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@ngx-translate/core": "14.0.0",
"@ngx-translate/http-loader": "6.0.0",
"@resgrid/local-notifications": "^1.0.4",
"@resgrid/ngx-resgridlib": "^1.3.34",
"@resgrid/ngx-resgridlib": "^1.3.35",
"@resgrid/push-notifications": "^1.0.5",
"@sentry/angular": "^8.7.0",
"@sentry/tracing": "^7.114.0",
Expand Down
24 changes: 14 additions & 10 deletions src/app/components/call-card/call-card.component.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<div class="bookings">
<ion-row style="padding-bottom: 10px; border-bottom: 1px solid lightgray;">
<ion-row>
<ion-col size="2">
<ion-label class="call-number">
{{ call?.Number }}
</ion-label>
</ion-col>
<ion-col size="10">
<ion-label class="call-name">{{ call?.Name }}</ion-label>
<ion-label class="call-nature" [innerHtml]="call?.Nature">
</ion-label>
</ion-col>
<ion-col size="2">
<ion-label class="call-number" style="float:right;">
{{ call?.Number }}
</ion-row>
<ion-row style="padding-bottom: 10px; border-bottom: 1px solid lightgray;">
<ion-col size="11">
<ion-label class="call-nature" [innerHtml]="call?.Nature">
</ion-label>
</ion-col>
</ion-row>
<ion-row style="padding: 10px; border-bottom: 1px solid lightgray;">
<ion-col size="6">
<ion-label class="call-address">{{ call?.Address }}</ion-label>
<ion-label class="call-priority" [style.color]="getColor()">{{getPriorityName()}}</ion-label>
<ion-label class="call-date-time">{{ getDate(call?.LoggedOn) }}</ion-label>
<ion-label class="call-date-time">{{ call?.LoggedOnUtc | rgTimeAgoUtc }}</ion-label>
</ion-col>
<ion-col size="6">
<ion-label class="call-priority" [style.color]="getColor()">{{getPriorityName()}}</ion-label>
<ion-label class="date-time">{{ getDate(call?.LoggedOn) }}</ion-label>
<ion-label class="date-time">{{ call?.LoggedOnUtc | rgTimeAgoUtc }}</ion-label>
<ion-label class="call-address">{{ call?.Address }}</ion-label>
</ion-col>
</ion-row>
</div>
10 changes: 5 additions & 5 deletions src/app/components/call-card/call-card.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.call-name {
display: block;
font-size: 16px;
text-align: left;
text-align: right;
overflow: hidden;
}

Expand All @@ -25,7 +25,7 @@
font-size: 12px;
white-space: nowrap;
color: gray;
text-align: right;
text-align: left;
}

.call-address {
Expand All @@ -36,7 +36,7 @@
.call-priority {
display: block;
font-size: 16px;
text-align: right;
text-align: left;
overflow: hidden;
}

Expand All @@ -46,10 +46,10 @@
text-align: left;
}

.date-time {
.call-date-time {
font-size: 12px;
display: block;
text-align: right;
text-align: left;
color: var(--ion-color-primary);
}
}
62 changes: 31 additions & 31 deletions src/app/components/person-card/person-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import { environment } from '../../../environments/environment';
export class PersonCardComponent implements OnInit {
@Input() person: PersonnelInfoResultData;

constructor(private utilsProvider: UtilsService,
private elementRef: ElementRef, private renderer: Renderer2
) {}
constructor(private utilsProvider: UtilsService, private elementRef: ElementRef, private renderer: Renderer2) {}

ngOnInit() {}

Expand All @@ -40,44 +38,46 @@ export class PersonCardComponent implements OnInit {
adjustColor(color: string) {
if (color) {
//const btnElement = (<HTMLElement>this.elementRef.nativeElement).querySelector('[data-id="bodyEle"]');

const isDarkMode = this.elementRef.nativeElement.closest('body').classList.contains('dark');//btnElement.classList.contains('dark');
if (isDarkMode) {
if (this.utilsProvider.isColorDark(color)) {
return this.LightenDarkenColor(color, 80);
} else {
return color;
const bodyElement = this.elementRef.nativeElement.closest('body');

if (bodyElement && bodyElement.classList) {
const isDarkMode = bodyElement.classList.contains('dark'); //btnElement.classList.contains('dark');
if (isDarkMode) {
if (this.utilsProvider.isColorDark(color)) {
return this.LightenDarkenColor(color, 80);
} else {
return color;
}
}
}

return color;
}
}

private LightenDarkenColor(col,amt) {
private LightenDarkenColor(col, amt) {
var usePound = false;
if ( col[0] == "#" ) {
if (col[0] == '#') {
col = col.slice(1);
usePound = true;
}
var num = parseInt(col,16);

var num = parseInt(col, 16);

var r = (num >> 16) + amt;
if ( r > 255 ) r = 255;
else if (r < 0) r = 0;
var b = ((num >> 8) & 0x00FF) + amt;
if ( b > 255 ) b = 255;
else if (b < 0) b = 0;
var g = (num & 0x0000FF) + amt;
if ( g > 255 ) g = 255;
else if ( g < 0 ) g = 0;
return (usePound?"#":"") + (g | (b << 8) | (r << 16)).toString(16);

if (r > 255) r = 255;
else if (r < 0) r = 0;

var b = ((num >> 8) & 0x00ff) + amt;

if (b > 255) b = 255;
else if (b < 0) b = 0;

var g = (num & 0x0000ff) + amt;

if (g > 255) g = 255;
else if (g < 0) g = 0;

return (usePound ? '#' : '') + (g | (b << 8) | (r << 16)).toString(16);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ion-icon name="close-outline"></ion-icon>
</ion-fab-button>
</ion-fab>
<div class="container safe-area">
<div class="container ion-padding the-form" style="padding-top: 40px;">
<ion-grid style="margin-left: 10px; margin-right: 10px;">
<ion-row>
<ion-col>
Expand Down
4 changes: 2 additions & 2 deletions src/app/features/settings/modals/about/modal-about.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class ModalAboutPage implements OnInit {

ngOnInit() {
this.storageService.getServerAddress().then(serverAddress => {
if (serverAddress) {
this.serverAddress = serverAddress;
if (serverAddress && serverAddress.trim() !== '' && serverAddress.trim() !== 'undefined' && serverAddress.trim() !== 'null') {
this.serverAddress = serverAddress.trim();
} else {
this.serverAddress = 'https://api.resgrid.com';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<ion-icon name="close-outline"></ion-icon>
</ion-fab-button>
</ion-fab>
<div class="container ion-padding the-form">
<div class="container ion-padding the-form" style="padding-top: 40px;">
<ion-grid style="margin-left: 10px; margin-right: 10px;">
<ion-row class="ion-padding-top">
<ion-col>
The default server address is https://api.resgrid.com and should be unchanged unless you are using a custom server.
The default server address is https://api.resgrid.com and should be unchanged unless you are using a custom
server.
</ion-col>
</ion-row>
<ion-row>
Expand All @@ -20,13 +21,16 @@
<ion-input formControlName="serverAddress"></ion-input>
</ion-item>
</div>
<div class="errors-container" *ngIf="serverForm.get('serverAddress').invalid && (serverForm.get('serverAddress').dirty || serverForm.get('serverAddress').touched)">
<ng-container *ngIf="serverForm.get('serverAddress').errors.required">Server Address is required</ng-container>
<div class="errors-container"
*ngIf="serverForm.get('serverAddress').invalid && (serverForm.get('serverAddress').dirty || serverForm.get('serverAddress').touched)">
<ng-container *ngIf="serverForm.get('serverAddress').errors.required">Server Address is
required</ng-container>
<ng-container *ngIf="serverForm.get('serverAddress').errors.invalidUrl">
{{serverForm.get('serverAddress').errors.message}}
</ng-container>
</div>
<ion-button [disabled]="serverForm.invalid" class="action-button" expand="block" fill="solid" color="primary" type="submit">
<ion-button [disabled]="serverForm.invalid" class="action-button" expand="block" fill="solid"
color="primary" type="submit">
<span>Set Server and Validate</span>
</ion-button>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export class ModalServerInfoPage implements OnInit {
});

this.storageService.getServerAddress().then(serverAddress => {
if (serverAddress) {
this.serverForm.controls['serverAddress'].setValue(serverAddress);
this.serverForm.controls['serverAddress'].patchValue(serverAddress);
if (serverAddress && serverAddress.trim() !== '' && serverAddress.trim() !== 'undefined' && serverAddress.trim() !== 'null') {
this.serverForm.controls['serverAddress'].setValue(serverAddress.trim());
this.serverForm.controls['serverAddress'].patchValue(serverAddress.trim());
}
});
}
Expand Down
12 changes: 6 additions & 6 deletions src/app/features/settings/pages/settings/settings.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ <h2>{{'settingsPage.logOutInfoLabel' | translate}}</h2>
<h2>{{'settingsPage.darkThemeLabel' | translate}}</h2>
<p>{{'settingsPage.darkThemeText' | translate}}</p>
</ion-label>
<ion-select item-end placeholder="Default" (ngModelChange)="setPerferDarkMode($event)" [(ngModel)]="themePreference">
<ion-select-option value="-1">Default</ion-select-option>
<ion-select slot="end" padding placeholder="Default" (ngModelChange)="setPerferDarkMode($event)" [(ngModel)]="themePreference">
<ion-select-option value="-1">System</ion-select-option>
<ion-select-option value="0">Light</ion-select-option>
<ion-select-option value="1">Dark</ion-select-option>
</ion-select>
Expand All @@ -74,7 +74,7 @@ <h2>{{'settingsPage.darkThemeLabel' | translate}}</h2>
<h2>{{'settingsPage.keepActiveLabel' | translate}}</h2>
<p>{{'settingsPage.keepActiveText' | translate}}</p>
</ion-label>
<ion-toggle item-end color="primary" [checked]="keepAlive$ | async" (ionChange)="setKeepAlive($event)"></ion-toggle>
<ion-toggle slot="end" padding color="primary" [checked]="keepAlive$ | async" (ionChange)="setKeepAlive($event)"></ion-toggle>
</ion-item>
<ion-item lines="none">
<ion-avatar slot="start" class="green-bg">
Expand All @@ -84,7 +84,7 @@ <h2>{{'settingsPage.keepActiveLabel' | translate}}</h2>
<h2>{{'settingsPage.locationUpdatesLabel' | translate}}</h2>
<p>{{'settingsPage.locationUpdatesText' | translate}}</p>
</ion-label>
<ion-toggle item-end color="primary" [checked]="realtimeGeolocationEnabled$ | async" (ionChange)="setSendLocationUpdates($event)"></ion-toggle>
<ion-toggle slot="end" padding color="primary" [checked]="realtimeGeolocationEnabled$ | async" (ionChange)="setSendLocationUpdates($event)"></ion-toggle>
</ion-item>
<ion-item lines="none">
<ion-avatar slot="start" class="red-bg">
Expand All @@ -94,7 +94,7 @@ <h2>{{'settingsPage.locationUpdatesLabel' | translate}}</h2>
<h2>{{'settingsPage.backgroundGeolocationLabel' | translate}}</h2>
<p>{{'settingsPage.backgroundGeolocationText' | translate}}</p>
</ion-label>
<ion-toggle item-end color="primary" [checked]="backgroundGeolocationEnabled$ | async" (ionChange)="setBackgroundGeolocation($event)"></ion-toggle>
<ion-toggle slot="end" padding color="primary" [checked]="backgroundGeolocationEnabled$ | async" (ionChange)="setBackgroundGeolocation($event)"></ion-toggle>
</ion-item>
<ion-item lines="none" *ngIf="(settingsState$ | async).loggedIn">
<ion-avatar slot="start" class="gray-bg">
Expand All @@ -104,7 +104,7 @@ <h2>{{'settingsPage.backgroundGeolocationLabel' | translate}}</h2>
<h2>{{'settingsPage.pushNotificationsLabel' | translate}}</h2>
<p>{{'settingsPage.pushNotificationsText' | translate}}</p>
</ion-label>
<ion-toggle item-end color="primary" [checked]="pushNotificationEnabled$ | async" (ionChange)="setPushNotification($event)"></ion-toggle>
<ion-toggle slot="end" padding color="primary" [checked]="pushNotificationEnabled$ | async" (ionChange)="setPushNotification($event)"></ion-toggle>
</ion-item>
</ion-list>
</ion-col>
Expand Down
Binary file added src/assets/images/defaultProfile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5761e43

Please sign in to comment.