update dns subsection autosuggest list
This commit is contained in:
@@ -66,7 +66,15 @@ export const getSearchDetails = (searchResultsObj) => {
|
|||||||
searchResultsObj = searchResultsObj.value;
|
searchResultsObj = searchResultsObj.value;
|
||||||
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
||||||
if (searchDetail.pinswg_appealcasetype == null) {
|
if (searchDetail.pinswg_appealcasetype == null) {
|
||||||
console.log(searchDetail.title);
|
//console.log(searchDetail.title);
|
||||||
|
detailsArr.push(
|
||||||
|
getBasicSearchDetails(
|
||||||
|
"pinswg_dnses",
|
||||||
|
searchDetail.title,
|
||||||
|
"pinswg_dnsid",
|
||||||
|
searchDetail.incidentid
|
||||||
|
)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
let formMeta = getFormCollectionByID(
|
let formMeta = getFormCollectionByID(
|
||||||
searchDetail.pinswg_appealcasetype
|
searchDetail.pinswg_appealcasetype
|
||||||
|
|||||||
@@ -119,9 +119,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
|
|
||||||
const searchResultsObj = await getAdvancedSearch(query);
|
const searchResultsObj = await getAdvancedSearch(query);
|
||||||
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||||
|
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||||
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
||||||
store.dispatch(setShowReps(showReps));
|
store.dispatch(setShowReps(showReps, showLoginCheck));
|
||||||
|
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
store.dispatch(setSearchResults(searchResultsObj));
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
|
|||||||
@@ -84,6 +84,13 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
store.dispatch(setSearch("DNS"));
|
store.dispatch(setSearch("DNS"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
const searchDetailsObj = await getSearchDetails(
|
||||||
|
searchResultsObj
|
||||||
|
);
|
||||||
|
store.dispatch(setSearchResults(searchResultsObj));
|
||||||
|
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
|
store.dispatch(setSearch("DNS"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
+34
-38
@@ -121,52 +121,48 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
const { query, req, res } = ctx;
|
const { query, req, res } = ctx;
|
||||||
console.log("query-", query);
|
console.log("query-", query);
|
||||||
|
|
||||||
let isLinked =
|
let isLinked =
|
||||||
typeof query.lk != "undefined" && query.lk == "1"
|
typeof query.lk != "undefined" && query.lk == "1" ? true : false;
|
||||||
? true
|
|
||||||
: false;
|
|
||||||
|
|
||||||
//console.log("is linked:", isLinked);
|
//console.log("is linked:", isLinked);
|
||||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||||
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
||||||
store.dispatch(setShowReps(showReps));
|
store.dispatch(setShowReps(showReps, showLoginCheck));
|
||||||
|
|
||||||
let searchResultsObj = await getBasicSearch(query.q);
|
let searchResultsObj = await getBasicSearch(query.q);
|
||||||
|
|
||||||
searchResultsObj =
|
searchResultsObj =
|
||||||
searchResultsObj.status == 502
|
searchResultsObj.status == 502
|
||||||
? {
|
? {
|
||||||
value: [],
|
value: [],
|
||||||
errorCode: searchResultsObj.status,
|
errorCode: searchResultsObj.status,
|
||||||
errorMsg: searchResultsObj.statusText,
|
errorMsg: searchResultsObj.statusText,
|
||||||
}
|
}
|
||||||
: searchResultsObj;
|
: searchResultsObj;
|
||||||
|
|
||||||
if (_.has(searchResultsObj, "status") == true) {
|
|
||||||
return {
|
|
||||||
redirect: {
|
|
||||||
//destination: "/dns-not-found",
|
|
||||||
destination: "/error",
|
|
||||||
permanent: false,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
const searchDetailsObj = await getSearchDetails(
|
|
||||||
searchResultsObj
|
|
||||||
);
|
|
||||||
|
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
|
||||||
store.dispatch(setSearch(query.q));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (_.has(searchResultsObj, "status") == true) {
|
||||||
return {
|
return {
|
||||||
props: {
|
redirect: {
|
||||||
isLinkedCase: isLinked,
|
//destination: "/dns-not-found",
|
||||||
showLoginCheck: showLoginCheck,
|
destination: "/error",
|
||||||
|
permanent: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||||
|
|
||||||
|
store.dispatch(setSearchResults(searchResultsObj));
|
||||||
|
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
|
store.dispatch(setSearch(query.q));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
isLinkedCase: isLinked,
|
||||||
|
showLoginCheck: showLoginCheck,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-1
@@ -127,7 +127,7 @@ const makeStore = ({ isServer }) => {
|
|||||||
key: "acp",
|
key: "acp",
|
||||||
whitelist: [
|
whitelist: [
|
||||||
"currentView",
|
"currentView",
|
||||||
"searchResultsObj",
|
//"searchResultsObj",
|
||||||
"appealType",
|
"appealType",
|
||||||
"LPAData",
|
"LPAData",
|
||||||
"accountDetails",
|
"accountDetails",
|
||||||
|
|||||||
Reference in New Issue
Block a user