visual clean up of metadata box

This commit is contained in:
ari committed 2022-08-25 12:58:08 -04:00
1 parent e2d4022bde
commit 5115dd9490
2 files changed
+30 -14

No files matched your search

@@ -79,6 +79,11 @@
cursor: default; cursor: default;
} }
.automation-manager--metadatabox {
--metadatabox--switch-width: 5em;
--metadatabox--title--source-height: 1.5em;
}
.automation-manager--metadatabox .metadatabox--switch { .automation-manager--metadatabox .metadatabox--switch {
display: flex; display: flex;
cursor: pointer; cursor: pointer;
@@ -88,16 +93,28 @@
text-align: center; text-align: center;
font-size: 0.75em; font-size: 0.75em;
user-select: none; user-select: none;
max-width: 5em; max-width: var(--metadatabox--switch-width);
}
.automation-manager--metadatabox .metadatabox--title {
position: relative;
padding-top: var(--metadatabox--title--source-height);
} }
.automation-manager--metadatabox .metadatabox--title--source { .automation-manager--metadatabox .metadatabox--title--source {
position: absolute;
margin-bottom: -0.5em; margin-bottom: -0.5em;
left: calc(0.75em - var(--metadatabox--switch-width));
top: 0;
} }
.automation-manager--metadatabox .metadatabox--title--source .MuiChip-root { .automation-manager--metadatabox .metadatabox--title--source .MuiChip-root {
font-size: 0.85em; font-size: 0.6em;
height: 2em; max-height: calc(var(--metadatabox--title--source-height));
padding-top: 0.5em;
padding-bottom: 0.5em;
height: fit-content;
max-width: 60%; max-width: 60%;
min-width: fit-content;
} }
@@ -50,10 +50,7 @@ export const MetadataBox: FC<MetadataBoxProps> = (props) => {
/> />
{!isValidState && `Invalid state: '${props.state}'`} {!isValidState && `Invalid state: '${props.state}'`}
</div> </div>
<div <div className="metadatabox--title">
className="metadatabox--title"
title={`ID=${props.id}, EntityID=${props.entityId}`}
>
<span className="metadatabox--title--source"> <span className="metadatabox--title--source">
<Tooltip <Tooltip
title={`This automation is located in the file ${props.source_file} and is set up in your configuration.yaml file under the key ${props.configuration_key}.`} title={`This automation is located in the file ${props.source_file} and is set up in your configuration.yaml file under the key ${props.configuration_key}.`}
@@ -64,13 +61,15 @@ export const MetadataBox: FC<MetadataBoxProps> = (props) => {
/> />
</Tooltip> </Tooltip>
</span> </span>
<InputTextView <Tooltip title={`ID=${props.id}, EntityID=${props.entityId}`}>
className="title" <InputTextView
placeholder="Title" className="title"
value={props.title} placeholder="Title"
onChange={props.onTitleUpdate} value={props.title}
disabled={props.isNew} onChange={props.onTitleUpdate}
/> disabled={props.isNew}
/>
</Tooltip>
<InputTextView <InputTextView
className="description" className="description"
placeholder="Description" placeholder="Description"