From 16f1b16e41702ce793586afe5ddf1e9627c394b2 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 28 Oct 2023 20:46:44 +0200 Subject: [PATCH] Feature/change checkboxes to slide toggles in admin control panel (#2551) * Change checkboxes to slide toggles * Update changelog --- CHANGELOG.md | 1 + .../admin-overview/admin-overview.component.ts | 14 +++++++------- .../components/admin-overview/admin-overview.html | 10 ++++++---- .../admin-overview/admin-overview.module.ts | 4 ++-- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c8bbf690..3f21cec7a 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 usability and validation in the cash balance transfer from one to another account +- Changed the checkboxes to slide toggles in the overview of the admin control panel - Improved the localized meta data (keywords) in `html` files - Improved the language localization for German (`de`) diff --git a/apps/client/src/app/components/admin-overview/admin-overview.component.ts b/apps/client/src/app/components/admin-overview/admin-overview.component.ts index 97573cdbe..6c4c72f70 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.component.ts +++ b/apps/client/src/app/components/admin-overview/admin-overview.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; -import { MatCheckboxChange } from '@angular/material/checkbox'; +import { MatSlideToggleChange } from '@angular/material/slide-toggle'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { CacheService } from '@ghostfolio/client/services/cache.service'; import { DataService } from '@ghostfolio/client/services/data.service'; @@ -169,17 +169,17 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { } } - public onReadOnlyModeChange(aEvent: MatCheckboxChange) { + public onEnableUserSignupModeChange(aEvent: MatSlideToggleChange) { this.putAdminSetting({ - key: PROPERTY_IS_READ_ONLY_MODE, - value: aEvent.checked ? true : undefined + key: PROPERTY_IS_USER_SIGNUP_ENABLED, + value: aEvent.checked ? undefined : false }); } - public onEnableUserSignupModeChange(aEvent: MatCheckboxChange) { + public onReadOnlyModeChange(aEvent: MatSlideToggleChange) { this.putAdminSetting({ - key: PROPERTY_IS_USER_SIGNUP_ENABLED, - value: aEvent.checked ? undefined : false + key: PROPERTY_IS_READ_ONLY_MODE, + value: aEvent.checked ? true : undefined }); } diff --git a/apps/client/src/app/components/admin-overview/admin-overview.html b/apps/client/src/app/components/admin-overview/admin-overview.html index 47f27dd40..40ae7a150 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.html +++ b/apps/client/src/app/components/admin-overview/admin-overview.html @@ -81,21 +81,23 @@