diff --git a/projects/mastodon-api/src/lib/interfaces/public/public.ts b/projects/mastodon-api/src/lib/interfaces/public/public.ts index 871105c..dc59109 100644 --- a/projects/mastodon-api/src/lib/interfaces/public/public.ts +++ b/projects/mastodon-api/src/lib/interfaces/public/public.ts @@ -1,4 +1,3 @@ export * from './account'; export * from './list'; export * from './registered_app'; -export * from './user_account'; diff --git a/projects/mastodon-api/src/lib/interfaces/public/user_account.ts b/projects/mastodon-api/src/lib/interfaces/public/user_account.ts deleted file mode 100644 index e0512c2..0000000 --- a/projects/mastodon-api/src/lib/interfaces/public/user_account.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface UserAccount { - id: string; -} diff --git a/projects/mastodon-api/src/lib/services/mastodon-api-accounts.service.ts b/projects/mastodon-api/src/lib/services/mastodon-api-accounts.service.ts index 4696c6e..ddf9f91 100644 --- a/projects/mastodon-api/src/lib/services/mastodon-api-accounts.service.ts +++ b/projects/mastodon-api/src/lib/services/mastodon-api-accounts.service.ts @@ -3,7 +3,6 @@ import {MastodonApiService} from "./mastodon-api.service"; import {map, Observable} from "rxjs"; import {GetAccountResponse} from "../interfaces/responses/get_account_response"; import {Account} from "../interfaces/public/account"; -import {HttpResponse} from "@angular/common/http"; @Injectable({ providedIn: 'root' diff --git a/projects/mastodon-api/src/lib/services/mastodon-api-authentication.service.ts b/projects/mastodon-api/src/lib/services/mastodon-api-authentication.service.ts index 895180c..ffe9519 100644 --- a/projects/mastodon-api/src/lib/services/mastodon-api-authentication.service.ts +++ b/projects/mastodon-api/src/lib/services/mastodon-api-authentication.service.ts @@ -1,5 +1,5 @@ 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 {GetAccessTokenResponse} from "../interfaces/responses/get_access_token_response"; import {VerifyCredentialsResponse} from "../interfaces/responses/verify_credentials_response"; diff --git a/projects/mastodon-api/src/lib/services/mastodon-api-lists.service.ts b/projects/mastodon-api/src/lib/services/mastodon-api-lists.service.ts index 1cd4842..aae2bee 100644 --- a/projects/mastodon-api/src/lib/services/mastodon-api-lists.service.ts +++ b/projects/mastodon-api/src/lib/services/mastodon-api-lists.service.ts @@ -1,6 +1,5 @@ import {Injectable} from '@angular/core'; -import {concatMap, from, map, mergeAll, mergeMap, Observable, reduce, switchMap, tap, toArray} from "rxjs"; -import {VerifyCredentialsResponse} from "../interfaces/responses/verify_credentials_response"; +import {map, Observable} from "rxjs"; import {MastodonApiService} from "./mastodon-api.service"; import {GetListsResponse} from "../interfaces/responses/get_lists_response"; import {GetAccountResponse} from "../interfaces/responses/get_account_response"; diff --git a/projects/mastodon-api/src/public-api.ts b/projects/mastodon-api/src/public-api.ts index 57dd92d..58d040f 100644 --- a/projects/mastodon-api/src/public-api.ts +++ b/projects/mastodon-api/src/public-api.ts @@ -4,3 +4,4 @@ export * from './lib/services/services'; export * from './lib/interfaces/interfaces'; +export * from './lib/mastodon-api.module'; diff --git a/projects/mastolists/src/app/app.component.spec.ts b/projects/mastolists/src/app/app.component.spec.ts index 767ba3c..6ad76c7 100644 --- a/projects/mastolists/src/app/app.component.spec.ts +++ b/projects/mastolists/src/app/app.component.spec.ts @@ -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!'); + }); }); diff --git a/projects/mastolists/src/app/app.component.ts b/projects/mastolists/src/app/app.component.ts index c28e152..eeeb0bf 100644 --- a/projects/mastolists/src/app/app.component.ts +++ b/projects/mastolists/src/app/app.component.ts @@ -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', diff --git a/projects/mastolists/src/app/app.module.ts b/projects/mastolists/src/app/app.module.ts index ba1d9b5..5e69770 100644 --- a/projects/mastolists/src/app/app.module.ts +++ b/projects/mastolists/src/app/app.module.ts @@ -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"; diff --git a/projects/mastolists/src/app/authorization/authorize/authorize.component.ts b/projects/mastolists/src/app/authorization/authorize/authorize.component.ts index 288e6d6..dd5fcf5 100644 --- a/projects/mastolists/src/app/authorization/authorize/authorize.component.ts +++ b/projects/mastolists/src/app/authorization/authorize/authorize.component.ts @@ -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), diff --git a/projects/mastolists/src/app/authorization/guards/auth.guard.ts b/projects/mastolists/src/app/authorization/guards/auth.guard.ts index d620eca..606d6ea 100644 --- a/projects/mastolists/src/app/authorization/guards/auth.guard.ts +++ b/projects/mastolists/src/app/authorization/guards/auth.guard.ts @@ -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 { diff --git a/projects/mastolists/src/app/followings/followings.module.ts b/projects/mastolists/src/app/followings/followings.module.ts index 8e5012f..63b86b3 100644 --- a/projects/mastolists/src/app/followings/followings.module.ts +++ b/projects/mastolists/src/app/followings/followings.module.ts @@ -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"; diff --git a/projects/mastolists/src/app/followings/matrix/matrix.component.scss b/projects/mastolists/src/app/followings/matrix/matrix.component.scss index 15f51f6..2386c5d 100644 --- a/projects/mastolists/src/app/followings/matrix/matrix.component.scss +++ b/projects/mastolists/src/app/followings/matrix/matrix.component.scss @@ -42,8 +42,3 @@ table { line-height: 5px; } } - -nb-card.more-info-panel { - min-width: 450px; - max-width: 800px; -} diff --git a/projects/mastolists/src/app/followings/table/table.component.ts b/projects/mastolists/src/app/followings/table/table.component.ts index a29aa60..64fa807 100644 --- a/projects/mastolists/src/app/followings/table/table.component.ts +++ b/projects/mastolists/src/app/followings/table/table.component.ts @@ -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; diff --git a/projects/mastolists/src/app/lists/lists/lists.component.ts b/projects/mastolists/src/app/lists/lists/lists.component.ts index 2651ea8..430474f 100644 --- a/projects/mastolists/src/app/lists/lists/lists.component.ts +++ b/projects/mastolists/src/app/lists/lists/lists.component.ts @@ -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', diff --git a/projects/mastolists/src/app/shared/components/account/account.component.scss b/projects/mastolists/src/app/shared/components/account/account.component.scss index ebda290..219ddbe 100644 --- a/projects/mastolists/src/app/shared/components/account/account.component.scss +++ b/projects/mastolists/src/app/shared/components/account/account.component.scss @@ -2,10 +2,6 @@ width: 100%; } -td.field-label { - min-width: 180px; -} - .table { display: flex; flex-direction: column; diff --git a/projects/mastolists/src/app/shared/components/filters/filters.component.scss b/projects/mastolists/src/app/shared/components/filters/filters.component.scss index f435504..ac31792 100644 --- a/projects/mastolists/src/app/shared/components/filters/filters.component.scss +++ b/projects/mastolists/src/app/shared/components/filters/filters.component.scss @@ -23,14 +23,6 @@ } -.buttons { - padding-top: 20px; - - button { - margin-right: 10px; - } -} - @media (max-width: 573px) { .form { flex-direction: column; diff --git a/projects/mastolists/src/app/shared/services/account.service.ts b/projects/mastolists/src/app/shared/services/account.service.ts index 5e070a0..7a4201e 100644 --- a/projects/mastolists/src/app/shared/services/account.service.ts +++ b/projects/mastolists/src/app/shared/services/account.service.ts @@ -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"; diff --git a/projects/mastolists/src/app/shared/services/list.service.ts b/projects/mastolists/src/app/shared/services/list.service.ts index 8770a86..7064bd7 100644 --- a/projects/mastolists/src/app/shared/services/list.service.ts +++ b/projects/mastolists/src/app/shared/services/list.service.ts @@ -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"; diff --git a/projects/mastolists/src/app/shared/state/store/application-state.ts b/projects/mastolists/src/app/shared/state/store/application-state.ts index bf8b9de..86095e2 100644 --- a/projects/mastolists/src/app/shared/state/store/application-state.ts +++ b/projects/mastolists/src/app/shared/state/store/application-state.ts @@ -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; diff --git a/projects/mastolists/src/app/shared/state/store/effects/authorization-state.effects.ts b/projects/mastolists/src/app/shared/state/store/effects/authorization-state.effects.ts index f3a8ec0..f4ffd21 100644 --- a/projects/mastolists/src/app/shared/state/store/effects/authorization-state.effects.ts +++ b/projects/mastolists/src/app/shared/state/store/effects/authorization-state.effects.ts @@ -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"; diff --git a/projects/mastolists/src/app/shared/state/store/selectors/application-state.selectors.ts b/projects/mastolists/src/app/shared/state/store/selectors/application-state.selectors.ts index e700a92..2a76fe5 100644 --- a/projects/mastolists/src/app/shared/state/store/selectors/application-state.selectors.ts +++ b/projects/mastolists/src/app/shared/state/store/selectors/application-state.selectors.ts @@ -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; - }, -); -