mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
fix: update core and apply stricter tslint rules
This commit is contained in:
@@ -15,10 +15,16 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {SCThings} from '@openstapps/core';
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
@Component({
|
||||
selector: 'stapps-data-detail-content',
|
||||
templateUrl: 'data-detail-content.html',
|
||||
})
|
||||
export class DataDetailContentComponent {
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
@Input() item: SCThings;
|
||||
}
|
||||
|
||||
@@ -19,17 +19,35 @@ import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
|
||||
import {SCLanguageCode, SCThing, SCUuid} from '@openstapps/core';
|
||||
import {DataProvider, DataScope} from '../data.provider';
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
@Component({
|
||||
selector: 'stapps-data-detail',
|
||||
styleUrls: ['data-detail.scss'],
|
||||
templateUrl: 'data-detail.html',
|
||||
})
|
||||
export class DataDetailComponent {
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
dataProvider: DataProvider;
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
item: SCThing;
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
language: SCLanguageCode;
|
||||
|
||||
constructor(private route: ActivatedRoute, dataProvider: DataProvider, translateService: TranslateService) {
|
||||
/**
|
||||
*
|
||||
* @param route TODO
|
||||
* @param dataProvider TODO
|
||||
* @param translateService TODO
|
||||
*/
|
||||
constructor(private readonly route: ActivatedRoute, dataProvider: DataProvider, translateService: TranslateService) {
|
||||
this.dataProvider = dataProvider;
|
||||
this.language = translateService.currentLang as SCLanguageCode;
|
||||
translateService.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||
@@ -43,11 +61,16 @@ export class DataDetailComponent {
|
||||
* @param uid Unique identifier of a thing
|
||||
*/
|
||||
async getItem(uid: SCUuid): Promise<void> {
|
||||
this.dataProvider.get(uid, DataScope.Remote).then((data) => {
|
||||
await this.dataProvider.get(uid, DataScope.Remote)
|
||||
.then((data) => {
|
||||
this.item = data;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
// tslint:disable-next-line:prefer-function-over-method
|
||||
ngOnInit() {
|
||||
this.getItem(this.route.snapshot.paramMap.get('uid') || '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user