From b2823db0a8ff463453c097e751b22f3b0df7ffa2 Mon Sep 17 00:00:00 2001 From: Georgi Prodanov Date: Mon, 20 Feb 2017 15:13:46 +0200 Subject: [PATCH] #327413 Update dependency versions. Small refactoring. --- app/groups/groups/groups.component.ts | 8 ++--- app/groups/groups/groups.template.html | 2 +- .../photo-picker/photo-picker.component.ts | 23 ++++++++------ .../user-display/user-display.component.ts | 12 ++++++-- package.json | 30 +++++++++---------- 5 files changed, 42 insertions(+), 33 deletions(-) diff --git a/app/groups/groups/groups.component.ts b/app/groups/groups/groups.component.ts index 7dd93f4..1a6c21a 100644 --- a/app/groups/groups/groups.component.ts +++ b/app/groups/groups/groups.component.ts @@ -32,11 +32,7 @@ export class GroupsComponent implements OnInit { this._page.actionBar.title = 'Groups'; this._route.params.subscribe(p => { if ('selectedTabIndex' in p) { - let index = Number(p['selectedTabIndex']); - // ngIf on the tab view makes it impossible to toggle it with goToTab() - // but setting this.selectedIndex doesnt switch tabs after this initial time - // so we use a mix of both... - this.selectedIndex = index; + this.goToTab(Number(p['selectedTabIndex'])); } }); @@ -60,6 +56,6 @@ export class GroupsComponent implements OnInit { } goToTab(tabIndex: number) { - this.groupsTabView.nativeElement.selectedIndex = tabIndex; + this.selectedIndex = tabIndex; } } diff --git a/app/groups/groups/groups.template.html b/app/groups/groups/groups.template.html index e764dd2..fb0d1e4 100644 --- a/app/groups/groups/groups.template.html +++ b/app/groups/groups/groups.template.html @@ -18,7 +18,7 @@ - + diff --git a/app/shared/photo-picker/photo-picker.component.ts b/app/shared/photo-picker/photo-picker.component.ts index d5235f9..53cb9bc 100644 --- a/app/shared/photo-picker/photo-picker.component.ts +++ b/app/shared/photo-picker/photo-picker.component.ts @@ -1,17 +1,15 @@ -import { Component, Input, OnInit, Output, EventEmitter, ViewChild } from '@angular/core'; -import * as nsImgSource from 'image-source'; -import * as nsImage from 'ui/image'; +import { Component, Input, Output, EventEmitter } from '@angular/core'; import { ImagePickerService } from '../../services'; -import { utilities, constants } from '../'; +import { utilities } from '../'; @Component({ selector: 'photo-picker', templateUrl: 'shared/photo-picker/photo-picker.template.html', styleUrls: [ 'shared/photo-picker/photo-picker.component.css' ] }) -export class PhotoPickerComponent implements OnInit { - resizedUrl: string; +export class PhotoPickerComponent { + private _resizedUrl: string; @Input('url') rawUrl: string; @Input() type: string; @@ -26,12 +24,19 @@ export class PhotoPickerComponent implements OnInit { private _imgPickerService: ImagePickerService ) {} - ngOnInit() { + get resizedUrl() { if (!this.rawUrl) { - return; + return null; } - this.resizedUrl = this._resizeAccordingly(this.rawUrl, this.type); + if (!this._resizedUrl) { + this._resizedUrl = this._resizeAccordingly(this.rawUrl, this.type); + } + return this._resizedUrl; + } + + set resizedUrl(newValue: string) { + this._resizedUrl = newValue; } onEdit(event) { diff --git a/app/shared/user-display/user-display.component.ts b/app/shared/user-display/user-display.component.ts index 87a6e66..e1b4c4c 100644 --- a/app/shared/user-display/user-display.component.ts +++ b/app/shared/user-display/user-display.component.ts @@ -8,12 +8,20 @@ import { User } from '../models'; styleUrls: [ 'shared/user-display/user-display.component.css' ] }) export class UserDisplayComponent implements OnInit { - @Input() users: User[] = []; + private _users: User[] = []; + @Input('withImages') imgCount: number = null; @Input() showNames: boolean = false; + @Input() set users(newValue: User[]) { + this._users = [].concat(newValue); + } + + get users() { + return this._users; + } + ngOnInit() { - this.users = [].concat(this.users); if (typeof this.imgCount !== 'number') { this.imgCount = this.users.length; } diff --git a/package.json b/package.json index 85d9bf8..79e0153 100644 --- a/package.json +++ b/package.json @@ -6,31 +6,31 @@ "nativescript": { "id": "com.telerik.PushNotificationApp", "tns-android": { - "version": "2.4.1" + "version": "2.5.0" }, "tns-ios": { - "version": "2.4.0" + "version": "2.5.0" } }, "dependencies": { - "@angular/common": "2.1.0", - "@angular/compiler": "2.1.0", - "@angular/core": "2.1.0", - "@angular/forms": "2.1.0", - "@angular/http": "2.1.0", - "@angular/platform-browser": "2.1.0", - "@angular/platform-browser-dynamic": "2.1.0", - "@angular/router": "3.1.0", + "@angular/common": "2.4.6", + "@angular/compiler": "2.4.6", + "@angular/core": "2.4.6", + "@angular/forms": "2.4.6", + "@angular/http": "2.4.6", + "@angular/platform-browser": "2.4.6", + "@angular/platform-browser-dynamic": "2.4.6", + "@angular/router": "3.4.6", "everlive-sdk": "1.9.1", - "nativescript-angular": "1.1.0", + "nativescript-angular": "1.4.0", "nativescript-imagepicker": "^2.4.1", "nativescript-permissions": "^1.2.0", "nativescript-push-notifications": "0.1.1", "nativescript-telerik-ui": "^1.4.1", "nativescript-theme-core": "^0.1.3", "reflect-metadata": "~0.1.8", - "rxjs": "5.0.0-beta.12", - "tns-core-modules": "2.4.4" + "rxjs": "~5.0.1", + "tns-core-modules": "2.5.0" }, "devDependencies": { "babel-traverse": "6.18.0", @@ -38,7 +38,7 @@ "babylon": "6.13.0", "lazy": "1.0.11", "nativescript-dev-typescript": "^0.3.2", - "typescript": "^2.0.6", - "zone.js": "~0.6.21" + "typescript": "~2.1.6", + "zone.js": "~0.7.2" } }