Skip to content

Commit

Permalink
Fixed manage collections not being toggleable (#1813)
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 authored Feb 19, 2023
1 parent 0f042a2 commit 8aee5b3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion API/Controllers/LibraryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public async Task<ActionResult> UpdateLibrary(UpdateLibraryDto dto)
library.IncludeInDashboard = dto.IncludeInDashboard;
library.IncludeInRecommended = dto.IncludeInRecommended;
library.IncludeInSearch = dto.IncludeInSearch;
library.ManageCollections = dto.CreateCollections;
library.ManageCollections = dto.ManageCollections;

_unitOfWork.LibraryRepository.Update(library);

Expand Down
2 changes: 1 addition & 1 deletion API/DTOs/UpdateLibraryDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public class UpdateLibraryDto
[Required]
public bool IncludeInSearch { get; init; }
[Required]
public bool CreateCollections { get; init; }
public bool ManageCollections { get; init; }

}
2 changes: 1 addition & 1 deletion UI/Web/src/app/_models/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export interface Library {
includeInDashboard: boolean;
includeInRecommended: boolean;
includeInSearch: boolean;
createCollections: boolean;
manageCollections: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h4 class="modal-title" id="modal-basic-title">
<div class="col-md-12 col-sm-12 pe-2 mb-2">
<div class="mb-3 mt-1">
<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>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class LibrarySettingsModalComponent implements OnInit, OnDestroy {
includeInDashboard: 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] }),
createCollections: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }),
manageCollections: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }),
});

selectedFolders: string[] = [];
Expand Down Expand Up @@ -118,7 +118,7 @@ export class LibrarySettingsModalComponent implements OnInit, OnDestroy {
this.libraryForm.get('includeInDashboard')?.setValue(this.library.includeInDashboard);
this.libraryForm.get('includeInRecommended')?.setValue(this.library.includeInRecommended);
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.madeChanges = false;
this.cdRef.markForCheck();
Expand Down
4 changes: 2 additions & 2 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -14070,13 +14070,13 @@
},
"UpdateLibraryDto": {
"required": [
"createCollections",
"folders",
"folderWatching",
"id",
"includeInDashboard",
"includeInRecommended",
"includeInSearch",
"manageCollections",
"name",
"type"
],
Expand Down Expand Up @@ -14111,7 +14111,7 @@
"includeInSearch": {
"type": "boolean"
},
"createCollections": {
"manageCollections": {
"type": "boolean"
}
},
Expand Down

0 comments on commit 8aee5b3

Please sign in to comment.