passing media obj in myportal search
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
getPortalModuleDetails,
|
||||
getWatchedCases,
|
||||
getSIPSEvents,
|
||||
getSIPSMedia,
|
||||
} from "../../../actions";
|
||||
import { getFormCollectionByID } from "../../../components/utils";
|
||||
|
||||
@@ -42,6 +43,7 @@ import {
|
||||
setSearchDetails,
|
||||
setSearchResults,
|
||||
setEventDetails,
|
||||
setMediaDetails,
|
||||
} from "../../../store/searchOutput/action";
|
||||
import { wrapper } from "../../../store/store";
|
||||
import {
|
||||
@@ -129,6 +131,7 @@ const CaseHome = (props) => {
|
||||
showFilteredDocs={props.showFilteredDocs}
|
||||
showMaps={props.showMaps}
|
||||
eventsObj={props.searchResultsObj.eventsObj}
|
||||
mediaObj={props.searchResultsObj.mediaObj}
|
||||
/>
|
||||
</div>
|
||||
<Footer
|
||||
@@ -200,13 +203,21 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||
|
||||
var eventsObj = {};
|
||||
var mediaObj = {};
|
||||
|
||||
if (searchResultsObj.value[0].pinswg_appealcasetype == 846040002) {
|
||||
eventsObj = await getSIPSEvents(
|
||||
searchDetailsObj[0].value[0].pinswg_sipsid
|
||||
searchDetailsObj[0].value[0].pinswg_sipsid,
|
||||
);
|
||||
store.dispatch(setEventDetails(eventsObj));
|
||||
}
|
||||
|
||||
if (searchResultsObj.value[0].pinswg_appealcasetype == 846040002) {
|
||||
mediaObj = await getSIPSMedia(
|
||||
searchDetailsObj[0].value[0].pinswg_sipsid,
|
||||
);
|
||||
store.dispatch(setMediaDetails(mediaObj));
|
||||
}
|
||||
//console.log(
|
||||
// "\n======================================\n",
|
||||
// searchResultsObj,
|
||||
@@ -251,7 +262,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
setCurrentView({
|
||||
"viewName": "Awaiting Submission",
|
||||
"viewKey": "awaitingSubmissionDetails",
|
||||
})
|
||||
}),
|
||||
);
|
||||
break;
|
||||
case "watchedCases":
|
||||
@@ -295,7 +306,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
setCurrentView({
|
||||
"viewName": "Watched Cases",
|
||||
"viewKey": "watchedCases",
|
||||
})
|
||||
}),
|
||||
);
|
||||
break;
|
||||
case "myCases":
|
||||
@@ -307,7 +318,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
const myCasesDetails = await getDetails(
|
||||
myCases,
|
||||
"myCases"
|
||||
"myCases",
|
||||
);
|
||||
store.dispatch(setMyCases(myCases));
|
||||
store.dispatch(setMyCasesDetails(myCasesDetails));
|
||||
@@ -315,32 +326,32 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
setCurrentView({
|
||||
"viewName": "My Cases",
|
||||
"viewKey": "myCases",
|
||||
})
|
||||
}),
|
||||
);
|
||||
break;
|
||||
case "myRepresentations":
|
||||
const myRepresentations = await getRepsFromBlob(
|
||||
thisSession.user.id
|
||||
thisSession.user.id,
|
||||
);
|
||||
|
||||
const myRepresentationsDetails = await getDetails(
|
||||
myRepresentations,
|
||||
"myRepresentations"
|
||||
"myRepresentations",
|
||||
);
|
||||
|
||||
store.dispatch(
|
||||
setMyRepresentations(myRepresentations)
|
||||
setMyRepresentations(myRepresentations),
|
||||
);
|
||||
store.dispatch(
|
||||
setMyRepresentationsDetails(
|
||||
myRepresentationsDetails
|
||||
)
|
||||
myRepresentationsDetails,
|
||||
),
|
||||
);
|
||||
store.dispatch(
|
||||
setCurrentView({
|
||||
"viewName": "My Representations",
|
||||
"viewKey": "myRepresentations",
|
||||
})
|
||||
}),
|
||||
);
|
||||
default:
|
||||
// code block
|
||||
@@ -364,7 +375,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
const watchedCasesDetails = await getDetails(
|
||||
filteredWatchedCases,
|
||||
"myWatchedCases"
|
||||
"myWatchedCases",
|
||||
);
|
||||
|
||||
store.dispatch(setWatchedCases(filteredWatchedCases));
|
||||
@@ -390,7 +401,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
searchDetailsObj[0].value[0]
|
||||
.pinswg_specialistcaseprocess
|
||||
: "",
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -403,17 +414,18 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
searchResultsObj: searchResultsObj,
|
||||
searchDetailsObj: searchDetailsObj,
|
||||
eventsObj: eventsObj,
|
||||
mediaObj: mediaObj,
|
||||
},
|
||||
currentType: "directResultsObj",
|
||||
docsOffline: process.env.DOCAPI_OFFLINE || false,
|
||||
messagesObj: await getCaseMessage(
|
||||
searchResultsObj.value[0].incidentid
|
||||
searchResultsObj.value[0].incidentid,
|
||||
),
|
||||
showFilteredDocs: process.env.SHOWFILTERDOCS || false,
|
||||
showMaps: process.env.SHOWMAPS,
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const getDetails = (resultsObj, detailsType) => {
|
||||
@@ -449,9 +461,9 @@ const getDetails = (resultsObj, detailsType) => {
|
||||
return getPortalModuleDetails(
|
||||
getFormCollectionByID(data.pinswg_appealcasetype)
|
||||
.LogicalCollectionName,
|
||||
caseID
|
||||
caseID,
|
||||
);
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -487,13 +499,13 @@ const getDetails = (resultsObj, detailsType) => {
|
||||
getPortalModuleDetails(
|
||||
getFormCollectionByID(searchDetail.pinswg_appealcasetype)
|
||||
.LogicalCollectionName,
|
||||
caseID
|
||||
caseID,
|
||||
// detailsType != "myWatchedCases"
|
||||
// ? searchDetail.ticketnumber
|
||||
// : searchDetail[
|
||||
// "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
// ]
|
||||
)
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user