Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-bao committed Feb 26, 2024
1 parent d272030 commit f80a147
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 2 additions & 0 deletions service/src/test/3.view.globalHrhDedupes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const styles = {
const wrap = (text:string)=>text.length>80?text.slice(0,80)+'...':text

const Tab = styled(MuiTab)<TabProps>(()=>({
fontSize: '0.85rem',
fontSize: '0.93rem',
textTransform: 'none'
}))
export function MechanismTabs({selectedMechanism, mechanisms, onMechanismSelect}:{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()<value2.toLocaleLowerCase()?-1:1
})
return sortedValues.join(', ')
}
export function getAggregateInfo(mechanisms: MechanismInfo[]):MechanismInfo{
Expand Down
Empty file.

This file was deleted.

9 changes: 6 additions & 3 deletions view/src/modules/viewPage/services/getViewPageData.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ function parseUrlData():UrlData{
export async function getViewPageData():Promise<ViewPageModel>{
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,
Expand Down

0 comments on commit f80a147

Please sign in to comment.