1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-11 20:12:41 +02:00

New: Enforce Indent after Logical for UI

This commit is contained in:
Qstick 2019-12-06 21:38:58 -05:00
parent 6235225f7d
commit 7f0581018b
17 changed files with 290 additions and 290 deletions

View File

@ -268,7 +268,7 @@
"react/jsx-curly-spacing": [2, "never"], "react/jsx-curly-spacing": [2, "never"],
"react/jsx-equals-spacing": [2, "never"], "react/jsx-equals-spacing": [2, "never"],
"react/jsx-indent-props": [2, 2], "react/jsx-indent-props": [2, 2],
"react/jsx-indent": [2, 2], "react/jsx-indent": [2, 2, { "indentLogicalExpressions": true }],
"react/jsx-key": 2, "react/jsx-key": 2,
"react/jsx-no-bind": [2, { "allowArrowFunctions": true }], "react/jsx-no-bind": [2, { "allowArrowFunctions": true }],
"react/jsx-no-duplicate-props": [2, { "ignoreCase": true }], "react/jsx-no-duplicate-props": [2, { "ignoreCase": true }],

View File

@ -88,27 +88,27 @@ class AddNewMovieSearchResult extends Component {
{ {
!title.contains(year) && !!year && !title.contains(year) && !!year &&
<span className={styles.year}>({year})</span> <span className={styles.year}>({year})</span>
} }
{ {
isExistingMovie && isExistingMovie &&
<Icon <Icon
className={styles.alreadyExistsIcon} className={styles.alreadyExistsIcon}
name={icons.CHECK_CIRCLE} name={icons.CHECK_CIRCLE}
size={36} size={36}
title="Already in your library" title="Already in your library"
/> />
} }
{ {
isExclusionMovie && isExclusionMovie &&
<Icon <Icon
className={styles.exclusionIcon} className={styles.exclusionIcon}
name={icons.DANGER} name={icons.DANGER}
size={36} size={36}
title="Movie is on Net Import Exclusion List" title="Movie is on Net Import Exclusion List"
/> />
} }
</div> </div>
@ -122,19 +122,19 @@ class AddNewMovieSearchResult extends Component {
{ {
!!studio && !!studio &&
<Label size={sizes.LARGE}> <Label size={sizes.LARGE}>
{studio} {studio}
</Label> </Label>
} }
{ {
status === 'ended' && status === 'ended' &&
<Label <Label
kind={kinds.DANGER} kind={kinds.DANGER}
size={sizes.LARGE} size={sizes.LARGE}
> >
Ended Ended
</Label> </Label>
} }
</div> </div>

View File

@ -53,19 +53,19 @@ function AppRoutes(props) {
{ {
window.Radarr.urlBase && window.Radarr.urlBase &&
<Route <Route
exact={true} exact={true}
path="/" path="/"
addUrlBase={false} addUrlBase={false}
render={() => { render={() => {
return ( return (
<Redirect <Redirect
to={getPathWithUrlBase('/')} to={getPathWithUrlBase('/')}
component={app} component={app}
/> />
); );
}} }}
/> />
} }
<Route <Route

View File

@ -134,9 +134,9 @@ class CalendarPage extends Component {
> >
{ {
movieError && movieError &&
<div className={styles.errorMessage}> <div className={styles.errorMessage}>
{getErrorMessage(movieError, 'Failed to load movie from API')} {getErrorMessage(movieError, 'Failed to load movie from API')}
</div> </div>
} }
{ {

View File

@ -78,21 +78,21 @@ class MovieHistoryTableContent extends Component {
{ {
isPopulated && hasItems && !error && isPopulated && hasItems && !error &&
<Table columns={columns}> <Table columns={columns}>
<TableBody> <TableBody>
{ {
items.reverse().map((item) => { items.reverse().map((item) => {
return ( return (
<MovieHistoryRowConnector <MovieHistoryRowConnector
key={item.id} key={item.id}
{...item} {...item}
onMarkAsFailedPress={onMarkAsFailedPress} onMarkAsFailedPress={onMarkAsFailedPress}
/> />
); );
}) })
} }
</TableBody> </TableBody>
</Table> </Table>
} }
</div> </div>
); );

View File

@ -51,20 +51,20 @@ class MovieTitlesTableContent extends Component {
{ {
isPopulated && hasItems && !error && isPopulated && hasItems && !error &&
<Table columns={columns}> <Table columns={columns}>
<TableBody> <TableBody>
{ {
items.reverse().map((item) => { items.reverse().map((item) => {
return ( return (
<MovieTitlesRow <MovieTitlesRow
key={item.id} key={item.id}
{...item} {...item}
/> />
); );
}) })
} }
</TableBody> </TableBody>
</Table> </Table>
} }
</div> </div>
); );

View File

@ -44,91 +44,91 @@ function ProxySettings(props) {
{ {
proxyEnabled.value && proxyEnabled.value &&
<div> <div>
<FormGroup> <FormGroup>
<FormLabel>Proxy Type</FormLabel> <FormLabel>Proxy Type</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.SELECT} type={inputTypes.SELECT}
name="proxyType" name="proxyType"
values={proxyTypeOptions} values={proxyTypeOptions}
onChange={onInputChange} onChange={onInputChange}
{...proxyType} {...proxyType}
/> />
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<FormLabel>Hostname</FormLabel> <FormLabel>Hostname</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.TEXT} type={inputTypes.TEXT}
name="proxyHostname" name="proxyHostname"
onChange={onInputChange} onChange={onInputChange}
{...proxyHostname} {...proxyHostname}
/> />
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<FormLabel>Port</FormLabel> <FormLabel>Port</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.NUMBER} type={inputTypes.NUMBER}
name="proxyPort" name="proxyPort"
min={1} min={1}
max={65535} max={65535}
onChange={onInputChange} onChange={onInputChange}
{...proxyPort} {...proxyPort}
/> />
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<FormLabel>Username</FormLabel> <FormLabel>Username</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.TEXT} type={inputTypes.TEXT}
name="proxyUsername" name="proxyUsername"
helpText="You only need to enter a username and password if one is required. Leave them blank otherwise." helpText="You only need to enter a username and password if one is required. Leave them blank otherwise."
onChange={onInputChange} onChange={onInputChange}
{...proxyUsername} {...proxyUsername}
/> />
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<FormLabel>Password</FormLabel> <FormLabel>Password</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.PASSWORD} type={inputTypes.PASSWORD}
name="proxyPassword" name="proxyPassword"
helpText="You only need to enter a username and password if one is required. Leave them blank otherwise." helpText="You only need to enter a username and password if one is required. Leave them blank otherwise."
onChange={onInputChange} onChange={onInputChange}
{...proxyPassword} {...proxyPassword}
/> />
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<FormLabel>Ignored Addresses</FormLabel> <FormLabel>Ignored Addresses</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.TEXT} type={inputTypes.TEXT}
name="proxyBypassFilter" name="proxyBypassFilter"
helpText="Use ',' as a separator, and '*.' as a wildcard for subdomains" helpText="Use ',' as a separator, and '*.' as a wildcard for subdomains"
onChange={onInputChange} onChange={onInputChange}
{...proxyBypassFilter} {...proxyBypassFilter}
/> />
</FormGroup> </FormGroup>
<FormGroup size={sizes.MEDIUM}> <FormGroup size={sizes.MEDIUM}>
<FormLabel>Bypass Proxy for Local Addresses</FormLabel> <FormLabel>Bypass Proxy for Local Addresses</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.CHECK} type={inputTypes.CHECK}
name="proxyBypassLocalAddresses" name="proxyBypassLocalAddresses"
onChange={onInputChange} onChange={onInputChange}
{...proxyBypassLocalAddresses} {...proxyBypassLocalAddresses}
/> />
</FormGroup> </FormGroup>
</div> </div>
} }
</FieldSet> </FieldSet>
); );

View File

@ -93,32 +93,32 @@ class SecuritySettings extends Component {
{ {
authenticationEnabled && authenticationEnabled &&
<FormGroup> <FormGroup>
<FormLabel>Username</FormLabel> <FormLabel>Username</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.TEXT} type={inputTypes.TEXT}
name="username" name="username"
helpTextWarning="Requires restart to take effect" helpTextWarning="Requires restart to take effect"
onChange={onInputChange} onChange={onInputChange}
{...username} {...username}
/> />
</FormGroup> </FormGroup>
} }
{ {
authenticationEnabled && authenticationEnabled &&
<FormGroup> <FormGroup>
<FormLabel>Password</FormLabel> <FormLabel>Password</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.PASSWORD} type={inputTypes.PASSWORD}
name="password" name="password"
helpTextWarning="Requires restart to take effect" helpTextWarning="Requires restart to take effect"
onChange={onInputChange} onChange={onInputChange}
{...password} {...password}
/> />
</FormGroup> </FormGroup>
} }
<FormGroup> <FormGroup>

View File

@ -50,58 +50,58 @@ function UpdateSettings(props) {
{ {
!isWindows && !isWindows &&
<div> <div>
<FormGroup <FormGroup
advancedSettings={advancedSettings} advancedSettings={advancedSettings}
isAdvanced={true} isAdvanced={true}
size={sizes.MEDIUM} size={sizes.MEDIUM}
> >
<FormLabel>Automatic</FormLabel> <FormLabel>Automatic</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.CHECK} type={inputTypes.CHECK}
name="updateAutomatically" name="updateAutomatically"
helpText="Automatically download and install updates. You will still be able to install from System: Updates" helpText="Automatically download and install updates. You will still be able to install from System: Updates"
onChange={onInputChange} onChange={onInputChange}
{...updateAutomatically} {...updateAutomatically}
/> />
</FormGroup> </FormGroup>
<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
>
<FormLabel>Mechanism</FormLabel>
<FormInputGroup
type={inputTypes.SELECT}
name="updateMechanism"
values={updateOptions}
helpText="Use Radarr's built-in updater or a script"
helpLink="https://github.com/Radarr/Radarr/wiki/Updating"
onChange={onInputChange}
{...updateMechanism}
/>
</FormGroup>
{
updateMechanism.value === 'script' &&
<FormGroup <FormGroup
advancedSettings={advancedSettings} advancedSettings={advancedSettings}
isAdvanced={true} isAdvanced={true}
> >
<FormLabel>Script Path</FormLabel> <FormLabel>Mechanism</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.TEXT} type={inputTypes.SELECT}
name="updateScriptPath" name="updateMechanism"
helpText="Path to a custom script that takes an extracted update package and handle the remainder of the update process" values={updateOptions}
helpText="Use Radarr's built-in updater or a script"
helpLink="https://github.com/Radarr/Radarr/wiki/Updating"
onChange={onInputChange} onChange={onInputChange}
{...updateScriptPath} {...updateMechanism}
/> />
</FormGroup> </FormGroup>
}
</div> {
updateMechanism.value === 'script' &&
<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
>
<FormLabel>Script Path</FormLabel>
<FormInputGroup
type={inputTypes.TEXT}
name="updateScriptPath"
helpText="Path to a custom script that takes an extracted update package and handle the remainder of the update process"
onChange={onInputChange}
{...updateScriptPath}
/>
</FormGroup>
}
</div>
} }
</FieldSet> </FieldSet>
); );

View File

@ -96,12 +96,12 @@ class Indexer extends Component {
{ {
!enableRss && !enableAutomaticSearch && !enableInteractiveSearch && !enableRss && !enableAutomaticSearch && !enableInteractiveSearch &&
<Label <Label
kind={kinds.DISABLED} kind={kinds.DISABLED}
outline={true} outline={true}
> >
Disabled Disabled
</Label> </Label>
} }
</div> </div>

View File

@ -64,9 +64,9 @@ class MediaManagement extends Component {
{ {
!isFetching && error && !isFetching && error &&
<FieldSet legend="Naming Settings"> <FieldSet legend="Naming Settings">
<div>Unable to load Media Management settings</div> <div>Unable to load Media Management settings</div>
</FieldSet> </FieldSet>
} }
{ {

View File

@ -86,12 +86,12 @@ class NetImport extends Component {
{ {
!enabled && !enableAuto && !enabled && !enableAuto &&
<Label <Label
kind={kinds.DISABLED} kind={kinds.DISABLED}
outline={true} outline={true}
> >
Disabled Disabled
</Label> </Label>
} }
</div> </div>

View File

@ -106,9 +106,9 @@ class Notification extends Component {
{ {
supportsOnHealthIssue && onHealthIssue && supportsOnHealthIssue && onHealthIssue &&
<Label kind={kinds.SUCCESS}> <Label kind={kinds.SUCCESS}>
On Health Issue On Health Issue
</Label> </Label>
} }
{ {

View File

@ -76,45 +76,45 @@ function LogsTable(props) {
<PageContentBodyConnector> <PageContentBodyConnector>
{ {
isFetching && !isPopulated && isFetching && !isPopulated &&
<LoadingIndicator /> <LoadingIndicator />
} }
{ {
isPopulated && !error && !items.length && isPopulated && !error && !items.length &&
<div> <div>
No logs found No logs found
</div> </div>
} }
{ {
isPopulated && !error && !!items.length && isPopulated && !error && !!items.length &&
<div> <div>
<Table <Table
columns={columns} columns={columns}
canModifyColumns={false} canModifyColumns={false}
{...otherProps} {...otherProps}
> >
<TableBody> <TableBody>
{ {
items.map((item) => { items.map((item) => {
return ( return (
<LogsTableRow <LogsTableRow
key={item.id} key={item.id}
columns={columns} columns={columns}
{...item} {...item}
/> />
); );
}) })
} }
</TableBody> </TableBody>
</Table> </Table>
<TablePager <TablePager
totalRecords={totalRecords} totalRecords={totalRecords}
isFetching={isFetching} isFetching={isFetching}
{...otherProps} {...otherProps}
/> />
</div> </div>
} }
</PageContentBodyConnector> </PageContentBodyConnector>
</PageContent> </PageContent>

View File

@ -54,27 +54,27 @@ function QueuedTasks(props) {
<FieldSet legend="Queue"> <FieldSet legend="Queue">
{ {
isFetching && !isPopulated && isFetching && !isPopulated &&
<LoadingIndicator /> <LoadingIndicator />
} }
{ {
isPopulated && isPopulated &&
<Table <Table
columns={columns} columns={columns}
> >
<TableBody> <TableBody>
{ {
items.map((item) => { items.map((item) => {
return ( return (
<QueuedTaskRowConnector <QueuedTaskRowConnector
key={item.id} key={item.id}
{...item} {...item}
/> />
); );
}) })
} }
</TableBody> </TableBody>
</Table> </Table>
} }
</FieldSet> </FieldSet>
); );

View File

@ -44,27 +44,27 @@ function ScheduledTasks(props) {
<FieldSet legend="Scheduled"> <FieldSet legend="Scheduled">
{ {
isFetching && !isPopulated && isFetching && !isPopulated &&
<LoadingIndicator /> <LoadingIndicator />
} }
{ {
isPopulated && isPopulated &&
<Table <Table
columns={columns} columns={columns}
> >
<TableBody> <TableBody>
{ {
items.map((item) => { items.map((item) => {
return ( return (
<ScheduledTaskRowConnector <ScheduledTaskRowConnector
key={item.id} key={item.id}
{...item} {...item}
/> />
); );
}) })
} }
</TableBody> </TableBody>
</Table> </Table>
} }
</FieldSet> </FieldSet>
); );

View File

@ -55,14 +55,14 @@ class Updates extends Component {
<div className={styles.updateAvailable}> <div className={styles.updateAvailable}>
{ {
!isDocker && !isDocker &&
<SpinnerButton <SpinnerButton
className={styles.updateAvailable} className={styles.updateAvailable}
kind={kinds.PRIMARY} kind={kinds.PRIMARY}
isSpinning={isInstallingUpdate} isSpinning={isInstallingUpdate}
onPress={onInstallLatestPress} onPress={onInstallLatestPress}
> >
Install Latest Install Latest
</SpinnerButton> </SpinnerButton>
} }
{ {