From 73b9cf78931edccc7ec0930869e1fb17ade0f3ca Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Mon, 26 Jul 2021 18:18:07 -0700 Subject: [PATCH 1/4] Settings is now a route instead of a dialog --- src/app/app-routing.module.ts | 2 ++ src/app/app.component.html | 11 +++++----- .../logs-viewer/logs-viewer.component.html | 2 +- src/app/main/main.component.ts | 4 ++-- src/app/posts.services.ts | 6 ++++++ src/app/settings/settings.component.html | 21 ++++++++----------- src/app/settings/settings.component.scss | 9 ++++++++ src/app/settings/settings.component.ts | 4 ++++ 8 files changed, 39 insertions(+), 20 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 523a893..276e990 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -7,12 +7,14 @@ import { SubscriptionComponent } from './subscription/subscription/subscription. import { PostsService } from './posts.services'; import { LoginComponent } from './components/login/login.component'; import { DownloadsComponent } from './components/downloads/downloads.component'; +import { SettingsComponent } from './settings/settings.component'; const routes: Routes = [ { path: 'home', component: MainComponent, canActivate: [PostsService] }, { path: 'player', component: PlayerComponent, canActivate: [PostsService]}, { path: 'subscriptions', component: SubscriptionsComponent, canActivate: [PostsService] }, { path: 'subscription', component: SubscriptionComponent, canActivate: [PostsService] }, + { path: 'settings', component: SettingsComponent, canActivate: [PostsService] }, { path: 'login', component: LoginComponent }, { path: 'downloads', component: DownloadsComponent }, { path: '', redirectTo: '/home', pathMatch: 'full' } diff --git a/src/app/app.component.html b/src/app/app.component.html index 4d8f2a7..10d286d 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -23,10 +23,10 @@ Dark - @@ -450,21 +449,19 @@ -
+
- - -
- -
-
+ diff --git a/src/app/settings/settings.component.scss b/src/app/settings/settings.component.scss index 59c58af..601cdb9 100644 --- a/src/app/settings/settings.component.scss +++ b/src/app/settings/settings.component.scss @@ -2,6 +2,15 @@ margin-bottom: 20px; } +.settings-title { + text-align: center; + margin-top: 15px; +} + +::ng-deep .mat-tab-body { + margin-left: 15px; +} + .ext-divider { margin-bottom: 14px; } diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts index 9f8bc3d..388ab84 100644 --- a/src/app/settings/settings.component.ts +++ b/src/app/settings/settings.component.ts @@ -85,6 +85,10 @@ export class SettingsComponent implements OnInit { }) } + cancelSettings() { + this.new_config = JSON.parse(JSON.stringify(this.initial_config)); + } + dropCategory(event: CdkDragDrop) { moveItemInArray(this.postsService.categories, event.previousIndex, event.currentIndex); this.postsService.updateCategories(this.postsService.categories).subscribe(res => { From 34245bd3396faaa251f036bea0aeacb4d17a0062 Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Sun, 1 Aug 2021 20:40:29 -0600 Subject: [PATCH 2/4] Updated styling for settings page Fixed issue where redirects to home occured when reloading the settings page Fixed errors that occured when loading the settings page --- src/app/app.component.html | 7 ++++-- src/app/app.component.ts | 12 +++++----- .../logs-viewer/logs-viewer.component.html | 2 +- .../modify-users/modify-users.component.html | 2 +- .../modify-users/modify-users.component.scss | 1 - src/app/settings/settings.component.html | 23 +++++++++---------- src/app/settings/settings.component.scss | 5 ++++ src/app/settings/settings.component.ts | 13 +++++++++-- 8 files changed, 40 insertions(+), 25 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 10d286d..df61ad2 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -44,9 +44,12 @@ Login Subscriptions Downloads - Settings - + + Settings + + + {{subscription.name}} diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a6c7630..cadd7ca 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,6 @@ import { Component, OnInit, ElementRef, ViewChild, HostBinding, AfterViewInit } from '@angular/core'; +import {MatDialogRef} from '@angular/material/dialog'; import {PostsService} from './posts.services'; -import {FileCardComponent} from './file-card/file-card.component'; -import { Observable } from 'rxjs/Observable'; -import {FormControl, Validators} from '@angular/forms'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import { MatDialog } from '@angular/material/dialog'; import { MatSidenav } from '@angular/material/sidenav'; import { MatSnackBar } from '@angular/material/snack-bar'; @@ -16,7 +13,6 @@ import 'rxjs/add/operator/filter' import 'rxjs/add/operator/debounceTime' import 'rxjs/add/operator/do' import 'rxjs/add/operator/switch' -import { YoutubeSearchService, Result } from './youtube-search.service'; import { Router, NavigationStart, NavigationEnd } from '@angular/router'; import { OverlayContainer } from '@angular/cdk/overlay'; import { THEMES_CONFIG } from '../themes'; @@ -28,7 +24,11 @@ import { SetDefaultAdminDialogComponent } from './dialogs/set-default-admin-dial @Component({ selector: 'app-root', templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + styleUrls: ['./app.component.css'], + providers: [{ + provide: MatDialogRef, + useValue: {} + }] }) export class AppComponent implements OnInit, AfterViewInit { diff --git a/src/app/components/logs-viewer/logs-viewer.component.html b/src/app/components/logs-viewer/logs-viewer.component.html index df48775..e10cf2b 100644 --- a/src/app/components/logs-viewer/logs-viewer.component.html +++ b/src/app/components/logs-viewer/logs-viewer.component.html @@ -10,7 +10,7 @@ --> -
+
{{log.text}}
diff --git a/src/app/components/modify-users/modify-users.component.html b/src/app/components/modify-users/modify-users.component.html index cd054af..d985417 100644 --- a/src/app/components/modify-users/modify-users.component.html +++ b/src/app/components/modify-users/modify-users.component.html @@ -1,7 +1,7 @@
-
+
diff --git a/src/app/components/modify-users/modify-users.component.scss b/src/app/components/modify-users/modify-users.component.scss index d509a56..0a4d589 100644 --- a/src/app/components/modify-users/modify-users.component.scss +++ b/src/app/components/modify-users/modify-users.component.scss @@ -1,5 +1,4 @@ .edit-role { position: relative; top: -50px; - left: 35px; } \ No newline at end of file diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index 1ad3bcb..618270c 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -6,7 +6,7 @@
--> - + @@ -400,8 +400,7 @@ - -
+
Allow user registration
@@ -445,7 +444,7 @@
- +
@@ -456,12 +455,12 @@
-
- - -
+
+ + +
diff --git a/src/app/settings/settings.component.scss b/src/app/settings/settings.component.scss index 601cdb9..f702e64 100644 --- a/src/app/settings/settings.component.scss +++ b/src/app/settings/settings.component.scss @@ -99,4 +99,9 @@ .transfer-db-div { margin-bottom: 10px; +} + +.action-buttons { + position: absolute; + bottom: 15px; } \ No newline at end of file diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts index ce03773..483c4db 100644 --- a/src/app/settings/settings.component.ts +++ b/src/app/settings/settings.component.ts @@ -51,8 +51,17 @@ export class SettingsComponent implements OnInit { private dialog: MatDialog) { } ngOnInit() { - this.getConfig(); - this.getDBInfo(); + if (this.postsService.initialized) { + this.getConfig(); + this.getDBInfo(); + } else { + this.postsService.service_initialized.subscribe(init => { + if (init) { + this.getConfig(); + this.getDBInfo(); + } + }); + } this.generated_bookmarklet_code = this.sanitizer.bypassSecurityTrustUrl(this.generateBookmarkletCode()); From dac5919ffb8614b47ef74a18722eedd6180f3d68 Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Sun, 1 Aug 2021 20:41:13 -0600 Subject: [PATCH 3/4] Updated look of buttons and several home page elements --- .../components/recent-videos/recent-videos.component.html | 2 +- src/app/main/main.component.css | 8 ++++++-- src/app/main/main.component.html | 2 +- src/styles.scss | 6 +++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/app/components/recent-videos/recent-videos.component.html b/src/app/components/recent-videos/recent-videos.component.html index 9b00952..254082c 100644 --- a/src/app/components/recent-videos/recent-videos.component.html +++ b/src/app/components/recent-videos/recent-videos.component.html @@ -28,7 +28,7 @@
-
+
diff --git a/src/app/main/main.component.css b/src/app/main/main.component.css index 8411370..e2325f2 100644 --- a/src/app/main/main.component.css +++ b/src/app/main/main.component.css @@ -133,12 +133,16 @@ mat-form-field.mat-form-field { top: -5px; } +.border-radius-both { + border-radius: 16px; +} + .no-border-radius-bottom { - border-radius: 4px 4px 0px 0px; + border-radius: 16px 16px 0px 0px; } .no-border-radius-top { - border-radius: 0px 0px 4px 4px; + border-radius: 0px 0px 16px 16px; } @media (max-width: 576px) { diff --git a/src/app/main/main.component.html b/src/app/main/main.component.html index 80fb3c2..b81e866 100644 --- a/src/app/main/main.component.html +++ b/src/app/main/main.component.html @@ -1,6 +1,6 @@
- +
diff --git a/src/styles.scss b/src/styles.scss index 41ef9ea..be060c8 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -42,6 +42,10 @@ $dark-theme: mat-dark-theme($dark-primary, $dark-accent, $dark-warn); @include angular-material-theme($dark-theme); } +.mat-stroked-button, .mat-raised-button, .mat-flat-button { + border-radius: 24px !important +} + // Light theme $light-primary: mat-palette($mat-grey, 200, 500, 300); $light-accent: mat-palette($mat-brown, 200); @@ -50,7 +54,7 @@ $light-warn: mat-palette($mat-deep-orange, 200); $light-theme: mat-light-theme($light-primary, $light-accent, $light-warn); .light-theme { - @include angular-material-theme($light-theme) + @include angular-material-theme($light-theme); } .no-outline { From 2756cfae178c7579a38b3f05b87fb745d975bf4a Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Sun, 1 Aug 2021 20:41:36 -0600 Subject: [PATCH 4/4] Login component is now a lot prettier --- src/app/components/login/login.component.html | 16 +++++----- src/app/components/login/login.component.scss | 29 ++++++++++++++++++- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/app/components/login/login.component.html b/src/app/components/login/login.component.html index 6ca9ba9..7ff151f 100644 --- a/src/app/components/login/login.component.html +++ b/src/app/components/login/login.component.html @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/src/app/components/login/login.component.scss b/src/app/components/login/login.component.scss index fe190de..77377ac 100644 --- a/src/app/components/login/login.component.scss +++ b/src/app/components/login/login.component.scss @@ -1,6 +1,33 @@ .login-card { - max-width: 600px; + max-width: 400px; width: 80%; margin: 0 auto; margin-top: 20px; + padding-top: 8px; +} + +.login-div { + height: calc(100% - 170px); + overflow-y: auto; +} + +.login-button-div { + margin-bottom: 10px; + margin-top: 10px; + margin-left: -16px; + margin-right: -16px; + bottom: 0px; + width: 100%; + position: absolute; +} + +.login-button-div > button { + width: 100%; + border-radius: 0px 0px 4px 4px !important; +} + +.login-progress-bar { + position: absolute; + bottom: 0px; + border-radius: 0px 0px 4px 4px; } \ No newline at end of file