Fixed: Disabled select option still selectable

(cherry picked from commit 063dba22a803295adee4fdcbe42718af3e85ca78)
pull/2067/head
Mark McDowall 9 months ago committed by Bogdan
parent 218371a318
commit e981cacbda

@ -24,16 +24,20 @@ function createMapStateToProps() {
if (includeNoChange) { if (includeNoChange) {
values.unshift({ values.unshift({
key: 'noChange', key: 'noChange',
value: translate('NoChange'), get value() {
disabled: true return translate('NoChange');
},
isDisabled: true
}); });
} }
if (includeMixed) { if (includeMixed) {
values.unshift({ values.unshift({
key: 'mixed', key: 'mixed',
value: '(Mixed)', get value() {
disabled: true return `(${translate('Mixed')})`;
},
isDisabled: true
}); });
} }

@ -1,54 +0,0 @@
import PropTypes from 'prop-types';
import React from 'react';
import SelectInput from './SelectInput';
const availabilityOptions = [
{ key: 'announced', value: 'Announced' },
{ key: 'inCinemas', value: 'In Cinemas' },
{ key: 'released', value: 'Released' },
{ key: 'preDB', value: 'PreDB' }
];
function AvailabilitySelectInput(props) {
const values = [...availabilityOptions];
const {
includeNoChange,
includeMixed
} = props;
if (includeNoChange) {
values.unshift({
key: 'noChange',
value: 'No Change',
disabled: true
});
}
if (includeMixed) {
values.unshift({
key: 'mixed',
value: '(Mixed)',
disabled: true
});
}
return (
<SelectInput
{...props}
values={values}
/>
);
}
AvailabilitySelectInput.propTypes = {
includeNoChange: PropTypes.bool.isRequired,
includeMixed: PropTypes.bool.isRequired
};
AvailabilitySelectInput.defaultProps = {
includeNoChange: false,
includeMixed: false
};
export default AvailabilitySelectInput;

@ -5,7 +5,6 @@ import { inputTypes, kinds } from 'Helpers/Props';
import translate from 'Utilities/String/translate'; import translate from 'Utilities/String/translate';
import AppProfileSelectInputConnector from './AppProfileSelectInputConnector'; import AppProfileSelectInputConnector from './AppProfileSelectInputConnector';
import AutoCompleteInput from './AutoCompleteInput'; import AutoCompleteInput from './AutoCompleteInput';
import AvailabilitySelectInput from './AvailabilitySelectInput';
import CaptchaInputConnector from './CaptchaInputConnector'; import CaptchaInputConnector from './CaptchaInputConnector';
import CardigannCaptchaInputConnector from './CardigannCaptchaInputConnector'; import CardigannCaptchaInputConnector from './CardigannCaptchaInputConnector';
import CheckInput from './CheckInput'; import CheckInput from './CheckInput';
@ -37,9 +36,6 @@ function getComponent(type) {
case inputTypes.AUTO_COMPLETE: case inputTypes.AUTO_COMPLETE:
return AutoCompleteInput; return AutoCompleteInput;
case inputTypes.AVAILABILITY_SELECT:
return AvailabilitySelectInput;
case inputTypes.CAPTCHA: case inputTypes.CAPTCHA:
return CaptchaInputConnector; return CaptchaInputConnector;

@ -1,6 +1,5 @@
export const AUTO_COMPLETE = 'autoComplete'; export const AUTO_COMPLETE = 'autoComplete';
export const APP_PROFILE_SELECT = 'appProfileSelect'; export const APP_PROFILE_SELECT = 'appProfileSelect';
export const AVAILABILITY_SELECT = 'availabilitySelect';
export const CAPTCHA = 'captcha'; export const CAPTCHA = 'captcha';
export const CARDIGANNCAPTCHA = 'cardigannCaptcha'; export const CARDIGANNCAPTCHA = 'cardigannCaptcha';
export const CHECK = 'check'; export const CHECK = 'check';
@ -27,7 +26,6 @@ export const TAG_SELECT = 'tagSelect';
export const all = [ export const all = [
AUTO_COMPLETE, AUTO_COMPLETE,
APP_PROFILE_SELECT, APP_PROFILE_SELECT,
AVAILABILITY_SELECT,
CAPTCHA, CAPTCHA,
CARDIGANNCAPTCHA, CARDIGANNCAPTCHA,
CHECK, CHECK,

@ -36,7 +36,7 @@ const enableOptions = [
get value() { get value() {
return translate('NoChange'); return translate('NoChange');
}, },
disabled: true, isDisabled: true,
}, },
{ {
key: 'true', key: 'true',

@ -30,7 +30,7 @@ const syncLevelOptions = [
get value() { get value() {
return translate('NoChange'); return translate('NoChange');
}, },
disabled: true, isDisabled: true,
}, },
{ {
key: ApplicationSyncLevel.Disabled, key: ApplicationSyncLevel.Disabled,

@ -30,7 +30,7 @@ const enableOptions = [
get value() { get value() {
return translate('NoChange'); return translate('NoChange');
}, },
disabled: true, isDisabled: true,
}, },
{ {
key: 'enabled', key: 'enabled',

@ -452,6 +452,7 @@
"Message": "Message", "Message": "Message",
"MinimumSeeders": "Minimum Seeders", "MinimumSeeders": "Minimum Seeders",
"MinimumSeedersHelpText": "Minimum seeders required by the Application for the indexer to grab", "MinimumSeedersHelpText": "Minimum seeders required by the Application for the indexer to grab",
"Mixed": "Mixed",
"Mode": "Mode", "Mode": "Mode",
"More": "More", "More": "More",
"MoreInfo": "More Info", "MoreInfo": "More Info",

Loading…
Cancel
Save