mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-03-12 01:32:12 +00:00
refactor: migrate all cordova plugins to capacitor
This commit is contained in:
committed by
Rainer Killinger
parent
cdb6ac4084
commit
75f4644940
@@ -30,6 +30,7 @@ import {Observable, of} from 'rxjs';
|
||||
import {StorageProvider} from '../../storage/storage.provider';
|
||||
import {DaiaDataProvider} from '../daia-data.provider';
|
||||
import {LoggerConfig, LoggerModule, NGXLogger} from 'ngx-logger';
|
||||
import {ConfigProvider} from '../../config/config.provider';
|
||||
|
||||
const translations: any = {data: {detail: {TITLE: 'Foo'}}};
|
||||
|
||||
@@ -46,6 +47,7 @@ describe('DaiaAvailabilityComponent', () => {
|
||||
let refresher: IonRefresher;
|
||||
const sampleThing = sampleThingsMap.book[0];
|
||||
let translateService: TranslateService;
|
||||
let configProviderMock: jasmine.SpyObj<ConfigProvider>;
|
||||
|
||||
// @Component({ selector: 'stapps-data-list-item', template: '' })
|
||||
// class DataListItemComponent {
|
||||
@@ -72,6 +74,11 @@ describe('DaiaAvailabilityComponent', () => {
|
||||
|
||||
beforeEach(
|
||||
waitForAsync(() => {
|
||||
configProviderMock = jasmine.createSpyObj('ConfigProvider', [
|
||||
'init',
|
||||
'getValue',
|
||||
'getAnyValue',
|
||||
]);
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
RouterModule.forRoot([], {relativeLinkResolution: 'legacy'}),
|
||||
@@ -91,6 +98,10 @@ describe('DaiaAvailabilityComponent', () => {
|
||||
provide: StorageProvider,
|
||||
useValue: storageProviderSpy,
|
||||
},
|
||||
{
|
||||
provide: ConfigProvider,
|
||||
useValue: configProviderMock,
|
||||
},
|
||||
NGXLogger,
|
||||
LoggerConfig,
|
||||
],
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import {Network} from '@ionic-native/network/ngx';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import {SCUuid} from '@openstapps/core';
|
||||
import {FavoritesService} from '../../favorites/favorites.service';
|
||||
@@ -41,7 +40,6 @@ export class DaiaAvailabilityComponent
|
||||
*
|
||||
* @param route the route the page was accessed from
|
||||
* @param dataProvider the data provider
|
||||
* @param network the network provider
|
||||
* @param favoritesService the favorites provider
|
||||
* @param translateService he translate provider
|
||||
* @param daiaDataProvider DaiaDataProvider
|
||||
@@ -49,19 +47,11 @@ export class DaiaAvailabilityComponent
|
||||
constructor(
|
||||
route: ActivatedRoute,
|
||||
dataProvider: DataProvider,
|
||||
network: Network,
|
||||
favoritesService: FavoritesService,
|
||||
translateService: TranslateService,
|
||||
private daiaDataProvider: DaiaDataProvider,
|
||||
) {
|
||||
super(route, dataProvider, network, favoritesService, translateService);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if we have internet
|
||||
*/
|
||||
isDisconnected(): boolean {
|
||||
return this.network.type === this.network.Connection.NONE;
|
||||
super(route, dataProvider, favoritesService, translateService);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018, 2019 StApps
|
||||
* Copyright (C) 2018-2022 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
import {Component} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import {Network} from '@ionic-native/network/ngx';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import {SCUuid} from '@openstapps/core';
|
||||
import {HebisDataProvider} from '../hebis-data.provider';
|
||||
@@ -38,7 +37,6 @@ export class HebisDetailComponent extends DataDetailComponent {
|
||||
*
|
||||
* @param route the route the page was accessed from
|
||||
* @param dataProvider the data provider
|
||||
* @param network the network provider
|
||||
* @param favoritesService the favorites provider
|
||||
* @param translateService he translate provider
|
||||
* @param hebisDataProvider HebisDataProvider
|
||||
@@ -46,19 +44,11 @@ export class HebisDetailComponent extends DataDetailComponent {
|
||||
constructor(
|
||||
route: ActivatedRoute,
|
||||
dataProvider: DataProvider,
|
||||
network: Network,
|
||||
favoritesService: FavoritesService,
|
||||
translateService: TranslateService,
|
||||
private hebisDataProvider: HebisDataProvider,
|
||||
) {
|
||||
super(route, dataProvider, network, favoritesService, translateService);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if we have internet
|
||||
*/
|
||||
isDisconnected(): boolean {
|
||||
return this.network.type === this.network.Connection.NONE;
|
||||
super(route, dataProvider, favoritesService, translateService);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div [ngSwitch]="true">
|
||||
<ng-container *ngSwitchCase="!item && isDisconnected()">
|
||||
<ng-container *ngSwitchCase="!item && isDisconnected | async">
|
||||
<div class="notFoundContainer">
|
||||
<ion-icon name="no-connection"> </ion-icon>
|
||||
<ion-label>
|
||||
|
||||
@@ -17,7 +17,6 @@ import {CommonModule} from '@angular/common';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import {NgModule} from '@angular/core';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {Network} from '@ionic-native/network/ngx';
|
||||
import {IonicModule} from '@ionic/angular';
|
||||
import {TranslateModule} from '@ngx-translate/core';
|
||||
import {MarkdownModule} from 'ngx-markdown';
|
||||
@@ -80,12 +79,7 @@ import {DaiaAvailabilityComponent} from './daia-availability/daia-availability.c
|
||||
TranslateModule.forChild(),
|
||||
ThingTranslateModule.forChild(),
|
||||
],
|
||||
providers: [
|
||||
HebisDataProvider,
|
||||
DaiaDataProvider,
|
||||
Network,
|
||||
StAppsWebHttpClient,
|
||||
],
|
||||
providers: [HebisDataProvider, DaiaDataProvider, StAppsWebHttpClient],
|
||||
exports: [
|
||||
HebisSearchPageComponent,
|
||||
HebisDetailComponent,
|
||||
|
||||
Reference in New Issue
Block a user