New: Application Status Warnings

This commit is contained in:
Qstick
2021-02-10 21:44:14 -05:00
parent 96cf058017
commit ed0e11847a
33 changed files with 382 additions and 353 deletions

View File

@@ -61,9 +61,7 @@ class MovieIndexRow extends Component {
const {
id,
name,
enableRss,
enableAutomaticSearch,
enableInteractiveSearch,
enable,
tags,
protocol,
privacy,
@@ -114,7 +112,7 @@ class MovieIndexRow extends Component {
<IndexerStatusCell
key={column.name}
className={styles[column.name]}
enabled={enableRss || enableAutomaticSearch || enableInteractiveSearch}
enabled={enable}
status={status}
longDateFormat={longDateFormat}
timeFormat={timeFormat}
@@ -255,9 +253,7 @@ MovieIndexRow.propTypes = {
privacy: PropTypes.string.isRequired,
priority: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
enableRss: PropTypes.bool.isRequired,
enableAutomaticSearch: PropTypes.bool.isRequired,
enableInteractiveSearch: PropTypes.bool.isRequired,
enable: PropTypes.bool.isRequired,
status: PropTypes.object,
capabilities: PropTypes.object.isRequired,
added: PropTypes.string.isRequired,

View File

@@ -38,11 +38,8 @@ function EditIndexerModalContent(props) {
id,
implementationName,
name,
enableRss,
enableAutomaticSearch,
enableInteractiveSearch,
enable,
supportsRss,
supportsSearch,
fields,
priority
} = item;
@@ -81,42 +78,14 @@ function EditIndexerModalContent(props) {
</FormGroup>
<FormGroup>
<FormLabel>{translate('EnableRSS')}</FormLabel>
<FormLabel>{translate('Enable')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="enableRss"
name="enable"
helpTextWarning={supportsRss.value ? undefined : translate('RSSIsNotSupportedWithThisIndexer')}
isDisabled={!supportsRss.value}
{...enableRss}
onChange={onInputChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>{translate('EnableAutomaticSearch')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="enableAutomaticSearch"
helpText={supportsSearch.value ? translate('EnableAutomaticSearchHelpText') : undefined}
helpTextWarning={supportsSearch.value ? undefined : translate('EnableAutomaticSearchHelpTextWarning')}
isDisabled={!supportsSearch.value}
{...enableAutomaticSearch}
onChange={onInputChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>{translate('EnableInteractiveSearch')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="enableInteractiveSearch"
helpText={supportsSearch.value ? translate('EnableInteractiveSearchHelpText') : undefined}
helpTextWarning={supportsSearch.value ? undefined : translate('EnableInteractiveSearchHelpTextWarning')}
isDisabled={!supportsSearch.value}
{...enableInteractiveSearch}
{...enable}
onChange={onInputChange}
/>
</FormGroup>

View File

@@ -65,11 +65,8 @@ class Indexer extends Component {
const {
id,
name,
enableRss,
enableAutomaticSearch,
enableInteractiveSearch,
enable,
supportsRss,
supportsSearch,
priority,
showPriority
} = this.props;
@@ -96,26 +93,12 @@ class Indexer extends Component {
<div className={styles.enabled}>
{
supportsRss && enableRss &&
supportsRss && enable &&
<Label kind={kinds.SUCCESS}>
RSS
</Label>
}
{
supportsSearch && enableAutomaticSearch &&
<Label kind={kinds.SUCCESS}>
{translate('AutomaticSearch')}
</Label>
}
{
supportsSearch && enableInteractiveSearch &&
<Label kind={kinds.SUCCESS}>
{translate('InteractiveSearch')}
</Label>
}
{
showPriority &&
<Label kind={kinds.DEFAULT}>
@@ -123,7 +106,7 @@ class Indexer extends Component {
</Label>
}
{
!enableRss && !enableAutomaticSearch && !enableInteractiveSearch &&
!enable &&
<Label
kind={kinds.DISABLED}
outline={true}
@@ -157,9 +140,7 @@ class Indexer extends Component {
Indexer.propTypes = {
id: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
enableRss: PropTypes.bool.isRequired,
enableAutomaticSearch: PropTypes.bool.isRequired,
enableInteractiveSearch: PropTypes.bool.isRequired,
enable: PropTypes.bool.isRequired,
supportsRss: PropTypes.bool.isRequired,
supportsSearch: PropTypes.bool.isRequired,
onCloneIndexerPress: PropTypes.func.isRequired,

View File

@@ -142,9 +142,7 @@ export const reducers = createHandleActions({
[SELECT_INDEXER_SCHEMA]: (state, { payload }) => {
return selectSchema(state, payload, (selectedSchema) => {
selectedSchema.enableRss = selectedSchema.supportsRss;
selectedSchema.enableAutomaticSearch = selectedSchema.supportsSearch;
selectedSchema.enableInteractiveSearch = selectedSchema.supportsSearch;
selectedSchema.enable = selectedSchema.supportsRss;
return selectedSchema;
});