Skip to content

Commit

Permalink
handle itinerancy
Browse files Browse the repository at this point in the history
  • Loading branch information
bastyen committed Apr 14, 2022
1 parent dd435f2 commit f88fac9
Show file tree
Hide file tree
Showing 24 changed files with 1,454 additions and 1,211 deletions.
2,322 changes: 1,302 additions & 1,020 deletions package-lock.json

Large diffs are not rendered by default.

53 changes: 26 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "geotrek-mobile",
"version": "3.9.0",
"version": "3.9.2",
"author": "Makina Corpus",
"homepage": "https://makina-corpus.com",
"scripts": {},
"private": true,
"dependencies": {
"@angular/animations": "^13.3.0",
"@angular/common": "^13.3.0",
"@angular/core": "^13.3.0",
"@angular/forms": "^13.3.0",
"@angular/platform-browser": "^13.3.0",
"@angular/platform-browser-dynamic": "^13.3.0",
"@angular/router": "^13.3.0",
"@awesome-cordova-plugins/device-orientation": "^5.40.0",
"@angular/animations": "^13.3.3",
"@angular/common": "^13.3.3",
"@angular/core": "^13.3.3",
"@angular/forms": "^13.3.3",
"@angular/platform-browser": "^13.3.3",
"@angular/platform-browser-dynamic": "^13.3.3",
"@angular/router": "^13.3.3",
"@awesome-cordova-plugins/device-orientation": "^5.41.0",
"@capacitor-community/background-geolocation": "^1.1.0",
"@capacitor-community/http": "^1.4.1",
"@capacitor/android": "^3.4.3",
Expand All @@ -24,12 +24,11 @@
"@capacitor/haptics": "1.1.4",
"@capacitor/keyboard": "1.2.2",
"@capacitor/local-notifications": "^1.1.0",
"@capacitor/network": "^1.0.7",
"@capacitor/share": "^1.1.2",
"@capacitor/splash-screen": "^1.2.2",
"@capacitor/status-bar": "1.0.8",
"@capacitor/storage": "^1.2.5",
"@ionic/angular": "^6.0.13",
"@ionic/angular": "^6.1.0",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@turf/distance": "^6.5.0",
Expand All @@ -44,31 +43,31 @@
"zone.js": "^0.11.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "^13.3.0",
"@angular-eslint/builder": "~13.1.0",
"@angular-eslint/eslint-plugin": "~13.1.0",
"@angular-eslint/eslint-plugin-template": "~13.1.0",
"@angular-eslint/template-parser": "~13.1.0",
"@angular/cli": "^13.2.1",
"@angular/compiler": "^13.2.1",
"@angular/compiler-cli": "^13.2.1",
"@angular/language-service": "^13.2.1",
"@angular-devkit/build-angular": "^13.3.3",
"@angular-eslint/builder": "~13.2.0",
"@angular-eslint/eslint-plugin": "~13.2.0",
"@angular-eslint/eslint-plugin-template": "~13.2.0",
"@angular-eslint/template-parser": "~13.2.0",
"@angular/cli": "^13.3.3",
"@angular/compiler": "^13.3.3",
"@angular/compiler-cli": "^13.3.3",
"@angular/language-service": "^13.3.3",
"@capacitor/cli": "3.4.3",
"@ionic/angular-toolkit": "^6.1.0",
"@ionic/cli": "^6.19.0",
"@types/lodash.clonedeep": "^4.5.6",
"@types/lodash.deburr": "^4.1.6",
"@types/mapbox-gl": "^1.13.3",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"@types/node": "^17.0.24",
"@typescript-eslint/eslint-plugin": "5.19.0",
"@typescript-eslint/parser": "5.19.0",
"capacitor-resources": "^2.0.5",
"cypress": "^9.5.3",
"cypress": "^9.5.4",
"eslint": "^8.12.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jsdoc": "38.1.4",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsdoc": "39.2.1",
"eslint-plugin-prefer-arrow": "1.2.3",
"prettier": "^2.6.1",
"prettier": "^2.6.2",
"ts-node": "^10.7.0",
"typescript": "^4.6.3"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import {
Component,
Input,
OnInit,
TemplateRef,
ChangeDetectionStrategy
} from '@angular/core';
import { Component, Input, OnInit, TemplateRef } from '@angular/core';

@Component({
selector: 'app-collapsible-list',
templateUrl: './collapsible-list.component.html',
styleUrls: ['./collapsible-list.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
styleUrls: ['./collapsible-list.component.scss']
})
export class CollapsibleListComponent<T> implements OnInit {
@Input() items: T[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { InformationDesk } from '@app/interfaces/interfaces';
styleUrls: ['./information-desk-details.component.scss']
})
export class InformationDeskDetailsComponent implements OnInit {
baseUrl = environment.onlineBaseUrl;
informationDesk: InformationDesk;
informationDeskPicture = '';
public baseUrl = environment.onlineBaseUrl;
public informationDesk: InformationDesk;
public informationDeskPicture = '';

constructor(public modalCtrl: ModalController, public navParams: NavParams) {}

Expand Down
16 changes: 3 additions & 13 deletions src/app/components/poi/poi.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
Component,
Input,
OnChanges,
SimpleChanges,
ChangeDetectionStrategy,
ChangeDetectorRef
} from '@angular/core';
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import { OfflineTreksService } from '@app/services/offline-treks/offline-treks.service';
import { OnlineTreksService } from '@app/services/online-treks/online-treks.service';
import {
Expand All @@ -20,8 +13,7 @@ import { environment } from '@env/environment';
@Component({
selector: 'app-poi',
templateUrl: './poi.component.html',
styleUrls: ['./poi.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
styleUrls: ['./poi.component.scss']
})
export class PoiComponent implements OnChanges {
@Input() public poi: Poi;
Expand All @@ -38,8 +30,7 @@ export class PoiComponent implements OnChanges {

constructor(
public offlineTreks: OfflineTreksService,
public onlineTreks: OnlineTreksService,
private ref: ChangeDetectorRef
public onlineTreks: OnlineTreksService
) {}

async ngOnChanges(changes: SimpleChanges) {
Expand Down Expand Up @@ -78,7 +69,6 @@ export class PoiComponent implements OnChanges {
} else {
this.picture = null;
}
this.ref.detectChanges();
}
}

Expand Down
14 changes: 2 additions & 12 deletions src/app/components/progress/progress.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import {
Component,
ChangeDetectorRef,
ChangeDetectionStrategy,
OnInit
} from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { OfflineTreksService } from '@app/services/offline-treks/offline-treks.service';
import { Subscription } from 'rxjs';

@Component({
selector: 'app-progress',
changeDetection: ChangeDetectionStrategy.Default,
templateUrl: './progress.component.html',
styleUrls: ['./progress.component.scss']
})
Expand All @@ -18,18 +12,14 @@ export class ProgressComponent implements OnInit {
private currentProgress$: Subscription;
public willDownloadGlobalMedia = true;

constructor(
public offlineTreks: OfflineTreksService,
private ref: ChangeDetectorRef
) {}
constructor(public offlineTreks: OfflineTreksService) {}

ngOnInit(): void {
this.willDownloadGlobalMedia = this.offlineTreks.willDownloadCommonMedia();

this.currentProgress$ =
this.offlineTreks.currentProgressDownload$.subscribe((val) => {
this.currentProgress = val;
this.ref.detectChanges();
});
}

Expand Down
10 changes: 2 additions & 8 deletions src/app/components/search/search.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
Component,
OnInit,
ChangeDetectionStrategy,
OnDestroy
} from '@angular/core';
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular';
import { Subscription } from 'rxjs';

Expand All @@ -17,8 +12,7 @@ import { OnlineTreksService } from '@app/services/online-treks/online-treks.serv
selector: 'app-search',
templateUrl: './search.component.html',
styleUrls: ['./search.component.scss'],
providers: [SearchTreksService],
changeDetection: ChangeDetectionStrategy.OnPush
providers: [SearchTreksService]
})
export class SearchComponent implements OnInit, OnDestroy {
public filteredTreks: MinimalTrek[] = [];
Expand Down
9 changes: 4 additions & 5 deletions src/app/components/select-poi/select-poi.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export class SelectPoiComponent implements OnInit {
imgPoi: { src: string; color: string | undefined };
imgTypePoi: { src: string; color: string | undefined };
}[];
selectedPoiId: number;
imgPractices: {
public baseUrl = environment.onlineBaseUrl;
public selectedPoiId: number;
public imgPractices: {
src: string;
color: string | undefined;
firstTryToLoadFromOnline: boolean;
Expand Down Expand Up @@ -65,9 +66,7 @@ export class SelectPoiComponent implements OnInit {
this.imgPractices[i].firstTryToLoadFromOnline
) {
this.imgPractices[i].firstTryToLoadFromOnline = false;
this.imgPractices[
i
].src = `${environment.onlineBaseUrl}${this.imgPractices[i].src}`;
this.imgPractices[i].src = `${this.baseUrl}${this.imgPractices[i].src}`;
} else {
this.imgPractices[i].hideImgPracticeSrc = true;
}
Expand Down
9 changes: 4 additions & 5 deletions src/app/components/select-trek/select-trek.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export class SelectTrekComponent implements OnInit {
name: string;
imgPractice: { src: string; color: string | undefined };
}[];
selectedTrekId: number;
imgPractices: {
public baseUrl = environment.onlineBaseUrl;
public selectedTrekId: number;
public imgPractices: {
src: string;
color: string | undefined;
firstTryToLoadFromOnline: boolean;
Expand Down Expand Up @@ -63,9 +64,7 @@ export class SelectTrekComponent implements OnInit {
this.imgPractices[i].firstTryToLoadFromOnline
) {
this.imgPractices[i].firstTryToLoadFromOnline = false;
this.imgPractices[
i
].src = `${environment.onlineBaseUrl}${this.imgPractices[i].src}`;
this.imgPractices[i].src = `${this.baseUrl}${this.imgPractices[i].src}`;
} else {
this.imgPractices[i].hideImgPracticeSrc = true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/trek-card/trek-card.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[src]="this.imgSrc"
(ionError)="onImgSrcError()"
></ion-img>
<ion-card-header [ngClass]="{ 'minimize-padding-bottom': !showAllData }">
<ion-card-header [ngClass]="{ 'minimize-padding': !showAllData }">
<ion-card-title [ngClass]="{ 'minimize-title': !showAllData }">
{{
isStage
Expand All @@ -23,7 +23,7 @@
</ion-card-header>
</div>
<div>
<ion-card-content class="no-padding-top">
<ion-card-content [ngClass]="{ 'minimize-padding': !showAllData }">
<div>
<div class="ellipsis">{{ 'treks.departure' | translate }}</div>
<div class="ellipsis" *ngIf="hydratedTrek.properties.departure">
Expand All @@ -39,7 +39,7 @@
{{ hydratedTrek.properties.departure_city?.name }}
</div>
</div>
<div class="extra-content-card ion-padding-top">
<div class="extra-content-card">
<div>
<ion-img
*ngIf="this.imgPracticeSrc && !this.hideImgPracticeSrc"
Expand Down
19 changes: 14 additions & 5 deletions src/app/components/trek-card/trek-card.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
margin-top: 12px;
}

.ellipsis {
Expand All @@ -24,13 +25,21 @@
}

.minimize-title {
font-size: 15px;
font-size: 16px;
}

.minimize-padding-bottom {
padding-bottom: 8px;
ion-card-header {
padding: 16px 16px 16px 16px;
}

.no-padding-top {
padding-top: 0px;
ion-card-content {
padding: 0px 16px 16px 16px;
}

ion-card-header.minimize-padding {
padding: 8px 8px 8px 8px;
}

ion-card-content.minimize-padding {
padding: 0px 8px 8px 8px;
}
8 changes: 4 additions & 4 deletions src/app/components/trek-card/trek-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export class TrekCardComponent implements OnInit {
}
}

public onImgSrcError() {
this.hideImgSrc = true;
}

public onImgPracticeSrcError() {
if (
this.hydratedTrek.properties.practice &&
Expand All @@ -87,8 +91,4 @@ export class TrekCardComponent implements OnInit {
this.hideImgPracticeSrc = true;
}
}

onImgSrcError() {
this.hideImgSrc = true;
}
}
2 changes: 1 addition & 1 deletion src/app/pages/more/more-item/more-item.page.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ion-header>
<ion-toolbar color="primary">
<ion-buttons slot="start">
<ion-back-button defaultHref="/app/more"></ion-back-button>
<ion-back-button defaultHref="/tabs/more"></ion-back-button>
</ion-buttons>
<ion-title *ngIf="moreItem">{{ moreItem.title }}</ion-title>
</ion-toolbar>
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/trek-details/trek-details.page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ div[scrollx='true'] {
-webkit-overflow-scrolling: touch;
.scroll-trek-item {
flex: 0 0 auto;
width: 250px;
width: 320px;
}
}

Expand Down
Loading

0 comments on commit f88fac9

Please sign in to comment.