diff --git a/CHANGELOG.md b/CHANGELOG.md
index be0e0135a..a753aab6a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Improved the market price on the first buy date in the chart of the position detail dialog
+- Restructured the admin control panel with a new settings tab
## 1.268.0 - 2023-05-08
diff --git a/apps/client/src/app/components/admin-platform/admin-platform.component.html b/apps/client/src/app/components/admin-platform/admin-platform.component.html
index ce83ddfdc..305fda673 100644
--- a/apps/client/src/app/components/admin-platform/admin-platform.component.html
+++ b/apps/client/src/app/components/admin-platform/admin-platform.component.html
@@ -1,6 +1,17 @@
+
-
-
diff --git a/apps/client/src/app/components/admin-platform/admin-platform.component.scss b/apps/client/src/app/components/admin-platform/admin-platform.component.scss
index 8d0a69f27..b5b58f67e 100644
--- a/apps/client/src/app/components/admin-platform/admin-platform.component.scss
+++ b/apps/client/src/app/components/admin-platform/admin-platform.component.scss
@@ -2,11 +2,4 @@
:host {
display: block;
-
- .fab-container {
- position: fixed;
- right: 2rem;
- bottom: 4rem;
- z-index: 999;
- }
}
diff --git a/apps/client/src/app/components/admin-platform/platform.component.ts b/apps/client/src/app/components/admin-platform/admin-platform.component.ts
similarity index 83%
rename from apps/client/src/app/components/admin-platform/platform.component.ts
rename to apps/client/src/app/components/admin-platform/admin-platform.component.ts
index 66b85d1c2..f3fbb348d 100644
--- a/apps/client/src/app/components/admin-platform/platform.component.ts
+++ b/apps/client/src/app/components/admin-platform/admin-platform.component.ts
@@ -1,4 +1,5 @@
import {
+ ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
OnDestroy,
@@ -13,8 +14,7 @@ import { CreatePlatformDto } from '@ghostfolio/api/app/platform/create-platform.
import { UpdatePlatformDto } from '@ghostfolio/api/app/platform/update-platform.dto';
import { AdminService } from '@ghostfolio/client/services/admin.service';
import { UserService } from '@ghostfolio/client/services/user/user.service';
-import { hasPermission, permissions } from '@ghostfolio/common/permissions';
-import { Platform, Platform as PlatformModel } from '@prisma/client';
+import { Platform } from '@prisma/client';
import { get } from 'lodash';
import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject, takeUntil } from 'rxjs';
@@ -22,7 +22,7 @@ import { Subject, takeUntil } from 'rxjs';
import { CreateOrUpdatePlatformDialog } from './create-or-update-platform-dialog/create-or-update-account-platform.component';
@Component({
- host: { class: 'page' },
+ changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'gf-admin-platform',
styleUrls: ['./admin-platform.component.scss'],
templateUrl: './admin-platform.component.html'
@@ -33,9 +33,7 @@ export class AdminPlatformComponent implements OnInit, OnDestroy {
public dataSource: MatTableDataSource = new MatTableDataSource();
public deviceType: string;
public displayedColumns = ['name', 'url', 'accounts', 'actions'];
- public hasPermissionToCreatePlatform: boolean;
- public hasPermissionToDeletePlatform: boolean;
- public platforms: PlatformModel[];
+ public platforms: Platform[];
private unsubscribeSubject = new Subject();
@@ -51,9 +49,9 @@ export class AdminPlatformComponent implements OnInit, OnDestroy {
this.route.queryParams
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((params) => {
- if (params['createDialog'] && this.hasPermissionToCreatePlatform) {
+ if (params['createPlatformDialog']) {
this.openCreatePlatformDialog();
- } else if (params['editDialog']) {
+ } else if (params['editPlatformDialog']) {
if (this.platforms) {
const platform = this.platforms.find(({ id }) => {
return id === params['platformId'];
@@ -70,25 +68,6 @@ export class AdminPlatformComponent implements OnInit, OnDestroy {
public ngOnInit() {
this.deviceType = this.deviceService.getDeviceInfo().deviceType;
- this.userService.stateChanged
- .pipe(takeUntil(this.unsubscribeSubject))
- .subscribe((state) => {
- if (state?.user) {
- const user = state.user;
-
- this.hasPermissionToCreatePlatform = hasPermission(
- user.permissions,
- permissions.createPlatform
- );
- this.hasPermissionToDeletePlatform = hasPermission(
- user.permissions,
- permissions.deletePlatform
- );
-
- this.changeDetectorRef.markForCheck();
- }
- });
-
this.fetchPlatforms();
}
@@ -102,9 +81,9 @@ export class AdminPlatformComponent implements OnInit, OnDestroy {
}
}
- public onUpdatePlatform(aPlatform: PlatformModel) {
+ public onUpdatePlatform({ id }: Platform) {
this.router.navigate([], {
- queryParams: { platformId: aPlatform.id, editDialog: true }
+ queryParams: { editPlatformDialog: true, platformId: id }
});
}
diff --git a/apps/client/src/app/components/admin-platform/admin-platform.module.ts b/apps/client/src/app/components/admin-platform/admin-platform.module.ts
index 53da397b2..cec98c5ac 100644
--- a/apps/client/src/app/components/admin-platform/admin-platform.module.ts
+++ b/apps/client/src/app/components/admin-platform/admin-platform.module.ts
@@ -7,11 +7,12 @@ import { MatTableModule } from '@angular/material/table';
import { RouterModule } from '@angular/router';
import { GfSymbolIconModule } from '@ghostfolio/client/components/symbol-icon/symbol-icon.module';
+import { AdminPlatformComponent } from './admin-platform.component';
import { GfCreateOrUpdatePlatformDialogModule } from './create-or-update-platform-dialog/create-or-update-platform-dialog.module';
-import { AdminPlatformComponent } from './platform.component';
@NgModule({
declarations: [AdminPlatformComponent],
+ exports: [AdminPlatformComponent],
imports: [
CommonModule,
GfCreateOrUpdatePlatformDialogModule,
diff --git a/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-account-platform.component.ts b/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-account-platform.component.ts
index 65dd6f755..55d466a9a 100644
--- a/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-account-platform.component.ts
+++ b/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-account-platform.component.ts
@@ -5,9 +5,9 @@ import { Subject } from 'rxjs';
import { CreateOrUpdatePlatformDialogParams } from './interfaces/interfaces';
@Component({
+ changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'h-100' },
selector: 'gf-create-or-update-platform-dialog',
- changeDetection: ChangeDetectionStrategy.OnPush,
styleUrls: ['./create-or-update-platform-dialog.scss'],
templateUrl: 'create-or-update-platform-dialog.html'
})
diff --git a/apps/client/src/app/components/admin-settings/admin-settings.component.html b/apps/client/src/app/components/admin-settings/admin-settings.component.html
new file mode 100644
index 000000000..aa4395b27
--- /dev/null
+++ b/apps/client/src/app/components/admin-settings/admin-settings.component.html
@@ -0,0 +1,15 @@
+
diff --git a/apps/client/src/app/components/admin-settings/admin-settings.component.scss b/apps/client/src/app/components/admin-settings/admin-settings.component.scss
new file mode 100644
index 000000000..b5b58f67e
--- /dev/null
+++ b/apps/client/src/app/components/admin-settings/admin-settings.component.scss
@@ -0,0 +1,5 @@
+@import 'apps/client/src/styles/ghostfolio-style';
+
+:host {
+ display: block;
+}
diff --git a/apps/client/src/app/components/admin-settings/admin-settings.component.ts b/apps/client/src/app/components/admin-settings/admin-settings.component.ts
new file mode 100644
index 000000000..97066d533
--- /dev/null
+++ b/apps/client/src/app/components/admin-settings/admin-settings.component.ts
@@ -0,0 +1,27 @@
+import {
+ ChangeDetectionStrategy,
+ Component,
+ OnDestroy,
+ OnInit
+} from '@angular/core';
+import { Subject } from 'rxjs';
+
+@Component({
+ changeDetection: ChangeDetectionStrategy.OnPush,
+ host: { class: 'page' },
+ selector: 'gf-admin-settings',
+ styleUrls: ['./admin-settings.component.scss'],
+ templateUrl: './admin-settings.component.html'
+})
+export class AdminSettingsComponent implements OnInit, OnDestroy {
+ private unsubscribeSubject = new Subject();
+
+ public constructor() {}
+
+ public ngOnInit() {}
+
+ public ngOnDestroy() {
+ this.unsubscribeSubject.next();
+ this.unsubscribeSubject.complete();
+ }
+}
diff --git a/apps/client/src/app/components/admin-settings/admin-settings.module.ts b/apps/client/src/app/components/admin-settings/admin-settings.module.ts
new file mode 100644
index 000000000..aaa16651f
--- /dev/null
+++ b/apps/client/src/app/components/admin-settings/admin-settings.module.ts
@@ -0,0 +1,13 @@
+import { CommonModule } from '@angular/common';
+import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
+import { RouterModule } from '@angular/router';
+import { GfAdminPlatformModule } from '@ghostfolio/client/components/admin-platform/admin-platform.module';
+
+import { AdminSettingsComponent } from './admin-settings.component';
+
+@NgModule({
+ declarations: [AdminSettingsComponent],
+ imports: [CommonModule, GfAdminPlatformModule, RouterModule],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
+})
+export class GfAdminSettingsModule {}
diff --git a/apps/client/src/app/pages/admin/admin-page-routing.module.ts b/apps/client/src/app/pages/admin/admin-page-routing.module.ts
index 6cdc44856..5ebd69b42 100644
--- a/apps/client/src/app/pages/admin/admin-page-routing.module.ts
+++ b/apps/client/src/app/pages/admin/admin-page-routing.module.ts
@@ -3,7 +3,7 @@ import { RouterModule, Routes } from '@angular/router';
import { AdminJobsComponent } from '@ghostfolio/client/components/admin-jobs/admin-jobs.component';
import { AdminMarketDataComponent } from '@ghostfolio/client/components/admin-market-data/admin-market-data.component';
import { AdminOverviewComponent } from '@ghostfolio/client/components/admin-overview/admin-overview.component';
-import { AdminPlatformComponent } from '@ghostfolio/client/components/admin-platform/platform.component';
+import { AdminSettingsComponent } from '@ghostfolio/client/components/admin-settings/admin-settings.component';
import { AdminUsersComponent } from '@ghostfolio/client/components/admin-users/admin-users.component';
import { AuthGuard } from '@ghostfolio/client/core/auth.guard';
@@ -25,15 +25,15 @@ const routes: Routes = [
component: AdminOverviewComponent,
title: $localize`Admin Control`
},
+ {
+ path: 'settings',
+ component: AdminSettingsComponent,
+ title: $localize`Settings`
+ },
{
path: 'users',
component: AdminUsersComponent,
title: $localize`Users`
- },
- {
- path: 'platforms',
- component: AdminPlatformComponent,
- title: $localize`Platforms`
}
],
component: AdminPageComponent,
diff --git a/apps/client/src/app/pages/admin/admin-page.component.ts b/apps/client/src/app/pages/admin/admin-page.component.ts
index 912c49077..ccfafd806 100644
--- a/apps/client/src/app/pages/admin/admin-page.component.ts
+++ b/apps/client/src/app/pages/admin/admin-page.component.ts
@@ -30,18 +30,18 @@ export class AdminPageComponent implements OnDestroy, OnInit {
label: $localize`Overview`,
path: 'overview'
},
- { iconName: 'people-outline', label: $localize`Users`, path: 'users' },
{
- iconName: 'briefcase-outline',
- label: $localize`Platforms`,
- path: 'platforms'
+ iconName: 'settings-outline',
+ label: $localize`Settings`,
+ path: 'settings'
},
{
iconName: 'server-outline',
label: $localize`Market Data`,
path: 'market-data'
},
- { iconName: 'flash-outline', label: $localize`Jobs`, path: 'jobs' }
+ { iconName: 'flash-outline', label: $localize`Jobs`, path: 'jobs' },
+ { iconName: 'people-outline', label: $localize`Users`, path: 'users' }
];
}
diff --git a/apps/client/src/app/pages/admin/admin-page.module.ts b/apps/client/src/app/pages/admin/admin-page.module.ts
index 204a856df..a54b143d4 100644
--- a/apps/client/src/app/pages/admin/admin-page.module.ts
+++ b/apps/client/src/app/pages/admin/admin-page.module.ts
@@ -4,7 +4,7 @@ import { MatTabsModule } from '@angular/material/tabs';
import { GfAdminJobsModule } from '@ghostfolio/client/components/admin-jobs/admin-jobs.module';
import { GfAdminMarketDataModule } from '@ghostfolio/client/components/admin-market-data/admin-market-data.module';
import { GfAdminOverviewModule } from '@ghostfolio/client/components/admin-overview/admin-overview.module';
-import { GfAdminPlatformModule } from '@ghostfolio/client/components/admin-platform/admin-platform.module';
+import { GfAdminSettingsModule } from '@ghostfolio/client/components/admin-settings/admin-settings.module';
import { GfAdminUsersModule } from '@ghostfolio/client/components/admin-users/admin-users.module';
import { CacheService } from '@ghostfolio/client/services/cache.service';
@@ -20,7 +20,7 @@ import { AdminPageComponent } from './admin-page.component';
GfAdminJobsModule,
GfAdminMarketDataModule,
GfAdminOverviewModule,
- GfAdminPlatformModule,
+ GfAdminSettingsModule,
GfAdminUsersModule,
MatTabsModule
],
diff --git a/apps/client/src/app/pages/admin/admin-page.scss b/apps/client/src/app/pages/admin/admin-page.scss
index d5f736ee6..9e1e9b572 100644
--- a/apps/client/src/app/pages/admin/admin-page.scss
+++ b/apps/client/src/app/pages/admin/admin-page.scss
@@ -14,6 +14,7 @@
gf-admin-jobs,
gf-admin-market-data,
gf-admin-overview,
+ gf-admin-settings,
gf-admin-users {
flex: 1 1 auto;
overflow-y: auto;
diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf
index c1a1f0474..93ef90726 100644
--- a/apps/client/src/locales/messages.de.xlf
+++ b/apps/client/src/locales/messages.de.xlf
@@ -54,7 +54,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 136
+ 137
@@ -118,7 +118,7 @@
apps/client/src/app/components/admin-platform/admin-platform.component.html
- 19
+ 30
apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.html
@@ -134,7 +134,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 173
+ 174
libs/ui/src/lib/holdings-table/holdings-table.component.html
@@ -150,7 +150,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 131
+ 132
@@ -174,11 +174,11 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 315
+ 316
libs/ui/src/lib/activities-table/activities-table.component.html
- 350
+ 351
libs/ui/src/lib/holdings-table/holdings-table.component.html
@@ -194,11 +194,11 @@
apps/client/src/app/components/admin-platform/admin-platform.component.html
- 79
+ 90
libs/ui/src/lib/activities-table/activities-table.component.html
- 492
+ 493
@@ -214,11 +214,11 @@
apps/client/src/app/components/admin-platform/admin-platform.component.html
- 83
+ 94
libs/ui/src/lib/activities-table/activities-table.component.html
- 508
+ 509
@@ -362,7 +362,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 124
+ 125
@@ -714,7 +714,7 @@
Konten
apps/client/src/app/components/admin-platform/admin-platform.component.html
- 53
+ 64
apps/client/src/app/components/admin-users/admin-users.html
@@ -1406,7 +1406,7 @@
Bitte gebe deinen Gutscheincode ein:
apps/client/src/app/pages/account/account-page.component.ts
- 234
+ 236
@@ -1414,7 +1414,7 @@
Gutscheincode konnte nicht eingelöst werden
apps/client/src/app/pages/account/account-page.component.ts
- 244
+ 246
@@ -1422,7 +1422,7 @@
Gutscheincode wurde eingelöst
apps/client/src/app/pages/account/account-page.component.ts
- 256
+ 258
@@ -1430,7 +1430,7 @@
Neu laden
apps/client/src/app/pages/account/account-page.component.ts
- 257
+ 259
@@ -1438,7 +1438,7 @@
Möchtest du diese Anmeldemethode wirklich löschen?
apps/client/src/app/pages/account/account-page.component.ts
- 303
+ 305
@@ -1454,7 +1454,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 381
+ 382
@@ -1638,7 +1638,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 203
+ 204
@@ -1998,7 +1998,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 224
+ 225
@@ -2014,7 +2014,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 253
+ 254
@@ -2030,7 +2030,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 282
+ 283
@@ -2222,7 +2222,7 @@
Geplant
libs/ui/src/lib/activities-table/activities-table.component.html
- 183
+ 184
@@ -2234,7 +2234,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 446
+ 447
@@ -2246,7 +2246,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 465
+ 466
@@ -2258,7 +2258,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 475
+ 476
@@ -2266,7 +2266,7 @@
Kopieren
libs/ui/src/lib/activities-table/activities-table.component.html
- 496
+ 497
@@ -2274,7 +2274,7 @@
Geplante Aktivität als ICS exportieren
libs/ui/src/lib/activities-table/activities-table.component.html
- 504
+ 505
@@ -2282,7 +2282,7 @@
Möchtest du diese Aktivität wirklich löschen?
libs/ui/src/lib/activities-table/activities-table.component.ts
- 199
+ 201
@@ -2618,7 +2618,7 @@
Filtern nach Konto, Währung, Symbol oder Typ...
libs/ui/src/lib/activities-table/activities-table.component.ts
- 392
+ 394
@@ -3110,7 +3110,7 @@
apps/client/src/app/pages/admin/admin-page.component.ts
- 44
+ 43
@@ -3122,7 +3122,7 @@
apps/client/src/app/pages/admin/admin-page.component.ts
- 41
+ 40
@@ -3130,11 +3130,11 @@
Benutzer
apps/client/src/app/pages/admin/admin-page-routing.module.ts
- 31
+ 36
apps/client/src/app/pages/admin/admin-page.component.ts
- 33
+ 44
@@ -3182,7 +3182,7 @@
libs/ui/src/lib/activities-table/activities-table.component.html
- 455
+ 456
@@ -3718,7 +3718,7 @@
Url
apps/client/src/app/components/admin-platform/admin-platform.component.html
- 39
+ 50
apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.html
@@ -3729,20 +3729,16 @@
Do you really want to delete this platform?
Möchtest du diese Plattform wirklich löschen?
- apps/client/src/app/components/admin-platform/platform.component.ts
- 97
+ apps/client/src/app/components/admin-platform/admin-platform.component.ts
+ 76
-
+
Platforms
Plattformen
- apps/client/src/app/pages/admin/admin-page-routing.module.ts
- 36
-
-
- apps/client/src/app/pages/admin/admin-page.component.ts
- 36
+ apps/client/src/app/components/admin-settings/admin-settings.component.html
+ 4
@@ -3777,6 +3773,26 @@
48,51
+
+ Add Platform
+ Plattform hinzufügen
+
+ apps/client/src/app/components/admin-platform/admin-platform.component.html
+ 11,13
+
+
+
+ Settings
+ Einstellungen
+
+ apps/client/src/app/pages/admin/admin-page-routing.module.ts
+ 31
+
+
+ apps/client/src/app/pages/admin/admin-page.component.ts
+ 35
+
+