added count for orphaned reps
This commit is contained in:
+28
-2
@@ -111,7 +111,7 @@ const deleteCaseItem = (containerID, caseID) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function StoragePage(props) {
|
export default function StoragePage(props) {
|
||||||
const { data, userData } = props;
|
const { data, userData, repCompleteCount } = props;
|
||||||
const [showRepJson, setShowRepJson] = useState(true);
|
const [showRepJson, setShowRepJson] = useState(true);
|
||||||
const [showTmpFile, setShowTmpFile] = useState(true);
|
const [showTmpFile, setShowTmpFile] = useState(true);
|
||||||
const [whichTab, setWhichTab] = useState("storage");
|
const [whichTab, setWhichTab] = useState("storage");
|
||||||
@@ -174,6 +174,12 @@ export default function StoragePage(props) {
|
|||||||
id="storage"
|
id="storage"
|
||||||
>
|
>
|
||||||
<h1>Storage Account Contents</h1>
|
<h1>Storage Account Contents</h1>
|
||||||
|
{repCompleteCount > 0 && (
|
||||||
|
<p>
|
||||||
|
Number of Orphaned Reps:{" "}
|
||||||
|
{repCompleteCount}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Toggle buttons */}
|
{/* Toggle buttons */}
|
||||||
<div style={{ marginBottom: "0.2rem" }}>
|
<div style={{ marginBottom: "0.2rem" }}>
|
||||||
@@ -712,5 +718,25 @@ export async function getServerSideProps({ req }) {
|
|||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
|
|
||||||
return { props: { data: data.filter(Boolean), userData: userData } };
|
let repCompleteCount = 0;
|
||||||
|
|
||||||
|
data = data.filter(Boolean);
|
||||||
|
|
||||||
|
data.forEach((user) => {
|
||||||
|
user.containers.forEach((container) => {
|
||||||
|
container.folders.forEach((folder) => {
|
||||||
|
if (folder.repComplete === true) {
|
||||||
|
repCompleteCount++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
data: data,
|
||||||
|
userData: userData,
|
||||||
|
repCompleteCount,
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user