feat(console): split granted from owned project modules, general ui ux fixes (#286)

* add iam label, user avatar

* avatar component

* split granted and owned modules

* move components to resp module

* refactor project contributors, g project nav

* rem console logs, add avatar for org members

* fix changes loading, auth user page

* refactor home, i18n

* fix changes side overflow

* lint
This commit is contained in:
Max Peintner
2020-06-26 14:15:05 +02:00
committed by GitHub
parent ee73dc07dd
commit 0a488eb1fb
141 changed files with 1133 additions and 742 deletions

View File

@@ -20,6 +20,7 @@ export class ChangesComponent implements OnInit {
@Input() public id: string = '';
@Input() public sortDirectionAsc: boolean = true;
public errorMessage: string = '';
public bottom: boolean = false;
// Source data
private _done: BehaviorSubject<any> = new BehaviorSubject(false);
@@ -93,36 +94,36 @@ export class ChangesComponent implements OnInit {
private mapAndUpdate(col: Promise<Changes>): any {
if (this._done.value || this._loading.value) { return; }
// loading
this._loading.next(true);
// Map snapshot with doc ref (needed for cursor)
return from(col).pipe(
tap((res: Changes) => {
console.log('more changes');
let values = res.toObject().changesList;
// If prepending, reverse the batch order
values = false ? values.reverse() : values;
if (!this.bottom) {
// loading
this._loading.next(true);
// update source with new values, done loading
this._data.next(values);
console.log(values);
return from(col).pipe(
tap((res: Changes) => {
let values = res.toObject().changesList;
// If prepending, reverse the batch order
values = false ? values.reverse() : values;
// console.log(values);
this._loading.next(false);
// update source with new values, done loading
this._data.next(values);
// no more values, mark done
if (!values.length) {
this._done.next(true);
}
}),
catchError(err => {
console.error(err);
this._loading.next(false);
this.errorMessage = err.message;
return of([]);
}),
take(1),
).subscribe();
this._loading.next(false);
// no more values, mark done
if (!values.length) {
this._done.next(true);
}
}),
catchError(err => {
console.error(err);
this._loading.next(false);
this.errorMessage = decodeURI(err.message);
this.bottom = true;
return of([]);
}),
take(1),
).subscribe();
}
}
}