Fixed manage collections not being toggleable (#1813)

This commit is contained in:
Joe Milazzo 2023-02-19 14:12:12 -06:00 committed by GitHub
parent 0f042a23eb
commit 8aee5b3e08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 8 deletions

View File

@ -334,7 +334,7 @@ public class LibraryController : BaseApiController
library.IncludeInDashboard = dto.IncludeInDashboard; library.IncludeInDashboard = dto.IncludeInDashboard;
library.IncludeInRecommended = dto.IncludeInRecommended; library.IncludeInRecommended = dto.IncludeInRecommended;
library.IncludeInSearch = dto.IncludeInSearch; library.IncludeInSearch = dto.IncludeInSearch;
library.ManageCollections = dto.CreateCollections; library.ManageCollections = dto.ManageCollections;
_unitOfWork.LibraryRepository.Update(library); _unitOfWork.LibraryRepository.Update(library);

View File

@ -23,6 +23,6 @@ public class UpdateLibraryDto
[Required] [Required]
public bool IncludeInSearch { get; init; } public bool IncludeInSearch { get; init; }
[Required] [Required]
public bool CreateCollections { get; init; } public bool ManageCollections { get; init; }
} }

View File

@ -15,5 +15,5 @@ export interface Library {
includeInDashboard: boolean; includeInDashboard: boolean;
includeInRecommended: boolean; includeInRecommended: boolean;
includeInSearch: boolean; includeInSearch: boolean;
createCollections: boolean; manageCollections: boolean;
} }

View File

@ -96,7 +96,7 @@
<div class="col-md-12 col-sm-12 pe-2 mb-2"> <div class="col-md-12 col-sm-12 pe-2 mb-2">
<div class="mb-3 mt-1"> <div class="mb-3 mt-1">
<div class="form-check form-switch"> <div class="form-check form-switch">
<input type="checkbox" id="manage-collections" role="switch" formControlName="createCollections" class="form-check-input" aria-labelledby="auto-close-label"> <input type="checkbox" id="manage-collections" role="switch" formControlName="manageCollections" class="form-check-input" aria-labelledby="auto-close-label">
<label class="form-check-label" for="manage-collections">Manage Collections</label> <label class="form-check-label" for="manage-collections">Manage Collections</label>
</div> </div>
</div> </div>

View File

@ -46,7 +46,7 @@ export class LibrarySettingsModalComponent implements OnInit, OnDestroy {
includeInDashboard: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }), includeInDashboard: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }),
includeInRecommended: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }), includeInRecommended: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }),
includeInSearch: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }), includeInSearch: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }),
createCollections: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }), manageCollections: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }),
}); });
selectedFolders: string[] = []; selectedFolders: string[] = [];
@ -118,7 +118,7 @@ export class LibrarySettingsModalComponent implements OnInit, OnDestroy {
this.libraryForm.get('includeInDashboard')?.setValue(this.library.includeInDashboard); this.libraryForm.get('includeInDashboard')?.setValue(this.library.includeInDashboard);
this.libraryForm.get('includeInRecommended')?.setValue(this.library.includeInRecommended); this.libraryForm.get('includeInRecommended')?.setValue(this.library.includeInRecommended);
this.libraryForm.get('includeInSearch')?.setValue(this.library.includeInSearch); this.libraryForm.get('includeInSearch')?.setValue(this.library.includeInSearch);
this.libraryForm.get('createCollections')?.setValue(this.library.createCollections); this.libraryForm.get('manageCollections')?.setValue(this.library.manageCollections);
this.selectedFolders = this.library.folders; this.selectedFolders = this.library.folders;
this.madeChanges = false; this.madeChanges = false;
this.cdRef.markForCheck(); this.cdRef.markForCheck();

View File

@ -14070,13 +14070,13 @@
}, },
"UpdateLibraryDto": { "UpdateLibraryDto": {
"required": [ "required": [
"createCollections",
"folders", "folders",
"folderWatching", "folderWatching",
"id", "id",
"includeInDashboard", "includeInDashboard",
"includeInRecommended", "includeInRecommended",
"includeInSearch", "includeInSearch",
"manageCollections",
"name", "name",
"type" "type"
], ],
@ -14111,7 +14111,7 @@
"includeInSearch": { "includeInSearch": {
"type": "boolean" "type": "boolean"
}, },
"createCollections": { "manageCollections": {
"type": "boolean" "type": "boolean"
} }
}, },