Skip to content

Commit

Permalink
CU-8688mq6hw updated rglib
Browse files Browse the repository at this point in the history
  • Loading branch information
ucswift committed May 30, 2024
1 parent 0aae83c commit 0778717
Show file tree
Hide file tree
Showing 8 changed files with 246 additions and 24 deletions.
223 changes: 207 additions & 16 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@ngrx/store-devtools": "14.3.3",
"@ngx-translate/core": "14.0.0",
"@ngx-translate/http-loader": "6.0.0",
"@resgrid/ngx-resgridlib": "^1.3.29",
"@resgrid/ngx-resgridlib": "^1.3.33",
"@sentry/angular": "^7.75.1",
"@sentry/tracing": "^7.75.1",
"@turf/turf": "6.5.0",
Expand Down
7 changes: 5 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { ScrollDirective } from './directives/scroll.directive';
import { ScrollingModule } from '@angular/cdk/scrolling';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { Preferences } from '@capacitor/preferences';
import { ModuleStorageProvider } from './providers/moduleStorage';

export function createTranslateLoader(http: HttpClient): any {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
Expand All @@ -56,7 +57,8 @@ const getBaseUrl = (): string => {

const storedValue = localStorage.getItem('CapacitorStorage.serverAddress');

if (storedValue) {
if (storedValue && storedValue.trim() !== '' && storedValue.trim() !== 'undefined' && storedValue.trim() !== 'null'){
console.log('Using stored server address: ' + storedValue.trim());
return storedValue.trim();
}
return environment.baseApiUrl;
Expand All @@ -81,7 +83,8 @@ const getBaseUrl = (): string => {
realtimeGeolocationHubName: environment.realtimeGeolocationHubName,
logLevel: environment.logLevel,
isMobileApp: true,
cacheProvider: new CacheProvider()
cacheProvider: new CacheProvider(),
storageProvider: new ModuleStorageProvider()
}),
StoreModule.forRoot(reducers, { metaReducers }),
EffectsModule.forRoot([]),
Expand Down
1 change: 0 additions & 1 deletion src/app/features/calls/effects/calls.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
CallFilesService,
CallNotesService,
CallsService,
KazooVoiceService,
MessagesService,
SaveUnitStatusInput,
UnitStatusService,
Expand Down
1 change: 0 additions & 1 deletion src/app/features/statuses/effects/statuses.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
import { Injectable } from '@angular/core';
import { from, Observable, of } from 'rxjs';
import {
KazooVoiceService,
PersonnelStaffingService,
PersonnelStatusesService,
SavePersonsStatusesInput,
Expand Down
1 change: 0 additions & 1 deletion src/app/features/voice/effects/voice.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { Injectable } from '@angular/core';
import { from, Observable, of } from 'rxjs';
import { VoiceState } from '../store/voice.store';
import {
KazooVoiceService,
VoiceService,
} from '@resgrid/ngx-resgridlib';
import { HomeState } from '../../home/store/home.store';
Expand Down
31 changes: 31 additions & 0 deletions src/app/providers/moduleStorage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Injectable } from '@angular/core';
import { IStorageProvider, UtilsService } from '@resgrid/ngx-resgridlib';
import { StartupData } from '../features/settings/models/startupData';
import { LoginResult } from '../models/loginResult';
import { Preferences } from '@capacitor/preferences';

@Injectable({
providedIn: 'root',
})
export class ModuleStorageProvider implements IStorageProvider {
public async read(key: string): Promise<string> {
const { value } = await Preferences?.get({ key: key });

return value;
}

public async write(key: string, value: string): Promise<void> {
return await Preferences?.set({
key: key,
value: value,
});
}

public async remove(key: string): Promise<void> {
return await Preferences?.remove({key: key});
}

public async clear(): Promise<any> {
return await Preferences?.clear();
}
}
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ if (environment.loggingKey && environment.loggingKey !== 'LOGGINGKEY') {
// which automatically instruments your application to monitor its
// performance, including custom Angular routing instrumentation
new Integrations.BrowserTracing({
tracingOrigins: ['localhost', 'https://api.resgrid.com/api'],
tracingOrigins: ['localhost', 'https://api.resgrid.com/api', 'https://qaapi.resgrid.com/api'],
routingInstrumentation: Sentry.routingInstrumentation,
}),
],

// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 0.2,
tracesSampleRate: environment.production ? 0.4 : 1.0,
});
}

Expand Down

0 comments on commit 0778717

Please sign in to comment.