hide reps button & add rich text for reps

This commit is contained in:
2022-10-12 12:23:26 +01:00
parent 33053a578b
commit 96387db56e
22 changed files with 531 additions and 79 deletions
+6 -1
View File
@@ -24,7 +24,12 @@ const hashAPIPath = (queryPath) => {
export default async function ApiProxy(req, res) {
var incidentID = req.query.incidentID;
var token = await getToken();
var queryUrl = "incidents(" + incidentID + ")?$select=ticketnumber,title";
var queryUrl =
"incidents(" +
incidentID +
")?$select=ticketnumber,title,pinswg_appealcasetype";
//console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
return axios
.get(
@@ -26,6 +26,8 @@ export default async function ApiProxy(req, res) {
loggedInUserId +
"&$count=true&$orderby=createdon desc";
//console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
return axios
.get(
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
@@ -23,7 +23,7 @@ export default async function ApiProxy(req, res) {
var caseReference = req.query.caseReference.split("'").join("''");
var token = await getToken();
//console.log("the case:", caseReference);
//console.log("the case:", req.query, caseReference);
var queryUrl =
appealType +
@@ -33,7 +33,7 @@ export default async function ApiProxy(req, res) {
queryUrl = queryUrl + getSelectQuery(appealType);
//console.log("test:", queryUrl);
//console.log("test:", WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
return axios
.get(
+4 -2
View File
@@ -8,7 +8,7 @@ import CookieBanner from "../../components/cookieBanner";
import Footer from "../../components/footer";
import Header from "../../components/header";
const Home = (props) => {
const CaseHome = (props) => {
const { footerLinks, pages } = props;
let { t, lang } = useTranslation();
@@ -66,6 +66,7 @@ const Home = (props) => {
representationsObj={
props.searchResultsObj.representationsObj
}
showLoginCheck={props.showLoginCheck}
/>
</div>
<Footer footerLinks={footerLinks} />
@@ -88,7 +89,8 @@ const mapStateToProps = (state) => {
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
showLoginCheck: process.env.SHOWLOGIN || false,
};
};
export default connect(mapStateToProps)(Home);
export default connect(mapStateToProps)(CaseHome);
+17 -1
View File
@@ -12,6 +12,8 @@ import {
getPersonalAccount,
getPortalModuleDetails,
getWatchedCases,
consoleLogger,
getCase,
} from "../../actions";
import { createContainer } from "../../actions/azurestorage";
import { getProviderConfig } from "../../actions/govgateway";
@@ -255,9 +257,23 @@ export const getServerSideProps = wrapper.getServerSideProps(
);
const getDetails = (resultsObj, detailsType) => {
//console.log(detailsType);
let detailsArr = [];
resultsObj = resultsObj.value;
if (detailsType == "myRepresentations") {
const repsObj = resultsObj.map((searchDetail, index) => {
detailsArr.push(
getCase(searchDetail["_pinswg_case_value"]).then((data) => {
return getPortalModuleDetails(
getFormCollectionByID(data.pinswg_appealcasetype)
.LogicalCollectionName,
data.ticketnumber
);
})
);
});
}
const detailsObj = resultsObj.map((searchDetail, index) => {
if (searchDetail.pinswg_appealcasetype == null) {
console.log(
+2 -2
View File
@@ -18,7 +18,7 @@ import { wrapper } from "../store/store";
import _ from "lodash";
const Home = (props) => {
const { footerLinks, pages, isLinkedCase } = props;
const { footerLinks, pages, isLinkedCase, showLoginCheck } = props;
let { t, lang } = useTranslation();
const router = useRouter();
@@ -106,7 +106,7 @@ const Home = (props) => {
searchString={props.search.searchString}
searchResultsObj={props.searchResultsObj}
isLinkedCase={isLinkedCase}
showLoginCheck
showLoginCheck={showLoginCheck}
/>
</div>
<Footer footerLinks={footerLinks} />