Skip to content

Commit

Permalink
Add support for direct and indirect sources of spend
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq committed Sep 11, 2024
1 parent 14ba42a commit d1486d0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
16 changes: 16 additions & 0 deletions locales/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,14 @@
}
]
},
"direct": {
"value": [
{
"type": 0,
"value": "Direct"
}
]
},
"embedded": {
"value": [
{
Expand All @@ -1303,6 +1311,14 @@
}
]
},
"indirect": {
"value": [
{
"type": 0,
"value": "Indirect"
}
]
},
"miscellaneous": {
"value": [
{
Expand Down
2 changes: 1 addition & 1 deletion locales/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"percent": "{value} %",
"secondaryGroupByLabel": "Secondary group by",
"sourceOfSpendLabel": "View",
"sourceOfSpendValues": "{value, select, all {All sources of spend} aws {Amazon Web Services} azure {Azure} ccsp {CCSP} consulting {Consulting} embedded {Embedded} gcp {Google Cloud Platform} miscellaneous {Miscellaneous} oci {Oracle Cloud Infrastructure} oem {OEM} on_demand {On-demand subscriptions} svp {SVP} training {Training} yearly_subscriptions {Yearly subscriptions} other {}}",
"sourceOfSpendValues": "{value, select, all {All sources of spend} aws {Amazon Web Services} azure {Azure} ccsp {CCSP} consulting {Consulting} direct {Direct} embedded {Embedded} gcp {Google Cloud Platform} indirect {Indirect} miscellaneous {Miscellaneous} oci {Oracle Cloud Infrastructure} oem {OEM} on_demand {On-demand subscriptions} svp {SVP} training {Training} yearly_subscriptions {Yearly subscriptions} other {}}",
"suggestions": "Suggestions",
"viewDetails": "View details"
}
2 changes: 2 additions & 0 deletions src/locales/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,10 @@ export default defineMessages({
'azure {Azure} ' +
'ccsp {CCSP} ' +
'consulting {Consulting} ' +
'direct {Direct} ' +
'embedded {Embedded} ' +
'gcp {Google Cloud Platform} ' +
'indirect {Indirect} ' +
'miscellaneous {Miscellaneous} ' +
'oci {Oracle Cloud Infrastructure} ' +
'oem {OEM} ' +
Expand Down
8 changes: 7 additions & 1 deletion src/routes/details/DetailsHeaderToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const DetailsHeaderToolbar: React.FC<DetailsToolbarProps> = ({

if (options?.data?.source_of_spend) {
options.data.source_of_spend.forEach(item => {
switch (item.code) {
switch (item.code.toLowerCase()) {
case SourceOfSpendType.aws:
newOptions.push({ label: messages.sourceOfSpendValues, value: SourceOfSpendType.aws });
break;
Expand All @@ -205,12 +205,18 @@ const DetailsHeaderToolbar: React.FC<DetailsToolbarProps> = ({
case SourceOfSpendType.consulting:
newOptions.push({ label: messages.sourceOfSpendValues, value: SourceOfSpendType.consulting });
break;
case SourceOfSpendType.direct:
newOptions.push({ label: messages.sourceOfSpendValues, value: SourceOfSpendType.direct });
break;
case SourceOfSpendType.embedded:
newOptions.push({ label: messages.sourceOfSpendValues, value: SourceOfSpendType.embedded });
break;
case SourceOfSpendType.gcp:
newOptions.push({ label: messages.sourceOfSpendValues, value: SourceOfSpendType.gcp });
break;
case SourceOfSpendType.indirect:
newOptions.push({ label: messages.sourceOfSpendValues, value: SourceOfSpendType.indirect });
break;
case SourceOfSpendType.miscellaneous:
newOptions.push({ label: messages.sourceOfSpendValues, value: SourceOfSpendType.miscellaneous });
break;
Expand Down
2 changes: 2 additions & 0 deletions src/routes/details/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ export enum SourceOfSpendType {
azure = 'azure',
ccsp = 'ccsp',
consulting = 'consulting',
direct = 'direct',
embedded = 'embedded',
gcp = 'gcp',
indirect = 'indirect',
miscellaneous = 'miscellaneous',
none = 'none',
oci = 'oci',
Expand Down

0 comments on commit d1486d0

Please sign in to comment.