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>
|
</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 -->
|
<!-- Genres -->
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label for="genres" class="field-label-row">
|
<label for="genres" class="field-label-row">
|
||||||
|
|||||||
+5
@@ -77,6 +77,11 @@
|
|||||||
flex-basis: 20%;
|
flex-basis: 20%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--half {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.field-label-row {
|
.field-label-row {
|
||||||
|
|||||||
+20
-3
@@ -10,10 +10,12 @@ import {MessageService} from '@openng/optimus-ui/api';
|
|||||||
import {BookService} from '../../../book/service/book.service';
|
import {BookService} from '../../../book/service/book.service';
|
||||||
import {BookMetadataManageService} from '../../../book/service/book-metadata-manage.service';
|
import {BookMetadataManageService} from '../../../book/service/book-metadata-manage.service';
|
||||||
import {BulkMetadataUpdateRequest} from '../../../book/model/book.model';
|
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 {Checkbox} from '@openng/optimus-ui/checkbox';
|
||||||
import {AutoComplete} from '@openng/optimus-ui/autocomplete';
|
import {AutoComplete} from '@openng/optimus-ui/autocomplete';
|
||||||
import {AutoCompleteSelectEvent} from '@openng/optimus-ui/autocomplete';
|
import {AutoCompleteSelectEvent} from '@openng/optimus-ui/autocomplete';
|
||||||
import {ProgressSpinner} from '@openng/optimus-ui/progressspinner';
|
import {ProgressSpinner} from '@openng/optimus-ui/progressspinner';
|
||||||
|
import {Select} from '@openng/optimus-ui/select';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bulk-metadata-update-component',
|
selector: 'app-bulk-metadata-update-component',
|
||||||
@@ -27,8 +29,9 @@ import {ProgressSpinner} from '@openng/optimus-ui/progressspinner';
|
|||||||
DatePicker,
|
DatePicker,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
ProgressSpinner,
|
ProgressSpinner,
|
||||||
AutoComplete
|
AutoComplete,
|
||||||
],
|
Select,
|
||||||
|
],
|
||||||
providers: [MessageService],
|
providers: [MessageService],
|
||||||
templateUrl: './bulk-metadata-update-component.html',
|
templateUrl: './bulk-metadata-update-component.html',
|
||||||
styleUrl: './bulk-metadata-update-component.scss'
|
styleUrl: './bulk-metadata-update-component.scss'
|
||||||
@@ -52,8 +55,14 @@ export class BulkMetadataUpdateComponent implements OnInit {
|
|||||||
genres: false,
|
genres: false,
|
||||||
moods: false,
|
moods: false,
|
||||||
tags: 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);
|
private readonly config = inject(DynamicDialogConfig);
|
||||||
readonly ref = inject(DynamicDialogRef);
|
readonly ref = inject(DynamicDialogRef);
|
||||||
private readonly fb = inject(FormBuilder);
|
private readonly fb = inject(FormBuilder);
|
||||||
@@ -129,7 +138,9 @@ export class BulkMetadataUpdateComponent implements OnInit {
|
|||||||
publishedDate: [null],
|
publishedDate: [null],
|
||||||
genres: [],
|
genres: [],
|
||||||
moods: [],
|
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),
|
tags: this.clearFields.tags ? [] : (formValue.tags?.length ? formValue.tags : undefined),
|
||||||
clearTags: this.clearFields.tags,
|
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,
|
mergeCategories: this.mergeCategories,
|
||||||
mergeMoods: this.mergeMoods,
|
mergeMoods: this.mergeMoods,
|
||||||
mergeTags: this.mergeTags
|
mergeTags: this.mergeTags
|
||||||
|
|||||||
Reference in New Issue
Block a user