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