feat(xo-web/render-xo-item/SR): minor improvements (#3752)

- Space left before container
- Hide context to self users
- Don't use text-muted on links
This commit is contained in:
Pierre Donias 2018-12-04 11:35:57 +01:00 committed by GitHub
parent 75f1d80a86
commit e08d03687e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,7 +192,7 @@ export const Sr = decorate([
container: getContainer(state, props),
})
}),
({ sr, container, link, newTab, spaceLeft }) => {
({ sr, container, link, newTab, spaceLeft, self }) => {
if (sr === undefined) {
return UNKNOWN_ITEM
}
@ -200,11 +200,16 @@ export const Sr = decorate([
return (
<LinkWrapper link={link} newTab={newTab} to={`/srs/${sr.id}`}>
<Icon icon='sr' /> {sr.name_label}
{container !== undefined && (
<span className='text-muted'> - {container.name_label}</span>
{!self && spaceLeft && isSrWritable(sr) && (
<span className={!link && 'text-muted'}>{` (${formatSize(
sr.size - sr.physical_usage
)} free)`}</span>
)}
{spaceLeft && isSrWritable(sr) && (
<span>{` (${formatSize(sr.size - sr.physical_usage)} free)`}</span>
{!self && container !== undefined && (
<span className={!link && 'text-muted'}>
{' '}
- {container.name_label}
</span>
)}
</LinkWrapper>
)