diff --git a/service/src/test/3.view.globalHrhDedupes.test.ts b/service/src/test/3.view.globalHrhDedupes.test.ts index 4e930fc..d1558fd 100644 --- a/service/src/test/3.view.globalHrhDedupes.test.ts +++ b/service/src/test/3.view.globalHrhDedupes.test.ts @@ -36,4 +36,6 @@ test(`3 > HRH > Global > 3 selected dedupes`, async () => { // 3 results expect(mechanisms.length).toBe(3) + expect(mechanisms[0].info.partnerName).toBe('Dedupe adjustments Partner') + expect(mechanisms[0].info.agency).toBe('Dedupe adjustments Agency') }) \ No newline at end of file diff --git a/view/src/modules/preview/components/mechanismTabs.component.tsx b/view/src/modules/preview/components/mechanismTabs.component.tsx index a0c7a24..3a61310 100644 --- a/view/src/modules/preview/components/mechanismTabs.component.tsx +++ b/view/src/modules/preview/components/mechanismTabs.component.tsx @@ -25,7 +25,7 @@ const styles = { const wrap = (text:string)=>text.length>80?text.slice(0,80)+'...':text const Tab = styled(MuiTab)(()=>({ - fontSize: '0.85rem', + fontSize: '0.93rem', textTransform: 'none' })) export function MechanismTabs({selectedMechanism, mechanisms, onMechanismSelect}:{ diff --git a/view/src/modules/preview/services/getAggregateInfo.service.ts b/view/src/modules/preview/services/getAggregateInfo.service.ts index 31968aa..8839df7 100644 --- a/view/src/modules/preview/services/getAggregateInfo.service.ts +++ b/view/src/modules/preview/services/getAggregateInfo.service.ts @@ -9,7 +9,9 @@ function aggregateValue(mechanisms: MechanismInfo[], key: keyof MechanismInfo): const uniqueValues = [...new Set(values)] let sortedValues:string[] = null if (key==='code') sortedValues = uniqueValues.sort(sortByCode) - else sortedValues = uniqueValues.sort() + else sortedValues = uniqueValues.sort(function(value1, value2){ + return value1.toLocaleLowerCase(){ - let ou = ''; - if (mechanismsMetadata.map(({ou})=>ou).every(ouId => ouId === mechanismsMetadata[0].ou)) ou = `&ouFilter=${mechanismsMetadata[0].ou}` - const approvalsData = await fetch(`/api/dataApprovals/categoryOptionCombos?wf=${workflowId}&pe=${periodId}${ou}`).then(res => res.json()) - console.log(approvalsData) - return ApprovalStatus.acceptedByAgency -} \ No newline at end of file diff --git a/view/src/modules/viewPage/services/getViewPageData.service.ts b/view/src/modules/viewPage/services/getViewPageData.service.ts index 445041b..aaefa3e 100644 --- a/view/src/modules/viewPage/services/getViewPageData.service.ts +++ b/view/src/modules/viewPage/services/getViewPageData.service.ts @@ -26,14 +26,17 @@ function parseUrlData():UrlData{ export async function getViewPageData():Promise{ const {selectedFilters, mechanismIds} = parseUrlData() const {mechanisms} = await searchMechanisms(selectedFilters, mechanismIds.length<30&&mechanismIds) - // const filteredMechanisms:Mechanism[] = mechanisms.filter(({identifiers: {approvalsId}, selectedFilters:{ouId}})=>{ - // return mechanismIds.map(({ou, approvalsId})=>`${ou}.${approvalsId}`).includes(`${ouId}.${approvalsId}`) - // }) const filteredMechanisms:Mechanism[] = mechanisms.filter(({identifiers: {approvalsId, ouId}})=>{ return mechanismIds.map(({ou, approvalsId})=>`${ou}.${approvalsId}`).includes(`${ouId}.${approvalsId}`) }) + filteredMechanisms.sort(function(mechanism1:Mechanism, mechanism2:Mechanism){ + return mechanism1.info.code>mechanism2.info.code?1:-1 + }) + + filteredMechanisms.filter(({info:{code}})=>code!=='000000').forEach(({info})=>info.ouName='N/A') + const state:MechanismState = { approvalStatus: filteredMechanisms[0].state.approvalStatus, possibleActions: filteredMechanisms[0].state.possibleActions,