Fixed: Validate metadata and quality profiles for root folders

Don't allow `0` as possible value for metadata and quality profiles, and permit to edit root folders with bad values in UI.
This commit is contained in:
Bogdan
2024-06-30 05:35:37 +03:00
parent b5334da253
commit af1f389f8e
9 changed files with 29 additions and 26 deletions

View File

@@ -8,6 +8,7 @@ import TagListConnector from 'Components/TagListConnector';
import { createMetadataProfileSelectorForHook } from 'Store/Selectors/createMetadataProfileSelector';
import { createQualityProfileSelectorForHook } from 'Store/Selectors/createQualityProfileSelector';
import { SelectStateInputProps } from 'typings/props';
import translate from 'Utilities/String/translate';
import styles from './ManageImportListsModalRow.css';
interface ManageImportListsModalRowProps {
@@ -70,7 +71,7 @@ function ManageImportListsModalRow(props: ManageImportListsModalRowProps) {
</TableRowCell>
<TableRowCell className={styles.qualityProfileId}>
{qualityProfile?.name ?? 'None'}
{qualityProfile?.name ?? translate('None')}
</TableRowCell>
<TableRowCell className={styles.metadataProfileId}>
@@ -82,7 +83,7 @@ function ManageImportListsModalRow(props: ManageImportListsModalRowProps) {
</TableRowCell>
<TableRowCell className={styles.enableAutomaticAdd}>
{enableAutomaticAdd ? 'Yes' : 'No'}
{enableAutomaticAdd ? translate('Yes') : translate('No')}
</TableRowCell>
<TableRowCell className={styles.tags}>

View File

@@ -75,12 +75,12 @@ class RootFolder extends Component {
{path}
</Label>
<Label kind={kinds.SUCCESS}>
{qualityProfile.name}
<Label kind={qualityProfile?.name ? kinds.SUCCESS : kinds.DANGER}>
{qualityProfile?.name || translate('None')}
</Label>
<Label kind={kinds.SUCCESS}>
{metadataProfile.name}
<Label kind={metadataProfile?.name ? kinds.SUCCESS : kinds.DANGER}>
{metadataProfile?.name || translate('None')}
</Label>
</div>