update formatting

This commit is contained in:
2026-03-17 09:22:31 +00:00
parent 1e690608fb
commit f1775c2a96
3 changed files with 159 additions and 133 deletions
+12 -4
View File
@@ -5,7 +5,7 @@ import { PrismaClient } from "@prisma/client";
import CryptoJS from "crypto-js"; import CryptoJS from "crypto-js";
import { getUpToLastSlash, streamToString } from "../utils/adminHelper"; import { getUpToLastSlash, streamToString } from "../utils/adminHelper";
import { listContainersForUser } from "../../../actions/azurestorage"; import { listContainersForUser } from "../../../actions/azurestorage";
import pLimit from "p-limit";
const prisma = global.prisma || new PrismaClient(); const prisma = global.prisma || new PrismaClient();
const WORDKEY = process.env.HASHKEY; const WORDKEY = process.env.HASHKEY;
/** /**
@@ -34,8 +34,10 @@ export async function fetchAdminStorageData() {
const users = await prisma.user.findMany(); const users = await prisma.user.findMany();
const limit = pLimit(5);
let data = await Promise.all( let data = await Promise.all(
users.map(async (user) => { users.map(async (user) => {
limit(async () => {
const containers = await listContainersForUser( const containers = await listContainersForUser(
blobServiceClient, blobServiceClient,
`${user.id}`, `${user.id}`,
@@ -54,7 +56,9 @@ export async function fetchAdminStorageData() {
`/api/file/downloadblob?container=${ `/api/file/downloadblob?container=${
container.container container.container
}&casefolderID=${folderPath}&blobname=${blob.name }&casefolderID=${folderPath}&blobname=${blob.name
.substring(blob.name.lastIndexOf("/") + 1) .substring(
blob.name.lastIndexOf("/") + 1
)
.trim()}`, .trim()}`,
process.env.HASHKEY process.env.HASHKEY
); );
@@ -62,7 +66,8 @@ export async function fetchAdminStorageData() {
const fileNameOnly = blob.name.substring( const fileNameOnly = blob.name.substring(
blob.name.lastIndexOf("/") + 1 blob.name.lastIndexOf("/") + 1
); );
const isTmpFile = fileNameOnly.startsWith("TMP-"); const isTmpFile =
fileNameOnly.startsWith("TMP-");
const blobWithHash = { const blobWithHash = {
...blob, ...blob,
@@ -92,7 +97,9 @@ export async function fetchAdminStorageData() {
} }
// rep.json handling // rep.json handling
if (blob.name.toLowerCase().endsWith("rep.json")) { if (
blob.name.toLowerCase().endsWith("rep.json")
) {
folderGroup.hasRepJson = true; folderGroup.hasRepJson = true;
folderGroup.repJsonBlob = blobWithHash; folderGroup.repJsonBlob = blobWithHash;
@@ -140,6 +147,7 @@ export async function fetchAdminStorageData() {
containers: containersWithHashes containers: containersWithHashes
} }
: null; : null;
});
}) })
); );
+1 -1
View File
@@ -450,7 +450,7 @@ let BuildCheckSection = (props) => {
data-module="govuk-button" data-module="govuk-button"
onClick={async () => { onClick={async () => {
await triggerAppealDownload(); await triggerAppealDownload();
finaliseAppeal(); // finaliseAppeal();
}} }}
> >
{t("newappeal:submit-appeal-button")} {t("newappeal:submit-appeal-button")}
+33 -15
View File
@@ -112,7 +112,8 @@ export const AppealRow_pdf = (props) => {
color: "grey" color: "grey"
}, },
documentList: { documentList: {
fontSize: 10 fontSize: 10,
lineHeight: 1.4
}, },
richArea: { richArea: {
fontSize: 12, fontSize: 12,
@@ -432,10 +433,16 @@ export const AppealRow_pdf = (props) => {
flexDirection: "column", flexDirection: "column",
marginBottom: 10 marginBottom: 10
}} }}
wrap={false}
> >
<View <View
wrap={false} style={{
flexDirection: "column",
marginBottom: 10
}}
>
{/* Removed wrap={false} here so the list can flow to page 2 */}
<View
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10 marginBottom: 10
@@ -449,18 +456,32 @@ export const AppealRow_pdf = (props) => {
{rows[0].value} {rows[0].value}
</Text> </Text>
</View> </View>
<View <View
style={ style={
styles.questionAnswerWide styles.questionAnswerWide
} }
> >
{blobList.map((blob, i) => ( {blobList.map((blob, i) => {
<Text key={i}> const isTargetType =
{getDocumentTypeFromFilename( getDocumentTypeFromFilename(
blob.name blob.name
) === ) ===
documentTypeCode[0] documentTypeCode[0]
.value && ( .value;
if (!isTargetType)
return null;
return (
/* wrap={false} here ensures a single filename stays together */
<View
key={i}
wrap={false}
style={{
marginBottom: 4
}}
>
<Text <Text
style={ style={
styles.documentList styles.documentList
@@ -468,15 +489,12 @@ export const AppealRow_pdf = (props) => {
> >
{blob.name} {blob.name}
{blob?.size && {blob?.size &&
" - " + ` - ${bytesToSize(blob.size)}`}
bytesToSize(
blob?.size
)}{" "}
{"\n"}
</Text> </Text>
)} </View>
</Text> );
))} })}
</View>
</View> </View>
</View> </View>
); );