mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 17:42:57 +00:00
fix: fix various typos
This commit is contained in:
@@ -8,7 +8,7 @@ TAG_VERSION=$(sh $SCRIPT_DIR/getRegistryTag.sh "v1.0.0")
|
|||||||
TAG_TEST=$(sh $SCRIPT_DIR/getRegistryTag.sh "TEST")
|
TAG_TEST=$(sh $SCRIPT_DIR/getRegistryTag.sh "TEST")
|
||||||
BRANCH_NAME=$(sh $SCRIPT_DIR/getRegistryBranch.sh "very:first:test")
|
BRANCH_NAME=$(sh $SCRIPT_DIR/getRegistryBranch.sh "very:first:test")
|
||||||
|
|
||||||
# Leaving out pushAsLatestVersion.sh as its controll flow
|
# Leaving out pushAsLatestVersion.sh as its control flow
|
||||||
# is based on the same condition as getRegistryTag.sh
|
# is based on the same condition as getRegistryTag.sh
|
||||||
|
|
||||||
if [ $TAG_VERSION != "1.0.0" ]; then
|
if [ $TAG_VERSION != "1.0.0" ]; then
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ in line `var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_
|
|||||||
### Run platform iOS
|
### Run platform iOS
|
||||||
#### Problem
|
#### Problem
|
||||||
|
|
||||||
Currently the iOS project build with cordova uses the old build system.
|
Currently, the iOS project build with cordova uses the old build system.
|
||||||
The command `ionic cordova run ios` runs into the error `/platforms/ios/build/emulator/StApps.app/Info.plist
|
The command `ionic cordova run ios` runs into the error `/platforms/ios/build/emulator/StApps.app/Info.plist
|
||||||
file not found.`
|
file not found.`
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ This is a hybrid mobile app which is built using [Ionic](https://github.com/ioni
|
|||||||
|
|
||||||
### Why not refactoring legacy app?
|
### Why not refactoring legacy app?
|
||||||
|
|
||||||
The StApps 1.x.x (legacy app, but current app in stores) is written using Ionic 1 framework (AngularJS). For StApps 2.x.x project (this repository) we want to use latest version of Ionic (Ionic 2+ which uses Angular 2+; at the time of writing of the documentation current versions are: Ionic 4, Angular 6), which introduces significant changes. That said, simple refactoring of the app 1.x.x was not viable solution and this project was created with goal of coding of the existing and new features, defined by in new requirements (details available in internal documents).
|
The StApps 1.x.x (legacy app, but current app in stores) is written using Ionic 1 framework (AngularJS). For StApps 2.x.x project (this repository) we want to use the latest version of Ionic (Ionic 2+ which uses Angular 2+; at the time of writing of the documentation current versions are: Ionic 4, Angular 6), which introduces significant changes. That said, simple refactoring of the app 1.x.x was not viable solution and this project was created with goal of coding of the existing and new features, defined by in new requirements (details available in internal documents).
|
||||||
|
|
||||||
## How to quickly start running the app?
|
## How to quickly start running the app?
|
||||||
|
|
||||||
|
|||||||
@@ -80,9 +80,9 @@ export class DataFacetsProvider {
|
|||||||
}
|
}
|
||||||
const combinedFacets: SCFacet[] = facets;
|
const combinedFacets: SCFacet[] = facets;
|
||||||
const combinedFacetsMap: {[key: string]: {[key: string]: number; }; } = this.facetsToMap(combinedFacets);
|
const combinedFacetsMap: {[key: string]: {[key: string]: number; }; } = this.facetsToMap(combinedFacets);
|
||||||
(items as any[]).forEach((item) => {
|
items.forEach((item) => {
|
||||||
aggregations.forEach((aggregation) => {
|
aggregations.forEach((aggregation) => {
|
||||||
let fieldValues: string | string[] = item[aggregation.fieldName];
|
let fieldValues = item[aggregation.fieldName as keyof SCThing] as string | string[] | undefined;
|
||||||
if (typeof fieldValues === 'undefined') {
|
if (typeof fieldValues === 'undefined') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export class DataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a saveable thing from the local database using the provided UID
|
* Provides a savable thing from the local database using the provided UID
|
||||||
*/
|
*/
|
||||||
async get(uid: string, scope: DataScope.Local): Promise<SCSaveableThing<SCThings>>;
|
async get(uid: string, scope: DataScope.Local): Promise<SCSaveableThing<SCThings>>;
|
||||||
/**
|
/**
|
||||||
@@ -148,10 +148,10 @@ export class DataProvider {
|
|||||||
* Save a data item
|
* Save a data item
|
||||||
*
|
*
|
||||||
* @param item Data item that needs to be saved
|
* @param item Data item that needs to be saved
|
||||||
* @param [type] Saveable type (e.g. 'favorite'); if nothing is provided then type of the thing is used
|
* @param [type] Savable type (e.g. 'favorite'); if nothing is provided then type of the thing is used
|
||||||
*/
|
*/
|
||||||
async put(item: SCThings, type?: SCThingType): Promise<SCSaveableThing<SCThings>> {
|
async put(item: SCThings, type?: SCThingType): Promise<SCSaveableThing<SCThings>> {
|
||||||
const saveableItem: SCSaveableThing<SCThings> = {
|
const savableItem: SCSaveableThing<SCThings> = {
|
||||||
data: item,
|
data: item,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
origin: {
|
origin: {
|
||||||
@@ -163,7 +163,7 @@ export class DataProvider {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// @TODO: Implementation for saving item into the backend (user's account)
|
// @TODO: Implementation for saving item into the backend (user's account)
|
||||||
return ( this.storageProvider.put<SCSaveableThing<SCThings>>(this.getDataKey(item.uid), saveableItem));
|
return ( this.storageProvider.put<SCSaveableThing<SCThings>>(this.getDataKey(item.uid), savableItem));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ describe('DataDetailComponent', () => {
|
|||||||
expect(comp).toBeDefined(),
|
expect(comp).toBeDefined(),
|
||||||
);
|
);
|
||||||
|
|
||||||
it('should have apropriate title', async () => {
|
it('should have appropriate title', async () => {
|
||||||
const title: DebugElement | null = detailPage.query(By.directive(IonTitle));
|
const title: DebugElement | null = detailPage.query(By.directive(IonTitle));
|
||||||
expect(title).not.toBe(null);
|
expect(title).not.toBe(null);
|
||||||
expect(title!.nativeElement.textContent).toBe('Foo');
|
expect(title!.nativeElement.textContent).toBe('Foo');
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ export class SimpleCardComponent {
|
|||||||
* TODO
|
* TODO
|
||||||
*/
|
*/
|
||||||
// tslint:disable-next-line:prefer-function-over-method
|
// tslint:disable-next-line:prefer-function-over-method
|
||||||
isString(data: any): data is string {
|
isString(data: unknown): data is string {
|
||||||
return typeof data === 'string';
|
return typeof data === 'string';
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* TODO
|
* TODO
|
||||||
*/
|
*/
|
||||||
// tslint:disable-next-line:prefer-function-over-method
|
// tslint:disable-next-line:prefer-function-over-method
|
||||||
isThing(something: any): something is SCThing {
|
isThing(something: unknown): something is SCThing {
|
||||||
return isThing(something);
|
return isThing(something);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {Injectable} from '@angular/core';
|
|||||||
import {HttpClientInterface, HttpClientRequest} from '@openstapps/api/lib/http-client-interface';
|
import {HttpClientInterface, HttpClientRequest} from '@openstapps/api/lib/http-client-interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HttpClient that is based on angular's HttpClient (@TODO: move it to provider or independent package)
|
* HttpClient that is based on the Angular HttpClient (@TODO: move it to provider or independent package)
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class StAppsWebHttpClient implements HttpClientInterface {
|
export class StAppsWebHttpClient implements HttpClientInterface {
|
||||||
@@ -39,7 +39,7 @@ export class StAppsWebHttpClient implements HttpClientInterface {
|
|||||||
/**
|
/**
|
||||||
* TODO
|
* TODO
|
||||||
*/
|
*/
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
/**
|
/**
|
||||||
* TODO
|
* TODO
|
||||||
*/
|
*/
|
||||||
@@ -63,6 +63,7 @@ export class StAppsWebHttpClient implements HttpClientInterface {
|
|||||||
requestConfig.method || 'GET', requestConfig.url.toString(), options)
|
requestConfig.method || 'GET', requestConfig.url.toString(), options)
|
||||||
.toPromise();
|
.toPromise();
|
||||||
|
|
||||||
|
// tslint:disable-next-line:prefer-object-spread
|
||||||
return Object.assign(response, {statusCode: response.status, body: response.body || {}});
|
return Object.assign(response, {statusCode: response.status, body: response.body || {}});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw Error(err);
|
throw Error(err);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit {
|
|||||||
startingDay: Moment;
|
startingDay: Moment;
|
||||||
|
|
||||||
|
|
||||||
constructor(private mensaService: PlaceMensaService, private changeDectectorRef: ChangeDetectorRef) {
|
constructor(private mensaService: PlaceMensaService, private changeDetectorRef: ChangeDetectorRef) {
|
||||||
// TODO: translation
|
// TODO: translation
|
||||||
this.startingDay = moment();
|
this.startingDay = moment();
|
||||||
this.startingDay.hour(0);
|
this.startingDay.hour(0);
|
||||||
@@ -76,7 +76,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.changeDectectorRef.detectChanges();
|
this.changeDetectorRef.detectChanges();
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import {
|
|||||||
SCThingType,
|
SCThingType,
|
||||||
SCTranslations,
|
SCTranslations,
|
||||||
} from '@openstapps/core';
|
} from '@openstapps/core';
|
||||||
|
import {Subscription} from 'rxjs';
|
||||||
import {ContextMenuService} from './context-menu.service';
|
import {ContextMenuService} from './context-menu.service';
|
||||||
import {FilterContext, SortContext, SortContextOption} from './context-type';
|
import {FilterContext, SortContext, SortContextOption} from './context-type';
|
||||||
import {Subscription} from 'rxjs';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The context menu
|
* The context menu
|
||||||
@@ -64,16 +64,16 @@ export class ContextMenuComponent {
|
|||||||
*/
|
*/
|
||||||
sortOption: SortContext;
|
sortOption: SortContext;
|
||||||
|
|
||||||
/**
|
|
||||||
* Core translator
|
|
||||||
*/
|
|
||||||
translator: SCThingTranslator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of all Subscriptions
|
* Array of all Subscriptions
|
||||||
*/
|
*/
|
||||||
subscriptions: Subscription[] = [];
|
subscriptions: Subscription[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Core translator
|
||||||
|
*/
|
||||||
|
translator: SCThingTranslator;
|
||||||
|
|
||||||
|
|
||||||
constructor(private translateService: TranslateService,
|
constructor(private translateService: TranslateService,
|
||||||
private readonly contextMenuService: ContextMenuService) {
|
private readonly contextMenuService: ContextMenuService) {
|
||||||
@@ -94,15 +94,6 @@ export class ContextMenuComponent {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Unsubscribe from Observables
|
|
||||||
*/
|
|
||||||
ngOnDestroy() {
|
|
||||||
for (let sub of this.subscriptions) {
|
|
||||||
sub.unsubscribe();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets selected filter options and updates listener
|
* Sets selected filter options and updates listener
|
||||||
*/
|
*/
|
||||||
@@ -126,6 +117,15 @@ export class ContextMenuComponent {
|
|||||||
return this.translator.translatedPropertyValue(onlyForType, field, key);
|
return this.translator.translatedPropertyValue(onlyForType, field, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unsubscribe from Observables
|
||||||
|
*/
|
||||||
|
ngOnDestroy() {
|
||||||
|
for (const sub of this.subscriptions) {
|
||||||
|
sub.unsubscribe();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets filter options
|
* Resets filter options
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export class NavigationComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads menu entris from configProvider
|
* Loads menu entries from configProvider
|
||||||
*/
|
*/
|
||||||
async loadMenuEntries() {
|
async loadMenuEntries() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import {TranslateModule} from '@ngx-translate/core';
|
|||||||
import {MomentModule} from 'ngx-moment';
|
import {MomentModule} from 'ngx-moment';
|
||||||
import {DataModule} from '../data/data.module';
|
import {DataModule} from '../data/data.module';
|
||||||
import {SettingsProvider} from '../settings/settings.provider';
|
import {SettingsProvider} from '../settings/settings.provider';
|
||||||
|
import {NewsItemComponent} from './page/news-item.component';
|
||||||
import {NewsPageComponent} from './page/news-page.component';
|
import {NewsPageComponent} from './page/news-page.component';
|
||||||
import {SkeletonNewsItem} from './page/skeleton-news-item.component';
|
import {SkeletonNewsItem} from './page/skeleton-news-item.component';
|
||||||
import {NewsItemComponent} from './page/news-item.component';
|
|
||||||
|
|
||||||
const newsRoutes: Routes = [
|
const newsRoutes: Routes = [
|
||||||
{path: 'news', component: NewsPageComponent},
|
{path: 'news', component: NewsPageComponent},
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ export class SettingsProvider {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an Setting to the Cache if not exist and set undefined value to defaultValue
|
* Add an Setting to the Cache if not exist and set undefined value to defaultValue
|
||||||
* @param setting Setting with categories, defautlValue, name, input type and valid values
|
* @param setting Setting with categories, defaultValue, name, input type and valid values
|
||||||
*/
|
*/
|
||||||
private addSetting(setting: SCSetting): void {
|
private addSetting(setting: SCSetting): void {
|
||||||
if (!this.categoryExists(setting.categories[0])) {
|
if (!this.categoryExists(setting.categories[0])) {
|
||||||
@@ -396,7 +396,7 @@ export class SettingsProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the order the given categories showup in the settings page
|
* Sets the order the given categories show up in the settings page
|
||||||
* @param categoryNames the order of the categories
|
* @param categoryNames the order of the categories
|
||||||
*/
|
*/
|
||||||
public setCategoriesOrder(categoryNames: string[]) {
|
public setCategoriesOrder(categoryNames: string[]) {
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import {Storage} from '@ionic/storage';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class StorageProvider {
|
export class StorageProvider {
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param storage TODO
|
* @param storage TODO
|
||||||
*/
|
*/
|
||||||
constructor(private readonly storage: Storage) {
|
constructor(private readonly storage: Storage) {
|
||||||
@@ -124,7 +123,7 @@ export class StorageProvider {
|
|||||||
/**
|
/**
|
||||||
* Puts a value of type T into the storage using provided key
|
* Puts a value of type T into the storage using provided key
|
||||||
*
|
*
|
||||||
* @param key Unique indentifier
|
* @param key Unique identifier
|
||||||
* @param value Resource to store under the key
|
* @param value Resource to store under the key
|
||||||
*/
|
*/
|
||||||
async put<T>(key: string, value: T): Promise<T> {
|
async put<T>(key: string, value: T): Promise<T> {
|
||||||
|
|||||||
@@ -77,13 +77,13 @@ export class StringSplitPipe implements PipeTransform {
|
|||||||
pure: false, // required to update the value when the promise is resolved
|
pure: false, // required to update the value when the promise is resolved
|
||||||
})
|
})
|
||||||
export class NumberLocalizedPipe implements PipeTransform, OnDestroy {
|
export class NumberLocalizedPipe implements PipeTransform, OnDestroy {
|
||||||
decialPipe: DecimalPipe;
|
decimalPipe: DecimalPipe;
|
||||||
locale: string;
|
locale: string;
|
||||||
onLangChange: Subscription;
|
onLangChange: Subscription;
|
||||||
value: unknown;
|
value: unknown;
|
||||||
|
|
||||||
constructor(private readonly translate: TranslateService) {
|
constructor(private readonly translate: TranslateService) {
|
||||||
this.decialPipe = new DecimalPipe('de-DE');
|
this.decimalPipe = new DecimalPipe('de-DE');
|
||||||
this.locale = translate.currentLang;
|
this.locale = translate.currentLang;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,6 +124,6 @@ export class NumberLocalizedPipe implements PipeTransform, OnDestroy {
|
|||||||
|
|
||||||
updateValue(value: unknown, digitsInfo?: string | undefined): void {
|
updateValue(value: unknown, digitsInfo?: string | undefined): void {
|
||||||
// this.value = this.locale;
|
// this.value = this.locale;
|
||||||
this.value = this.decialPipe.transform(value, digitsInfo,this.locale);
|
this.value = this.decimalPipe.transform(value, digitsInfo,this.locale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,30 +19,30 @@ import {Injectable} from '@angular/core';
|
|||||||
|
|
||||||
export abstract class ThingTranslateParser {
|
export abstract class ThingTranslateParser {
|
||||||
/**
|
/**
|
||||||
* Gets a value from an object given a keypath
|
* Gets a value from an object given a keyPath
|
||||||
* paser.getValueFromKeyPath(anObject, 'property.subarray[42].etc');
|
* parser.getValueFromKeyPath(anObject, 'property.subarray[42].etc');
|
||||||
*/
|
*/
|
||||||
abstract getValueFromKeyPath(instance: object, keypath: string): unknown;
|
abstract getValueFromKeyPath(instance: object, keyPath: string): unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ThingTranslateDefaultParser extends ThingTranslateParser {
|
export class ThingTranslateDefaultParser extends ThingTranslateParser {
|
||||||
|
|
||||||
getValueFromKeyPath(instance: object, keypath: string): unknown {
|
getValueFromKeyPath(instance: object, keyPath: string): unknown {
|
||||||
// keypath = aproperty[0].anotherproperty["arrayproperty"][42].finalproperty
|
// keyPath = aproperty[0].anotherproperty["arrayproperty"][42].finalproperty
|
||||||
let path = keypath.replace(/(?:\"|\')'"/gmi, '.');
|
let path = keyPath.replace(/(?:\"|\')'"/gmi, '.');
|
||||||
// path = aproperty[0].anotherproperty[.arrayproperty.][42].finalproperty
|
// path = aproperty[0].anotherproperty[.arrayproperty.][42].finalproperty
|
||||||
path = path.replace(/(?:\[|\])/gmi, '.');
|
path = path.replace(/(?:\[|\])/gmi, '.');
|
||||||
// path = aproperty.0..anotherproperty..arrayproperty...42..finalproperty
|
// path = aproperty.0..anotherproperty..arrayproperty...42..finalproperty
|
||||||
path = path.replace(/\.{2,}/gmi, '.');
|
path = path.replace(/\.{2,}/gmi, '.');
|
||||||
// path = aproperty.0.anotherproperty.arrayproperty.42.finalproperty
|
// path = aproperty.0.anotherproperty.arrayproperty.42.finalproperty
|
||||||
|
|
||||||
const keypathChain = keypath.split('.');
|
const keyPathChain = keyPath.split('.');
|
||||||
|
|
||||||
// tslint:disable-next-line: no-any
|
// tslint:disable-next-line: no-any
|
||||||
let property = instance as any;
|
let property = instance as any;
|
||||||
|
|
||||||
for(const key of keypathChain) {
|
for(const key of keyPathChain) {
|
||||||
property = property[key] ?? undefined;
|
property = property[key] ?? undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user