Skip to content

Commit

Permalink
Merge pull request #38 from dhis2/fix/status-tag-states
Browse files Browse the repository at this point in the history
fix(status-tag): remove unused status tag states and add APPROVED_ABOVE
  • Loading branch information
mediremi authored Aug 10, 2021
2 parents b6dcde7 + e175523 commit edee42c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
4 changes: 1 addition & 3 deletions src/shared/status-tag/get-tag-display-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ import { Approved, Ready, Waiting } from './icons.js'
const getTagDisplayData = approvalState => {
switch (approvalState) {
case 'APPROVED_HERE':
case 'APPROVED_ELSEWHERE':
case 'APPROVED_ABOVE':
return {
icon: Approved,
displayName: i18n.t('Approved'),
type: 'positive',
}

case 'ACCEPTED_HERE':
case 'ACCEPTED_ELSEWHERE':
return {
icon: Ready,
displayName: i18n.t('Ready for approval and accepted'),
Expand All @@ -36,7 +35,6 @@ const getTagDisplayData = approvalState => {
}

case 'UNAPPROVED_WAITING':
case 'UNAPPROVED_ELSEWHERE':
case 'UNAPPROVED_ABOVE':
return {
icon: Waiting,
Expand Down
10 changes: 1 addition & 9 deletions src/shared/status-tag/get-tag-display-data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ describe('getTagDisplayData', () => {
type: 'positive',
}
expect(getTagDisplayData('APPROVED_HERE')).toEqual(expectedDisplayData)
expect(getTagDisplayData('APPROVED_ELSEWHERE')).toEqual(
expectedDisplayData
)
expect(getTagDisplayData('APPROVED_ABOVE')).toEqual(expectedDisplayData)
})
it('returns "ready for approval and accepted" display data for the correct approval states', () => {
const expectedDisplayData = {
Expand All @@ -20,9 +18,6 @@ describe('getTagDisplayData', () => {
type: 'neutral',
}
expect(getTagDisplayData('ACCEPTED_HERE')).toEqual(expectedDisplayData)
expect(getTagDisplayData('ACCEPTED_ELSEWHERE')).toEqual(
expectedDisplayData
)
})
it('returns "ready for approval" display data for the correct approval states', () => {
const expectedDisplayData = {
Expand All @@ -43,9 +38,6 @@ describe('getTagDisplayData', () => {
expect(getTagDisplayData('UNAPPROVED_WAITING')).toEqual(
expectedDisplayData
)
expect(getTagDisplayData('UNAPPROVED_ELSEWHERE')).toEqual(
expectedDisplayData
)
expect(getTagDisplayData('UNAPPROVED_ABOVE')).toEqual(
expectedDisplayData
)
Expand Down
4 changes: 1 addition & 3 deletions src/shared/status-tag/status-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ const StatusTag = ({ approvalState }) => {
StatusTag.propTypes = {
approvalState: PropTypes.oneOf([
'APPROVED_HERE',
'APPROVED_ELSEWHERE',
'APPROVED_ABOVE',
'ACCEPTED_HERE',
'ACCEPTED_ELSEWHERE',
'UNAPPROVED_READY',
'UNAPPROVED_WAITING',
'UNAPPROVED_ELSEWHERE',
'UNAPPROVED_ABOVE',
'UNAPPROVABLE',
]),
Expand Down

0 comments on commit edee42c

Please sign in to comment.