chore(ui): add missing content and age rating fields to bulk editor (#2851)
This commit is contained in:
+48
@@ -175,6 +175,54 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<!-- Age Rating -->
|
||||
<div class="field-group field-group--half">
|
||||
<label for="ageRating" class="field-label-row">
|
||||
<span>Age Rating</span>
|
||||
<div class="clear-checkbox">
|
||||
<p-checkbox [(ngModel)]="clearFields.ageRating" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('ageRating')" binary="true" inputId="clearAgeRating"/>
|
||||
<label for="clearAgeRating" class="clear-label">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-select
|
||||
class="full-width"
|
||||
inputId="ageRating"
|
||||
formControlName="ageRating"
|
||||
[options]="ageRatingOptions"
|
||||
optionLabel="label"
|
||||
optionValue="value"
|
||||
placeholder="Leave unchanged"
|
||||
[showClear]="true"
|
||||
[disabled]="clearFields.ageRating"
|
||||
appendTo="body"/>
|
||||
</div>
|
||||
|
||||
<!-- Content Rating -->
|
||||
<div class="field-group field-group--half">
|
||||
<label for="contentRating" class="field-label-row">
|
||||
<span>Content Rating</span>
|
||||
<div class="clear-checkbox">
|
||||
<p-checkbox [(ngModel)]="clearFields.contentRating" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('contentRating')" binary="true" inputId="clearContentRating"/>
|
||||
<label for="clearContentRating" class="clear-label">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-select
|
||||
class="full-width"
|
||||
inputId="contentRating"
|
||||
formControlName="contentRating"
|
||||
[options]="contentRatingOptions"
|
||||
optionLabel="label"
|
||||
optionValue="value"
|
||||
placeholder="Leave unchanged"
|
||||
[showClear]="true"
|
||||
[disabled]="clearFields.contentRating"
|
||||
appendTo="body"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Genres -->
|
||||
<div class="field-group">
|
||||
<label for="genres" class="field-label-row">
|
||||
|
||||
+5
@@ -77,6 +77,11 @@
|
||||
flex-basis: 20%;
|
||||
}
|
||||
}
|
||||
|
||||
&--half {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.field-label-row {
|
||||
|
||||
+20
-3
@@ -10,10 +10,12 @@ import {MessageService} from '@openng/optimus-ui/api';
|
||||
import {BookService} from '../../../book/service/book.service';
|
||||
import {BookMetadataManageService} from '../../../book/service/book-metadata-manage.service';
|
||||
import {BulkMetadataUpdateRequest} from '../../../book/model/book.model';
|
||||
import {AGE_RATING_OPTIONS, CONTENT_RATING_LABELS} from '../../../book/model/book-value-labels';
|
||||
import {Checkbox} from '@openng/optimus-ui/checkbox';
|
||||
import {AutoComplete} from '@openng/optimus-ui/autocomplete';
|
||||
import {AutoCompleteSelectEvent} from '@openng/optimus-ui/autocomplete';
|
||||
import {ProgressSpinner} from '@openng/optimus-ui/progressspinner';
|
||||
import {Select} from '@openng/optimus-ui/select';
|
||||
|
||||
@Component({
|
||||
selector: 'app-bulk-metadata-update-component',
|
||||
@@ -27,8 +29,9 @@ import {ProgressSpinner} from '@openng/optimus-ui/progressspinner';
|
||||
DatePicker,
|
||||
Checkbox,
|
||||
ProgressSpinner,
|
||||
AutoComplete
|
||||
],
|
||||
AutoComplete,
|
||||
Select,
|
||||
],
|
||||
providers: [MessageService],
|
||||
templateUrl: './bulk-metadata-update-component.html',
|
||||
styleUrl: './bulk-metadata-update-component.scss'
|
||||
@@ -52,8 +55,14 @@ export class BulkMetadataUpdateComponent implements OnInit {
|
||||
genres: false,
|
||||
moods: false,
|
||||
tags: false,
|
||||
ageRating: false,
|
||||
contentRating: false,
|
||||
};
|
||||
|
||||
readonly ageRatingOptions = AGE_RATING_OPTIONS.map(({id, label}) => ({label, value: id}));
|
||||
readonly contentRatingOptions = Object.entries(CONTENT_RATING_LABELS)
|
||||
.map(([value, label]) => ({label, value}));
|
||||
|
||||
private readonly config = inject(DynamicDialogConfig);
|
||||
readonly ref = inject(DynamicDialogRef);
|
||||
private readonly fb = inject(FormBuilder);
|
||||
@@ -129,7 +138,9 @@ export class BulkMetadataUpdateComponent implements OnInit {
|
||||
publishedDate: [null],
|
||||
genres: [],
|
||||
moods: [],
|
||||
tags: []
|
||||
tags: [],
|
||||
ageRating: [null],
|
||||
contentRating: [null]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -214,6 +225,12 @@ export class BulkMetadataUpdateComponent implements OnInit {
|
||||
tags: this.clearFields.tags ? [] : (formValue.tags?.length ? formValue.tags : undefined),
|
||||
clearTags: this.clearFields.tags,
|
||||
|
||||
ageRating: this.clearFields.ageRating ? null : (formValue.ageRating ?? undefined),
|
||||
clearAgeRating: this.clearFields.ageRating,
|
||||
|
||||
contentRating: this.clearFields.contentRating ? null : (formValue.contentRating ?? undefined),
|
||||
clearContentRating: this.clearFields.contentRating,
|
||||
|
||||
mergeCategories: this.mergeCategories,
|
||||
mergeMoods: this.mergeMoods,
|
||||
mergeTags: this.mergeTags
|
||||
|
||||
Reference in New Issue
Block a user