reps pdf upload directory restructure
This commit is contained in:
@@ -130,6 +130,11 @@ const TopThree = (props) => {
|
||||
}
|
||||
};
|
||||
|
||||
const repRaisedDate = (datePart) => {
|
||||
var dateObj = new Date(parseInt(datePart.split("-")[3]));
|
||||
return dateObj.toLocaleString();
|
||||
};
|
||||
|
||||
let topThreeOnlyArr = showTopThreeArr; //.slice(0, 3);
|
||||
Object.keys(topThreeOnlyArr).map((key, index) => {
|
||||
topthreeRow.push(
|
||||
@@ -138,13 +143,14 @@ const TopThree = (props) => {
|
||||
<div className="cardModuleReference">
|
||||
<b>Representation ID:</b>{" "}
|
||||
<Link
|
||||
// href={{
|
||||
// pathname: "/myportal/representation",
|
||||
// query: {
|
||||
// case: showTopThreeArr[key].casereference,
|
||||
// },
|
||||
// }}
|
||||
href="#"
|
||||
href={{
|
||||
pathname: "/myportal/representation",
|
||||
query: {
|
||||
case: showTopThreeArr[key].caseRef,
|
||||
state: "edit",
|
||||
},
|
||||
}}
|
||||
// href="#"
|
||||
>
|
||||
<a
|
||||
className="govuk-link--no-underline"
|
||||
@@ -152,26 +158,13 @@ const TopThree = (props) => {
|
||||
onClick={() => {
|
||||
setCurrentReference({
|
||||
"currentReference":
|
||||
topThreeType != "watchedCases"
|
||||
? topThreeType !=
|
||||
"myRepresentations"
|
||||
? showTopThreeArr[key]
|
||||
.ticketnumber
|
||||
: showTopThreeArr[key]
|
||||
.casereference
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
],
|
||||
showTopThreeArr[key].caseRef,
|
||||
"currentType": topThreeType,
|
||||
|
||||
"incidentid": getIncidentId(
|
||||
topThreeType,
|
||||
showTopThreeArr[key]
|
||||
),
|
||||
|
||||
"incidentid":
|
||||
showTopThreeArr[key].incidentID,
|
||||
"appealType":
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appealcasetype,
|
||||
showTopThreeArr[key].appealType,
|
||||
"repDetails": showTopThreeArr[key],
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -189,6 +182,16 @@ const TopThree = (props) => {
|
||||
{" "}
|
||||
{showTopThreeArr[key].representationType}
|
||||
</div>
|
||||
<div className="cardModuleReference">
|
||||
<b>Capacity:</b>
|
||||
{" "}
|
||||
{showTopThreeArr[key].representationCapacity}
|
||||
</div>
|
||||
<div className="cardModuleReference">
|
||||
<b>Date raised:</b>
|
||||
{" "}
|
||||
{repRaisedDate(showTopThreeArr[key].repfile_name)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -9,6 +9,11 @@ import { connect } from "react-redux";
|
||||
import Dropzone, { useDropzone } from "react-dropzone";
|
||||
import { uploadFiles } from "../../actions";
|
||||
import { getContainers } from "../../actions/azurestorage";
|
||||
import {
|
||||
getFormCollectionByID,
|
||||
getThumbnailIconByExtension,
|
||||
bytesToSize,
|
||||
} from "../utils";
|
||||
|
||||
const required = (errorMsg) => (value) =>
|
||||
value || typeof value === "number" ? undefined : errorMsg;
|
||||
@@ -119,13 +124,6 @@ const RenderFileUpload = (field) => {
|
||||
</div>
|
||||
));
|
||||
|
||||
function bytesToSize(bytes) {
|
||||
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
||||
if (bytes == 0) return "0 Byte";
|
||||
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
||||
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
|
||||
}
|
||||
|
||||
const getThumbnailIcon = (fileObj, fileType) => {
|
||||
switch (fileType) {
|
||||
case "text/html":
|
||||
|
||||
Reference in New Issue
Block a user