mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 16:13:58 -07:00
New: Artist folder hint when selecting a root folder while adding a new artist
Closes #1214 Closes #1467
This commit is contained in:
parent
86130751c2
commit
a16463eeb3
26 changed files with 237 additions and 30 deletions
|
@ -13,6 +13,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
.value {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.artistFolder {
|
||||
flex: 0 0 auto;
|
||||
color: var(--disabledColor);
|
||||
}
|
||||
|
||||
.freeSpace {
|
||||
margin-left: 15px;
|
||||
color: var(--darkGray);
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
// This file is automatically generated.
|
||||
// Please do not change this file!
|
||||
interface CssExports {
|
||||
'artistFolder': string;
|
||||
'freeSpace': string;
|
||||
'isMobile': string;
|
||||
'optionText': string;
|
||||
'value': string;
|
||||
}
|
||||
export const cssExports: CssExports;
|
||||
export default cssExports;
|
||||
|
|
|
@ -7,17 +7,25 @@ import styles from './RootFolderSelectInputOption.css';
|
|||
|
||||
function RootFolderSelectInputOption(props) {
|
||||
const {
|
||||
id,
|
||||
value,
|
||||
name,
|
||||
freeSpace,
|
||||
artistFolder,
|
||||
isMobile,
|
||||
isWindows,
|
||||
...otherProps
|
||||
} = props;
|
||||
|
||||
const text = value === '' ? name : `${name} [${value}]`;
|
||||
const slashCharacter = isWindows ? '\\' : '/';
|
||||
|
||||
const text = value === '' ? name : `[${name}] ${value}`;
|
||||
|
||||
console.debug(props);
|
||||
|
||||
return (
|
||||
<EnhancedSelectInputOption
|
||||
id={id}
|
||||
isMobile={isMobile}
|
||||
{...otherProps}
|
||||
>
|
||||
|
@ -26,7 +34,18 @@ function RootFolderSelectInputOption(props) {
|
|||
isMobile && styles.isMobile
|
||||
)}
|
||||
>
|
||||
<div>{text}</div>
|
||||
<div className={styles.value}>
|
||||
{text}
|
||||
|
||||
{
|
||||
artistFolder && id !== 'addNew' ?
|
||||
<div className={styles.artistFolder}>
|
||||
{slashCharacter}
|
||||
{artistFolder}
|
||||
</div> :
|
||||
null
|
||||
}
|
||||
</div>
|
||||
|
||||
{
|
||||
freeSpace != null &&
|
||||
|
@ -40,10 +59,13 @@ function RootFolderSelectInputOption(props) {
|
|||
}
|
||||
|
||||
RootFolderSelectInputOption.propTypes = {
|
||||
id: PropTypes.string.isRequired,
|
||||
name: PropTypes.string.isRequired,
|
||||
value: PropTypes.string.isRequired,
|
||||
freeSpace: PropTypes.number,
|
||||
isMobile: PropTypes.bool.isRequired
|
||||
artistFolder: PropTypes.string,
|
||||
isMobile: PropTypes.bool.isRequired,
|
||||
isWindows: PropTypes.bool
|
||||
};
|
||||
|
||||
export default RootFolderSelectInputOption;
|
||||
|
|
|
@ -7,12 +7,22 @@
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
.path {
|
||||
.pathContainer {
|
||||
@add-mixin truncate;
|
||||
|
||||
display: flex;
|
||||
flex: 1 0 0;
|
||||
}
|
||||
|
||||
.path {
|
||||
flex: 0 1 auto;
|
||||
}
|
||||
|
||||
.artistFolder {
|
||||
@add-mixin truncate;
|
||||
flex: 0 1 auto;
|
||||
color: var(--disabledColor);
|
||||
}
|
||||
|
||||
.freeSpace {
|
||||
flex: 0 0 auto;
|
||||
margin-left: 15px;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
// This file is automatically generated.
|
||||
// Please do not change this file!
|
||||
interface CssExports {
|
||||
'artistFolder': string;
|
||||
'freeSpace': string;
|
||||
'path': string;
|
||||
'pathContainer': string;
|
||||
'selectedValue': string;
|
||||
}
|
||||
export const cssExports: CssExports;
|
||||
|
|
|
@ -9,19 +9,34 @@ function RootFolderSelectInputSelectedValue(props) {
|
|||
name,
|
||||
value,
|
||||
freeSpace,
|
||||
artistFolder,
|
||||
includeFreeSpace,
|
||||
isWindows,
|
||||
...otherProps
|
||||
} = props;
|
||||
|
||||
const text = value === '' ? name : `${name} [${value}]`;
|
||||
const slashCharacter = isWindows ? '\\' : '/';
|
||||
|
||||
const text = value === '' ? name : `[${name}] ${value}`;
|
||||
|
||||
return (
|
||||
<EnhancedSelectInputSelectedValue
|
||||
className={styles.selectedValue}
|
||||
{...otherProps}
|
||||
>
|
||||
<div className={styles.path}>
|
||||
{text}
|
||||
<div className={styles.pathContainer}>
|
||||
<div className={styles.path}>
|
||||
{text}
|
||||
</div>
|
||||
|
||||
{
|
||||
artistFolder ?
|
||||
<div className={styles.artistFolder}>
|
||||
{slashCharacter}
|
||||
{artistFolder}
|
||||
</div> :
|
||||
null
|
||||
}
|
||||
</div>
|
||||
|
||||
{
|
||||
|
@ -38,6 +53,8 @@ RootFolderSelectInputSelectedValue.propTypes = {
|
|||
name: PropTypes.string,
|
||||
value: PropTypes.string,
|
||||
freeSpace: PropTypes.number,
|
||||
artistFolder: PropTypes.string,
|
||||
isWindows: PropTypes.bool,
|
||||
includeFreeSpace: PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue