Skip to content

Commit 44eb29e

Browse files
authored
Merge pull request #3958 from dlabrecq/filename
Update filename for AWS export
2 parents eb92acc + 7dde3d9 commit 44eb29e

File tree

5 files changed

+69
-7
lines changed

5 files changed

+69
-7
lines changed

locales/data.json

+61
Original file line numberDiff line numberDiff line change
@@ -4896,6 +4896,67 @@
48964896
}
48974897
]
48984898
},
4899+
"resource_id": {
4900+
"value": [
4901+
{
4902+
"options": {
4903+
"daily": {
4904+
"value": [
4905+
{
4906+
"type": 1,
4907+
"value": "provider"
4908+
},
4909+
{
4910+
"type": 0,
4911+
"value": "_resources_daily_"
4912+
},
4913+
{
4914+
"type": 1,
4915+
"value": "startDate"
4916+
},
4917+
{
4918+
"type": 0,
4919+
"value": "_"
4920+
},
4921+
{
4922+
"type": 1,
4923+
"value": "endDate"
4924+
}
4925+
]
4926+
},
4927+
"monthly": {
4928+
"value": [
4929+
{
4930+
"type": 1,
4931+
"value": "provider"
4932+
},
4933+
{
4934+
"type": 0,
4935+
"value": "_resources_monthly_"
4936+
},
4937+
{
4938+
"type": 1,
4939+
"value": "startDate"
4940+
},
4941+
{
4942+
"type": 0,
4943+
"value": "_"
4944+
},
4945+
{
4946+
"type": 1,
4947+
"value": "endDate"
4948+
}
4949+
]
4950+
},
4951+
"other": {
4952+
"value": []
4953+
}
4954+
},
4955+
"type": 5,
4956+
"value": "resolution"
4957+
}
4958+
]
4959+
},
48994960
"resource_location": {
49004961
"value": [
49014962
{

locales/translations.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
"exportAll": "Export all",
299299
"exportDesc": "The active selections from the table plus the values here will be used to generate an export file. When the file is available, download it from the {value} view.",
300300
"exportError": "Something went wrong, please try fewer selections",
301-
"exportFileName": "{groupBy, select, account {{resolution, select, daily {{provider}_accounts_daily_{startDate}_{endDate}} monthly {{provider}_accounts_monthly_{startDate}_{endDate}} other {}}} aws_category {{resolution, select, daily {{provider}_cost_category_daily_{startDate}_{endDate}} monthly {{provider}_cost_category_monthly_{startDate}_{endDate}} other {}}} cluster {{resolution, select, daily {{provider}_clusters_daily_{startDate}_{endDate}} monthly {{provider}_clusters_monthly_{startDate}_{endDate}} other {}}} gcp_project {{resolution, select, daily {{provider}_gcp-projects_daily_{startDate}_{endDate}} monthly {{provider}_gcp-projects_monthly_{startDate}_{endDate}} other {}}} instance {{resolution, select, daily {{provider}_instances_daily_{startDate}_{endDate}} monthly {{provider}_instances_monthly_{startDate}_{endDate}} other {}}} node {{resolution, select, daily {{provider}_node_daily_{startDate}_{endDate}} monthly {{provider}_node_monthly_{startDate}_{endDate}} other {}}} org_unit_id {{resolution, select, daily {{provider}_orgs_daily_{startDate}_{endDate}} monthly {{provider}_orgs_monthly_{startDate}_{endDate}} other {}}} payer_tenant_id {{resolution, select, daily {{provider}_accounts_daily_{startDate}_{endDate}} monthly {{provider}_accounts_monthly_{startDate}_{endDate}} other {}}} product_service {{resolution, select, daily {{provider}_services_daily_{startDate}_{endDate}} monthly {{provider}_services_monthly_{startDate}_{endDate}} other {}}} project {{resolution, select, daily {{provider}_projects_daily_{startDate}_{endDate}} monthly {{provider}_projects_monthly_{startDate}_{endDate}} other {}}} region {{resolution, select, daily {{provider}_regions_daily_{startDate}_{endDate}} monthly {{provider}_regions_monthly_{startDate}_{endDate}} other {}}} resource_location {{resolution, select, daily {{provider}_regions_daily_{startDate}_{endDate}} monthly {{provider}_regions_monthly_{startDate}_{endDate}} other {}}} service {{resolution, select, daily {{provider}_services_daily_{startDate}_{endDate}} monthly {{provider}_services_monthly_{startDate}_{endDate}} other {}}} service_name {{resolution, select, daily {{provider}_services_daily_{startDate}_{endDate}} monthly {{provider}_services_monthly_{startDate}_{endDate}} other {}}} subscription_guid {{resolution, select, daily {{provider}_accounts_daily_{startDate}_{endDate}} monthly {{provider}_accounts_monthly_{startDate}_{endDate}} other {}}} tag {{resolution, select, daily {{provider}_tags_daily_{startDate}_{endDate}} monthly {{provider}_tags_monthly_{startDate}_{endDate}} other {}}} other {}}",
301+
"exportFileName": "{groupBy, select, account {{resolution, select, daily {{provider}_accounts_daily_{startDate}_{endDate}} monthly {{provider}_accounts_monthly_{startDate}_{endDate}} other {}}} aws_category {{resolution, select, daily {{provider}_cost_category_daily_{startDate}_{endDate}} monthly {{provider}_cost_category_monthly_{startDate}_{endDate}} other {}}} cluster {{resolution, select, daily {{provider}_clusters_daily_{startDate}_{endDate}} monthly {{provider}_clusters_monthly_{startDate}_{endDate}} other {}}} gcp_project {{resolution, select, daily {{provider}_gcp-projects_daily_{startDate}_{endDate}} monthly {{provider}_gcp-projects_monthly_{startDate}_{endDate}} other {}}} instance {{resolution, select, daily {{provider}_instances_daily_{startDate}_{endDate}} monthly {{provider}_instances_monthly_{startDate}_{endDate}} other {}}} node {{resolution, select, daily {{provider}_node_daily_{startDate}_{endDate}} monthly {{provider}_node_monthly_{startDate}_{endDate}} other {}}} org_unit_id {{resolution, select, daily {{provider}_orgs_daily_{startDate}_{endDate}} monthly {{provider}_orgs_monthly_{startDate}_{endDate}} other {}}} payer_tenant_id {{resolution, select, daily {{provider}_accounts_daily_{startDate}_{endDate}} monthly {{provider}_accounts_monthly_{startDate}_{endDate}} other {}}} product_service {{resolution, select, daily {{provider}_services_daily_{startDate}_{endDate}} monthly {{provider}_services_monthly_{startDate}_{endDate}} other {}}} project {{resolution, select, daily {{provider}_projects_daily_{startDate}_{endDate}} monthly {{provider}_projects_monthly_{startDate}_{endDate}} other {}}} region {{resolution, select, daily {{provider}_regions_daily_{startDate}_{endDate}} monthly {{provider}_regions_monthly_{startDate}_{endDate}} other {}}} resource_id {{resolution, select, daily {{provider}_resources_daily_{startDate}_{endDate}} monthly {{provider}_resources_monthly_{startDate}_{endDate}} other {}}} resource_location {{resolution, select, daily {{provider}_regions_daily_{startDate}_{endDate}} monthly {{provider}_regions_monthly_{startDate}_{endDate}} other {}}} service {{resolution, select, daily {{provider}_services_daily_{startDate}_{endDate}} monthly {{provider}_services_monthly_{startDate}_{endDate}} other {}}} service_name {{resolution, select, daily {{provider}_services_daily_{startDate}_{endDate}} monthly {{provider}_services_monthly_{startDate}_{endDate}} other {}}} subscription_guid {{resolution, select, daily {{provider}_accounts_daily_{startDate}_{endDate}} monthly {{provider}_accounts_monthly_{startDate}_{endDate}} other {}}} tag {{resolution, select, daily {{provider}_tags_daily_{startDate}_{endDate}} monthly {{provider}_tags_monthly_{startDate}_{endDate}} other {}}} other {}}",
302302
"exportFormatType": "{value, select, csv {CSV} json {JSON} other {}}",
303303
"exportFormatTypeTitle": "Format type",
304304
"exportGenerate": "Generate export",

src/locales/messages.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,7 @@ export default defineMessages({
17691769
'product_service {{resolution, select, daily {{provider}_services_daily_{startDate}_{endDate}} monthly {{provider}_services_monthly_{startDate}_{endDate}} other {}}} ' +
17701770
'project {{resolution, select, daily {{provider}_projects_daily_{startDate}_{endDate}} monthly {{provider}_projects_monthly_{startDate}_{endDate}} other {}}} ' +
17711771
'region {{resolution, select, daily {{provider}_regions_daily_{startDate}_{endDate}} monthly {{provider}_regions_monthly_{startDate}_{endDate}} other {}}} ' +
1772+
'resource_id {{resolution, select, daily {{provider}_resources_daily_{startDate}_{endDate}} monthly {{provider}_resources_monthly_{startDate}_{endDate}} other {}}} ' +
17721773
'resource_location {{resolution, select, daily {{provider}_regions_daily_{startDate}_{endDate}} monthly {{provider}_regions_monthly_{startDate}_{endDate}} other {}}} ' +
17731774
'service {{resolution, select, daily {{provider}_services_daily_{startDate}_{endDate}} monthly {{provider}_services_monthly_{startDate}_{endDate}} other {}}} ' +
17741775
'service_name {{resolution, select, daily {{provider}_services_daily_{startDate}_{endDate}} monthly {{provider}_services_monthly_{startDate}_{endDate}} other {}}} ' +

src/routes/components/export/exportSubmit.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ const mapStateToProps = createMapStateToProps<ExportSubmitOwnProps, ExportSubmit
165165
const isPrevious = timeScope === 'previous';
166166
const queryFromRoute = parseQuery<Query>(router.location.search);
167167
const getDateRange = () => {
168-
if (isTimeScoped) {
169-
return {};
170-
}
171168
if (queryFromRoute.dateRangeType) {
172169
return getDateRangeFromQuery(queryFromRoute);
173170
} else {
@@ -200,8 +197,10 @@ const mapStateToProps = createMapStateToProps<ExportSubmitOwnProps, ExportSubmit
200197
limit: 0, // No limit to number of items returned
201198
offset: undefined,
202199
order_by: undefined, // Don't want items sorted by cost
203-
start_date,
204-
end_date,
200+
...(!isTimeScoped && {
201+
start_date,
202+
end_date,
203+
}),
205204
};
206205

207206
// Store filter_by as an array, so we can add to it below

src/routes/details/awsBreakdown/instances/instances.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,15 @@ const Instances: React.FC<InstancesProps> = ({ currency }) => {
128128
<ExportModal
129129
count={isAllSelected ? itemsTotal : items.length}
130130
isAllItems={(isAllSelected || selectedItems.length === itemsTotal) && computedItems.length > 0}
131-
groupBy="instance"
131+
groupBy="resource_id"
132132
isOpen={isExportModalOpen}
133133
isTimeScoped
134134
items={items}
135135
onClose={handleOnExportModalClose}
136136
reportPathsType={reportPathsType}
137137
reportQueryString={reportQueryString}
138138
reportType={reportType}
139+
showAggregateType={false}
139140
/>
140141
);
141142
};

0 commit comments

Comments
 (0)