Merged PR 947: remove notice banner and add tags/meta to uploads
remove notice banner and add tags/meta to uploads Related work items: #7961
This commit is contained in:
+24
-1
@@ -224,9 +224,15 @@ export const createBlob = async (formContent, containerName, caseref) => {
|
||||
const containerClient = new ContainerClient(sasUrl);
|
||||
|
||||
formContent = JSON.parse(formContent);
|
||||
let caseID = formContent.pinswg_name;
|
||||
let caseID = "";
|
||||
|
||||
caseID = _.has(formContent, "pinswg_name")
|
||||
? formContent.pinswg_name
|
||||
: caseref;
|
||||
|
||||
const content = JSON.stringify(formContent);
|
||||
|
||||
console.log(content);
|
||||
const blobName = caseID + "/" + caseID + "_appeal.json";
|
||||
|
||||
console.log("blobName:", blobName);
|
||||
@@ -236,6 +242,16 @@ export const createBlob = async (formContent, containerName, caseref) => {
|
||||
content,
|
||||
Buffer.byteLength(content)
|
||||
);
|
||||
|
||||
const tags = {
|
||||
containerid: containerName,
|
||||
caseID: caseID,
|
||||
};
|
||||
|
||||
console.log("the tags:", tags);
|
||||
const withTags = await blockBlobClient.setTags(tags);
|
||||
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||
|
||||
return formContent.pinswg_name;
|
||||
};
|
||||
|
||||
@@ -309,6 +325,13 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
||||
files[prop][0].path,
|
||||
files[prop].size
|
||||
);
|
||||
const tags = {
|
||||
containerid: containerName,
|
||||
caseID: foldername,
|
||||
};
|
||||
const withTags = await blockBlobClient.setTags(tags);
|
||||
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||
|
||||
console.log(
|
||||
`Uploaded block blob ${files[prop][0].fieldName} successfully`,
|
||||
uploadBlobResponse.requestId
|
||||
|
||||
@@ -19,8 +19,8 @@ ApiProxy.post(async (req, res) => {
|
||||
// console.log(req.files);
|
||||
|
||||
const appealData = req.body.appealData;
|
||||
const containerID = req.body.containerID;
|
||||
const casefolderID = req.body.casefolderID;
|
||||
const containerID = req.body.containerID[0];
|
||||
const casefolderID = req.body.casefolderID[0];
|
||||
|
||||
console.log("there are files:", Object.keys(req.files).length);
|
||||
|
||||
|
||||
+1
-29
@@ -4,13 +4,12 @@ import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import { setCookie } from "nookies";
|
||||
import { connect } from "react-redux";
|
||||
import { getNotice, getToken, hashString, getPortalLogin } from "../actions";
|
||||
import { getToken, hashString, getPortalLogin } from "../actions";
|
||||
import CookieBanner from "../components/cookieBanner";
|
||||
import Footer from "../components/footer";
|
||||
import Header from "../components/header";
|
||||
import Main from "../components/main";
|
||||
import ServiceBanner from "../components/servicebanner";
|
||||
import NoticeBanner from "../components/noticebanner";
|
||||
import {
|
||||
setAccountDetails,
|
||||
setContainerID,
|
||||
@@ -28,7 +27,6 @@ const Home = (props) => {
|
||||
loginEmailStr,
|
||||
loggedInUserEmail,
|
||||
hasLoginCode,
|
||||
noticeContent,
|
||||
} = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
@@ -69,26 +67,6 @@ const Home = (props) => {
|
||||
}))
|
||||
: console.log("no value in user id");
|
||||
|
||||
var noticeDateFrom = new Date(
|
||||
noticeContent.value[0].dateFrom.split("/")[2],
|
||||
noticeContent.value[0].dateFrom.split("/")[1] - 1,
|
||||
noticeContent.value[0].dateFrom.split("/")[0]
|
||||
);
|
||||
|
||||
var noticeDateTo = new Date(
|
||||
noticeContent.value[0].dateTo.split("/")[2],
|
||||
noticeContent.value[0].dateTo.split("/")[1] - 1,
|
||||
noticeContent.value[0].dateTo.split("/")[0]
|
||||
);
|
||||
|
||||
var today = new Date();
|
||||
var day = today.getDate();
|
||||
var month = today.getMonth();
|
||||
var year = today.getFullYear();
|
||||
|
||||
today = new Date(year, month, day);
|
||||
const displayNotice = today >= noticeDateFrom && today <= noticeDateTo;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Head>
|
||||
@@ -151,9 +129,6 @@ const Home = (props) => {
|
||||
) : (
|
||||
<>
|
||||
<ServiceBanner />
|
||||
{displayNotice && (
|
||||
<NoticeBanner noticeContent={noticeContent} />
|
||||
)}
|
||||
<Main
|
||||
pages={pages}
|
||||
showLogin={showLogin}
|
||||
@@ -192,8 +167,6 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
console.log("hasloginCode:", hasLoginCode + "\n////////////////////\n");
|
||||
|
||||
const noticeContent = await getNotice();
|
||||
|
||||
let ggToken = {};
|
||||
let ggUserInfo = {};
|
||||
let portalUserObj = {};
|
||||
@@ -216,7 +189,6 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
loggedInUserId: portalUserObj,
|
||||
loggedInUserEmail: loginEmailStr,
|
||||
hasLoginCode: hasLoginCode,
|
||||
noticeContent: noticeContent,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user