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