[Feature] Add fields director and (studio) code to scenes (#3051)

* added schema migration and updated data models
* added code and director to UI
* new fields are exported and imported
* added filters
* Add changelog entry
This commit is contained in:
HappyAxolotl
2022-11-07 08:16:52 +01:00
committed by GitHub
parent 7540d3b477
commit eff86bf2f8
35 changed files with 411 additions and 248 deletions

View File

@@ -105,7 +105,9 @@ export const SceneEditPanel: React.FC<IProps> = ({
const schema = yup.object({
title: yup.string().optional().nullable(),
code: yup.string().optional().nullable(),
details: yup.string().optional().nullable(),
director: yup.string().optional().nullable(),
url: yup.string().optional().nullable(),
date: yup.string().optional().nullable(),
rating: yup.number().optional().nullable(),
@@ -127,7 +129,9 @@ export const SceneEditPanel: React.FC<IProps> = ({
const initialValues = useMemo(
() => ({
title: scene.title ?? "",
code: scene.code ?? "",
details: scene.details ?? "",
director: scene.director ?? "",
url: scene.url ?? "",
date: scene.date ?? "",
rating: scene.rating ?? null,
@@ -337,7 +341,9 @@ export const SceneEditPanel: React.FC<IProps> = ({
try {
const input: GQL.ScrapedSceneInput = {
date: fragment.date,
code: fragment.code,
details: fragment.details,
director: fragment.director,
remote_site_id: fragment.remote_site_id,
title: fragment.title,
url: fragment.url,
@@ -536,10 +542,18 @@ export const SceneEditPanel: React.FC<IProps> = ({
formik.setFieldValue("title", updatedScene.title);
}
if (updatedScene.code) {
formik.setFieldValue("code", updatedScene.code);
}
if (updatedScene.details) {
formik.setFieldValue("details", updatedScene.details);
}
if (updatedScene.director) {
formik.setFieldValue("director", updatedScene.director);
}
if (updatedScene.date) {
formik.setFieldValue("date", updatedScene.date);
}
@@ -696,6 +710,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
<div className="form-container row px-3">
<div className="col-12 col-lg-7 col-xl-12">
{renderTextField("title", intl.formatMessage({ id: "title" }))}
{renderTextField("code", intl.formatMessage({ id: "scene_code" }))}
<Form.Group controlId="url" as={Row}>
<Col xs={3} className="pr-0 url-label">
<Form.Label className="col-form-label">
@@ -716,6 +731,10 @@ export const SceneEditPanel: React.FC<IProps> = ({
intl.formatMessage({ id: "date" }),
"YYYY-MM-DD"
)}
{renderTextField(
"director",
intl.formatMessage({ id: "director" })
)}
<Form.Group controlId="rating" as={Row}>
{FormUtils.renderLabel({
title: intl.formatMessage({ id: "rating" }),