chore: import clean-up
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
export * from './account';
|
export * from './account';
|
||||||
export * from './list';
|
export * from './list';
|
||||||
export * from './registered_app';
|
export * from './registered_app';
|
||||||
export * from './user_account';
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
export interface UserAccount {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,6 @@ import {MastodonApiService} from "./mastodon-api.service";
|
|||||||
import {map, Observable} from "rxjs";
|
import {map, Observable} from "rxjs";
|
||||||
import {GetAccountResponse} from "../interfaces/responses/get_account_response";
|
import {GetAccountResponse} from "../interfaces/responses/get_account_response";
|
||||||
import {Account} from "../interfaces/public/account";
|
import {Account} from "../interfaces/public/account";
|
||||||
import {HttpResponse} from "@angular/common/http";
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {catchError, map, Observable, of, throwError} from "rxjs";
|
import {catchError, map, Observable, throwError} from "rxjs";
|
||||||
import {RegisterAppResponse} from "../interfaces/responses/register_app_response";
|
import {RegisterAppResponse} from "../interfaces/responses/register_app_response";
|
||||||
import {GetAccessTokenResponse} from "../interfaces/responses/get_access_token_response";
|
import {GetAccessTokenResponse} from "../interfaces/responses/get_access_token_response";
|
||||||
import {VerifyCredentialsResponse} from "../interfaces/responses/verify_credentials_response";
|
import {VerifyCredentialsResponse} from "../interfaces/responses/verify_credentials_response";
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {concatMap, from, map, mergeAll, mergeMap, Observable, reduce, switchMap, tap, toArray} from "rxjs";
|
import {map, Observable} from "rxjs";
|
||||||
import {VerifyCredentialsResponse} from "../interfaces/responses/verify_credentials_response";
|
|
||||||
import {MastodonApiService} from "./mastodon-api.service";
|
import {MastodonApiService} from "./mastodon-api.service";
|
||||||
import {GetListsResponse} from "../interfaces/responses/get_lists_response";
|
import {GetListsResponse} from "../interfaces/responses/get_lists_response";
|
||||||
import {GetAccountResponse} from "../interfaces/responses/get_account_response";
|
import {GetAccountResponse} from "../interfaces/responses/get_account_response";
|
||||||
|
|||||||
@@ -4,3 +4,4 @@
|
|||||||
|
|
||||||
export * from './lib/services/services';
|
export * from './lib/services/services';
|
||||||
export * from './lib/interfaces/interfaces';
|
export * from './lib/interfaces/interfaces';
|
||||||
|
export * from './lib/mastodon-api.module';
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ describe('AppComponent', () => {
|
|||||||
it(`should have as title 'mastolists'`, () => {
|
it(`should have as title 'mastolists'`, () => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
const app = fixture.componentInstance;
|
const app = fixture.componentInstance;
|
||||||
expect(app.title).toEqual('mastolists');
|
expect(app.appName).toEqual('mastolists');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render title', () => {
|
it('should render title', () => {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import {fromApplication, fromAuthorize, selectIsLoggedIn} from "./shared/state/s
|
|||||||
import {environment} from "../environments/environment";
|
import {environment} from "../environments/environment";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import packageJson from '../../../../package.json';
|
import packageJson from '../../../../package.json';
|
||||||
import {tap} from "rxjs";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
|
|||||||
@@ -3,17 +3,8 @@ import {BrowserModule} from '@angular/platform-browser';
|
|||||||
|
|
||||||
import {AppRoutingModule} from './app-routing.module';
|
import {AppRoutingModule} from './app-routing.module';
|
||||||
import {AppComponent} from './app.component';
|
import {AppComponent} from './app.component';
|
||||||
import {MastodonApiModule} from "../../../mastodon-api/src/lib/mastodon-api.module";
|
import {MastodonApiModule} from "projects/mastodon-api/src/public-api";
|
||||||
import {
|
import {NbActionsModule, NbContextMenuModule, NbDialogModule, NbGlobalPhysicalPosition, NbLayoutModule, NbMenuModule, NbThemeModule, NbToastrModule} from "@nebular/theme";
|
||||||
NbActionsModule,
|
|
||||||
NbContextMenuModule,
|
|
||||||
NbDialogModule,
|
|
||||||
NbGlobalPhysicalPosition,
|
|
||||||
NbLayoutModule,
|
|
||||||
NbMenuModule,
|
|
||||||
NbThemeModule,
|
|
||||||
NbToastrModule
|
|
||||||
} from "@nebular/theme";
|
|
||||||
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
|
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
|
||||||
import {SharedModule} from './shared/shared.module';
|
import {SharedModule} from './shared/shared.module';
|
||||||
import {NbEvaIconsModule} from "@nebular/eva-icons";
|
import {NbEvaIconsModule} from "@nebular/eva-icons";
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {FormControl, FormGroup, Validators} from "@angular/forms";
|
import {FormControl, FormGroup, Validators} from "@angular/forms";
|
||||||
import {ActivatedRoute, Params} from "@angular/router";
|
import {ActivatedRoute} from "@angular/router";
|
||||||
import {concat, filter, map, merge, Observable, take, tap, withLatestFrom, zip, zipWith} from "rxjs";
|
import {filter, map, Observable, take, tap, zip} from "rxjs";
|
||||||
import {select, Store} from "@ngrx/store";
|
import {select, Store} from "@ngrx/store";
|
||||||
import {
|
import {
|
||||||
selectAuthorizingUserFlag,
|
|
||||||
selectCurrentInstance,
|
|
||||||
fromAuthorize,
|
fromAuthorize,
|
||||||
|
selectApplicationRegisteredFlag,
|
||||||
|
selectAuthorizingUserFlag,
|
||||||
|
selectCurrentInstanceWithApplicationRegisteredState,
|
||||||
|
selectDataForAuthorizationFlow,
|
||||||
selectIsLoggedIn,
|
selectIsLoggedIn,
|
||||||
selectRegisteringApplicationFlag,
|
selectRegisteringApplicationFlag
|
||||||
selectDataForAuthorizationFlow, selectApplicationRegisteredFlag, selectCurrentInstanceWithApplicationRegisteredState
|
|
||||||
} from "../../shared/state/store";
|
} from "../../shared/state/store";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -52,7 +53,7 @@ export class AuthorizeComponent implements OnInit, OnDestroy {
|
|||||||
.pipe(
|
.pipe(
|
||||||
filter(([params, instanceName, isLoggedIn]) => params['code'] && instanceName !== undefined && !isLoggedIn),
|
filter(([params, instanceName, isLoggedIn]) => params['code'] && instanceName !== undefined && !isLoggedIn),
|
||||||
take(1),
|
take(1),
|
||||||
).subscribe(([params, instanceName, isLoggedIn]) => {
|
).subscribe(([params]) => {
|
||||||
this.store.pipe(
|
this.store.pipe(
|
||||||
select(selectDataForAuthorizationFlow),
|
select(selectDataForAuthorizationFlow),
|
||||||
take(1),
|
take(1),
|
||||||
|
|||||||
@@ -3,14 +3,11 @@ import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from "
|
|||||||
import {Observable, tap} from "rxjs";
|
import {Observable, tap} from "rxjs";
|
||||||
import {select, Store} from "@ngrx/store";
|
import {select, Store} from "@ngrx/store";
|
||||||
import {selectIsLoggedIn} from "../../shared/state/store";
|
import {selectIsLoggedIn} from "../../shared/state/store";
|
||||||
import {MastodonApiAuthenticationService} from 'projects/mastodon-api/src/public-api';
|
|
||||||
|
|
||||||
@Injectable({providedIn: 'root'})
|
@Injectable({providedIn: 'root'})
|
||||||
export class AuthGuard implements CanActivate {
|
export class AuthGuard implements CanActivate {
|
||||||
|
|
||||||
constructor(private store: Store,
|
constructor(private store: Store, private router: Router) {
|
||||||
private router: Router,
|
|
||||||
private mastodonApiAuthService: MastodonApiAuthenticationService) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
|
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {NgModule} from '@angular/core';
|
|||||||
import {CommonModule} from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
import {SharedModule} from "../shared/shared.module";
|
import {SharedModule} from "../shared/shared.module";
|
||||||
import {FollowingsRoutingModule} from "./followings-list-routing.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 {ListComponent} from "./list/list.component";
|
||||||
import {TableComponent} from "./table/table.component";
|
import {TableComponent} from "./table/table.component";
|
||||||
import {MatrixComponent} from "./matrix/matrix.component";
|
import {MatrixComponent} from "./matrix/matrix.component";
|
||||||
|
|||||||
@@ -42,8 +42,3 @@ table {
|
|||||||
line-height: 5px;
|
line-height: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nb-card.more-info-panel {
|
|
||||||
min-width: 450px;
|
|
||||||
max-width: 800px;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {map, Observable} from "rxjs";
|
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 {select, Store} from "@ngrx/store";
|
||||||
import {selectFilteredFollowingsWithLists, selectLists} from "../../shared/state/store/selectors";
|
import {fromTableViewPage, selectFilteredFollowingsWithLists, selectLists} from "../../shared/state/store";
|
||||||
import {fromTableViewPage} from "../../shared/state/store";
|
import {Account, List} from 'projects/mastodon-api/src/public-api';
|
||||||
|
|
||||||
interface DataGridRow {
|
interface DataGridRow {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ import {Component} from '@angular/core';
|
|||||||
import {List} from 'projects/mastodon-api/src/public-api';
|
import {List} from 'projects/mastodon-api/src/public-api';
|
||||||
import {Observable} from "rxjs";
|
import {Observable} from "rxjs";
|
||||||
import {select, Store} from "@ngrx/store";
|
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 {FormControl, FormGroup} from "@angular/forms";
|
||||||
import {fromListsPage} from '../../shared/state/store';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-lists',
|
selector: 'app-lists',
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
td.field-label {
|
|
||||||
min-width: 180px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -23,14 +23,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttons {
|
|
||||||
padding-top: 20px;
|
|
||||||
|
|
||||||
button {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 573px) {
|
@media (max-width: 573px) {
|
||||||
.form {
|
.form {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Injectable, OnDestroy} from '@angular/core';
|
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 {select, Store} from "@ngrx/store";
|
||||||
import {Account, MastodonApiAccountsService} from 'projects/mastodon-api/src/public-api';
|
import {Account, MastodonApiAccountsService} from 'projects/mastodon-api/src/public-api';
|
||||||
import {selectDataForAuthorizedRequest} from "../state/store";
|
import {selectDataForAuthorizedRequest} from "../state/store";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Injectable, OnDestroy} from '@angular/core';
|
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 {select, Store} from "@ngrx/store";
|
||||||
import {List, MastodonApiListsService} from 'projects/mastodon-api/src/public-api';
|
import {List, MastodonApiListsService} from 'projects/mastodon-api/src/public-api';
|
||||||
import {selectDataForAuthorizedRequest} from "../state/store";
|
import {selectDataForAuthorizedRequest} from "../state/store";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {List} from "../../../../../../mastodon-api/src/lib/interfaces/public/list";
|
import {Account, List} from "projects/mastodon-api/src/public-api";
|
||||||
import {Account} from "../../../../../../mastodon-api/src/lib/interfaces/public/account";
|
|
||||||
|
|
||||||
export interface Filters {
|
export interface Filters {
|
||||||
username: string;
|
username: string;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {Injectable} from "@angular/core";
|
import {Injectable} from "@angular/core";
|
||||||
import {Actions, createEffect, ofType} from "@ngrx/effects";
|
import {Actions, createEffect, ofType} from "@ngrx/effects";
|
||||||
import {fromAuthorize} from "../actions";
|
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 {NbToastrService} from "@nebular/theme";
|
||||||
import {MastodonApiAuthenticationService, RegisteredApp} from "projects/mastodon-api/src/public-api";
|
import {MastodonApiAuthenticationService, RegisteredApp} from "projects/mastodon-api/src/public-api";
|
||||||
import {Store} from "@ngrx/store";
|
import {Store} from "@ngrx/store";
|
||||||
|
|||||||
@@ -91,23 +91,3 @@ export const selectLoading = createSelector(
|
|||||||
applicationStateFeature,
|
applicationStateFeature,
|
||||||
(state: ApplicationState) => state.listsLoading || state.listAccountsLoading || state.followingsLoading
|
(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