chore: import clean-up
This commit is contained in:
@@ -1,35 +1,35 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { AppComponent } from './app.component';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {RouterTestingModule} from '@angular/router/testing';
|
||||
import {AppComponent} from './app.component';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [
|
||||
RouterTestingModule
|
||||
],
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
}).compileComponents();
|
||||
});
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [
|
||||
RouterTestingModule
|
||||
],
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
it('should create the app', () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
});
|
||||
it('should create the app', () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
});
|
||||
|
||||
it(`should have as title 'mastolists'`, () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.componentInstance;
|
||||
expect(app.title).toEqual('mastolists');
|
||||
});
|
||||
it(`should have as title 'mastolists'`, () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.componentInstance;
|
||||
expect(app.appName).toEqual('mastolists');
|
||||
});
|
||||
|
||||
it('should render title', () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.nativeElement as HTMLElement;
|
||||
expect(compiled.querySelector('.content span')?.textContent).toContain('mastolists app is running!');
|
||||
});
|
||||
it('should render title', () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.nativeElement as HTMLElement;
|
||||
expect(compiled.querySelector('.content span')?.textContent).toContain('mastolists app is running!');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,7 +4,6 @@ import {fromApplication, fromAuthorize, selectIsLoggedIn} from "./shared/state/s
|
||||
import {environment} from "../environments/environment";
|
||||
// @ts-ignore
|
||||
import packageJson from '../../../../package.json';
|
||||
import {tap} from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
|
||||
@@ -3,17 +3,8 @@ import {BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
import {AppRoutingModule} from './app-routing.module';
|
||||
import {AppComponent} from './app.component';
|
||||
import {MastodonApiModule} from "../../../mastodon-api/src/lib/mastodon-api.module";
|
||||
import {
|
||||
NbActionsModule,
|
||||
NbContextMenuModule,
|
||||
NbDialogModule,
|
||||
NbGlobalPhysicalPosition,
|
||||
NbLayoutModule,
|
||||
NbMenuModule,
|
||||
NbThemeModule,
|
||||
NbToastrModule
|
||||
} from "@nebular/theme";
|
||||
import {MastodonApiModule} from "projects/mastodon-api/src/public-api";
|
||||
import {NbActionsModule, NbContextMenuModule, NbDialogModule, NbGlobalPhysicalPosition, NbLayoutModule, NbMenuModule, NbThemeModule, NbToastrModule} from "@nebular/theme";
|
||||
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
|
||||
import {SharedModule} from './shared/shared.module';
|
||||
import {NbEvaIconsModule} from "@nebular/eva-icons";
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||
import {FormControl, FormGroup, Validators} from "@angular/forms";
|
||||
import {ActivatedRoute, Params} from "@angular/router";
|
||||
import {concat, filter, map, merge, Observable, take, tap, withLatestFrom, zip, zipWith} from "rxjs";
|
||||
import {ActivatedRoute} from "@angular/router";
|
||||
import {filter, map, Observable, take, tap, zip} from "rxjs";
|
||||
import {select, Store} from "@ngrx/store";
|
||||
import {
|
||||
selectAuthorizingUserFlag,
|
||||
selectCurrentInstance,
|
||||
fromAuthorize,
|
||||
selectApplicationRegisteredFlag,
|
||||
selectAuthorizingUserFlag,
|
||||
selectCurrentInstanceWithApplicationRegisteredState,
|
||||
selectDataForAuthorizationFlow,
|
||||
selectIsLoggedIn,
|
||||
selectRegisteringApplicationFlag,
|
||||
selectDataForAuthorizationFlow, selectApplicationRegisteredFlag, selectCurrentInstanceWithApplicationRegisteredState
|
||||
selectRegisteringApplicationFlag
|
||||
} from "../../shared/state/store";
|
||||
|
||||
@Component({
|
||||
@@ -52,7 +53,7 @@ export class AuthorizeComponent implements OnInit, OnDestroy {
|
||||
.pipe(
|
||||
filter(([params, instanceName, isLoggedIn]) => params['code'] && instanceName !== undefined && !isLoggedIn),
|
||||
take(1),
|
||||
).subscribe(([params, instanceName, isLoggedIn]) => {
|
||||
).subscribe(([params]) => {
|
||||
this.store.pipe(
|
||||
select(selectDataForAuthorizationFlow),
|
||||
take(1),
|
||||
|
||||
@@ -3,14 +3,11 @@ import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from "
|
||||
import {Observable, tap} from "rxjs";
|
||||
import {select, Store} from "@ngrx/store";
|
||||
import {selectIsLoggedIn} from "../../shared/state/store";
|
||||
import {MastodonApiAuthenticationService} from 'projects/mastodon-api/src/public-api';
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
export class AuthGuard implements CanActivate {
|
||||
|
||||
constructor(private store: Store,
|
||||
private router: Router,
|
||||
private mastodonApiAuthService: MastodonApiAuthenticationService) {
|
||||
constructor(private store: Store, private router: Router) {
|
||||
}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
|
||||
|
||||
@@ -2,7 +2,7 @@ import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {SharedModule} from "../shared/shared.module";
|
||||
import {FollowingsRoutingModule} from "./followings-list-routing.module";
|
||||
import {NbBadgeModule, NbCheckboxModule, NbIconModule, NbListModule, NbPopoverModule, NbToggleModule, NbUserModule} from "@nebular/theme";
|
||||
import {NbBadgeModule, NbCheckboxModule, NbListModule, NbPopoverModule, NbToggleModule, NbUserModule} from "@nebular/theme";
|
||||
import {ListComponent} from "./list/list.component";
|
||||
import {TableComponent} from "./table/table.component";
|
||||
import {MatrixComponent} from "./matrix/matrix.component";
|
||||
|
||||
@@ -42,8 +42,3 @@ table {
|
||||
line-height: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
nb-card.more-info-panel {
|
||||
min-width: 450px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {map, Observable} from "rxjs";
|
||||
import {Account} from "../../../../../mastodon-api/src/lib/interfaces/public/account";
|
||||
import {List} from "../../../../../mastodon-api/src/lib/interfaces/public/list";
|
||||
import {select, Store} from "@ngrx/store";
|
||||
import {selectFilteredFollowingsWithLists, selectLists} from "../../shared/state/store/selectors";
|
||||
import {fromTableViewPage} from "../../shared/state/store";
|
||||
import {fromTableViewPage, selectFilteredFollowingsWithLists, selectLists} from "../../shared/state/store";
|
||||
import {Account, List} from 'projects/mastodon-api/src/public-api';
|
||||
|
||||
interface DataGridRow {
|
||||
id: string;
|
||||
|
||||
@@ -2,9 +2,8 @@ import {Component} from '@angular/core';
|
||||
import {List} from 'projects/mastodon-api/src/public-api';
|
||||
import {Observable} from "rxjs";
|
||||
import {select, Store} from "@ngrx/store";
|
||||
import {selectCurrentInstance, selectLists} from "../../shared/state/store/selectors";
|
||||
import {fromListsPage, selectCurrentInstance, selectLists} from "../../shared/state/store";
|
||||
import {FormControl, FormGroup} from "@angular/forms";
|
||||
import {fromListsPage} from '../../shared/state/store';
|
||||
|
||||
@Component({
|
||||
selector: 'app-lists',
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
td.field-label {
|
||||
min-width: 180px;
|
||||
}
|
||||
|
||||
.table {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -23,14 +23,6 @@
|
||||
|
||||
}
|
||||
|
||||
.buttons {
|
||||
padding-top: 20px;
|
||||
|
||||
button {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 573px) {
|
||||
.form {
|
||||
flex-direction: column;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Injectable, OnDestroy} from '@angular/core';
|
||||
import {EMPTY, expand, map, Observable, reduce, Subscription, switchMap, tap} from "rxjs";
|
||||
import {EMPTY, expand, map, Observable, reduce, Subscription} from "rxjs";
|
||||
import {select, Store} from "@ngrx/store";
|
||||
import {Account, MastodonApiAccountsService} from 'projects/mastodon-api/src/public-api';
|
||||
import {selectDataForAuthorizedRequest} from "../state/store";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Injectable, OnDestroy} from '@angular/core';
|
||||
import {EMPTY, expand, filter, map, Observable, of, reduce, Subscription, switchMap, tap} from "rxjs";
|
||||
import {EMPTY, expand, map, Observable, reduce, Subscription} from "rxjs";
|
||||
import {select, Store} from "@ngrx/store";
|
||||
import {List, MastodonApiListsService} from 'projects/mastodon-api/src/public-api';
|
||||
import {selectDataForAuthorizedRequest} from "../state/store";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {List} from "../../../../../../mastodon-api/src/lib/interfaces/public/list";
|
||||
import {Account} from "../../../../../../mastodon-api/src/lib/interfaces/public/account";
|
||||
import {Account, List} from "projects/mastodon-api/src/public-api";
|
||||
|
||||
export interface Filters {
|
||||
username: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Injectable} from "@angular/core";
|
||||
import {Actions, createEffect, ofType} from "@ngrx/effects";
|
||||
import {fromAuthorize} from "../actions";
|
||||
import {catchError, exhaustMap, map, of, switchMap, tap, throwError} from "rxjs";
|
||||
import {catchError, exhaustMap, map, of, switchMap} from "rxjs";
|
||||
import {NbToastrService} from "@nebular/theme";
|
||||
import {MastodonApiAuthenticationService, RegisteredApp} from "projects/mastodon-api/src/public-api";
|
||||
import {Store} from "@ngrx/store";
|
||||
|
||||
@@ -91,23 +91,3 @@ export const selectLoading = createSelector(
|
||||
applicationStateFeature,
|
||||
(state: ApplicationState) => state.listsLoading || state.listAccountsLoading || state.followingsLoading
|
||||
);
|
||||
|
||||
export const selectLoadingPercentage = createSelector(
|
||||
applicationStateFeature,
|
||||
(state: ApplicationState) => {
|
||||
if (!state.listsLoading && !state.listAccountsLoading && !state.followingsLoading) {
|
||||
return 100;
|
||||
}
|
||||
if (state.listsLoading && !state.listAccountsLoading && !state.followingsLoading) {
|
||||
return 50;
|
||||
}
|
||||
if (!state.listsLoading && state.listAccountsLoading && !state.followingsLoading) {
|
||||
return 80;
|
||||
}
|
||||
if (!state.listsLoading && !state.listAccountsLoading && state.followingsLoading) {
|
||||
return 50;
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user