mirror of
https://github.com/ANL-CEEESA/RELOG.git
synced 2025-12-06 07:48:50 -06:00
Disable download button when no data is available
This commit is contained in:
@@ -12,7 +12,11 @@ const Button = (props) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<button className={className} onClick={props.onClick}>
|
||||
<button
|
||||
className={className}
|
||||
onClick={props.onClick}
|
||||
disabled={props.disabled}
|
||||
>
|
||||
{tooltip}
|
||||
{props.label}
|
||||
</button>
|
||||
|
||||
@@ -60,3 +60,8 @@
|
||||
opacity: 100%;
|
||||
transition: opacity 0.5s;
|
||||
}
|
||||
|
||||
.Button:disabled {
|
||||
color: rgba(0, 0, 0, 0.25);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
@@ -31,8 +31,18 @@ const FileInputRow = (props) => {
|
||||
<label>{props.label}</label>
|
||||
<input type="text" value={props.value} disabled="disabled" />
|
||||
<Button label="Upload" kind="inline" onClick={onClickUpload} />
|
||||
<Button label="Download" kind="inline" onClick={props.onDownload} />
|
||||
<Button label="Clear" kind="inline" onClick={props.onClear} />
|
||||
<Button
|
||||
label="Download"
|
||||
kind="inline"
|
||||
onClick={props.onDownload}
|
||||
disabled={props.disableDownload}
|
||||
/>
|
||||
<Button
|
||||
label="Clear"
|
||||
kind="inline"
|
||||
onClick={props.onClear}
|
||||
disabled={props.disableClear}
|
||||
/>
|
||||
<Button label="Template" kind="inline" onClick={props.onTemplate} />
|
||||
{tooltip}
|
||||
<input
|
||||
|
||||
@@ -91,8 +91,12 @@ const ProductBlock = (props) => {
|
||||
};
|
||||
|
||||
let description = "Not initially available";
|
||||
let notInitiallyAvailable = true;
|
||||
const nCenters = Object.keys(props.value["initial amounts"]).length;
|
||||
if (nCenters > 0) description = `${nCenters} collection centers`;
|
||||
if (nCenters > 0) {
|
||||
description = `${nCenters} collection centers`;
|
||||
notInitiallyAvailable = false;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -109,6 +113,8 @@ const ProductBlock = (props) => {
|
||||
onDownload={onInitialAmountsDownload}
|
||||
onClear={onInitialAmountsClear}
|
||||
onTemplate={onInitialAmountsTemplate}
|
||||
disableDownload={notInitiallyAvailable}
|
||||
disableClear={notInitiallyAvailable}
|
||||
/>
|
||||
|
||||
<h1 style={{ display: nCenters == 0 ? "none" : "block" }}>
|
||||
|
||||
Reference in New Issue
Block a user