Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "8001cbb",
"generated": "2025-08-13 20:27:09.207"
"spec_repo_commit": "095be0d",
"generated": "2025-08-13 22:40:11.170"
}
29 changes: 24 additions & 5 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3445,14 +3445,33 @@ components:
description: The view of the world that the map should render.
example:
focus: WORLD
properties:
oneOf:
- required:
- focus
- required:
- custom_extent
properties:
custom_extent:
description: A custom extent of the map defined by an array of four numbers
in the order `[minLongitude, minLatitude, maxLongitude, maxLatitude]`.
example:
- -30
- -40
- 40
- 30
items:
description: The longitudinal or latitudinal coordinates of the bounding
box.
format: double
type: number
maxItems: 4
minItems: 4
type: array
focus:
description: The 2-letter ISO code of a country to focus the map on. Or
`WORLD`.
description: The ISO code of a country, subdivision, or region to focus
the map on. Or `WORLD`. Mutually exclusive with `custom_extent`.
example: WORLD
type: string
required:
- focus
type: object
GeomapWidgetRequest:
description: An updated geomap widget.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2025-08-13T22:21:29.993Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"log": {
"_recordingName": "Dashboards/Create a new dashboard with geomap widget in custom focus",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "6b17b4af82cf16ce8c4a879dbc8a1863",
"_order": 0,
"cache": {},
"request": {
"bodySize": 796,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
},
{
"_fromType": "array",
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 559,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"description\":null,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_geomap_widget_in_custom_focus-1755123689\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"rum\",\"group_by\":[{\"facet\":\"@geo.country_iso_code\",\"limit\":250,\"sort\":{\"aggregation\":\"count\",\"order\":\"desc\"}}],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"\"}}],\"response_format\":\"scalar\",\"sort\":{\"count\":250,\"order_by\":[{\"index\":0,\"order\":\"desc\",\"type\":\"formula\"}]}}],\"style\":{\"palette\":\"hostmap_blues\",\"palette_flip\":false},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"geomap\",\"view\":{\"custom_extent\":[-30,-40,40,30]}},\"layout\":{\"height\":30,\"width\":47,\"x\":0,\"y\":0}}]}"
},
"queryString": [],
"url": "https://api.datadoghq.com/api/v1/dashboard"
},
"response": {
"bodySize": 1111,
"content": {
"mimeType": "application/json",
"size": 1111,
"text": "{\"id\":\"ift-hah-kbn\",\"title\":\"Test-Create_a_new_dashboard_with_geomap_widget_in_custom_focus-1755123689\",\"description\":null,\"author_handle\":\"[email protected]\",\"author_name\":\"frog\",\"layout_type\":\"free\",\"url\":\"/dashboard/ift-hah-kbn/test-createanewdashboardwithgeomapwidgetincustomfocus-1755123689\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"rum\",\"group_by\":[{\"facet\":\"@geo.country_iso_code\",\"limit\":250,\"sort\":{\"aggregation\":\"count\",\"order\":\"desc\"}}],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"\"}}],\"response_format\":\"scalar\",\"sort\":{\"count\":250,\"order_by\":[{\"index\":0,\"order\":\"desc\",\"type\":\"formula\"}]}}],\"style\":{\"palette\":\"hostmap_blues\",\"palette_flip\":false},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"geomap\",\"view\":{\"custom_extent\":[-30,-40,40,30]}},\"layout\":{\"height\":30,\"width\":47,\"x\":0,\"y\":0},\"id\":7638192239577908}],\"notify_list\":[],\"created_at\":\"2025-08-13T22:21:30.205019+00:00\",\"modified_at\":\"2025-08-13T22:21:30.205019+00:00\",\"restricted_roles\":[]}\n"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 689,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2025-08-13T22:21:29.996Z",
"time": 287
},
{
"_id": "0a9f5ca2ea43d1dd545ba37fce11ce6a",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
}
],
"headersSize": 520,
"httpVersion": "HTTP/1.1",
"method": "DELETE",
"queryString": [],
"url": "https://api.datadoghq.com/api/v1/dashboard/ift-hah-kbn"
},
"response": {
"bodySize": 39,
"content": {
"mimeType": "application/json",
"size": 39,
"text": "{\"deleted_dashboard_id\":\"ift-hah-kbn\"}\n"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 687,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2025-08-13T22:21:30.290Z",
"time": 205
}
],
"pages": [],
"version": "1.2"
}
}
11 changes: 11 additions & 0 deletions features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,17 @@ Feature: Dashboards
And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "formula"
And the response "widgets[0].definition.requests[0].sort.order_by[0].index" is equal to 0

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with geomap widget in custom focus
Given new "CreateDashboard" request
And body from file "dashboards_json_payload/geomap_widget_in_custom_focus.json"
When the request is sent
Then the response status is 200 OK
And the response "widgets[0].definition.type" is equal to "geomap"
And the response "widgets[0].definition.requests[0].sort.order_by[0].order" is equal to "desc"
And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "formula"
And the response "widgets[0].definition.requests[0].sort.order_by[0].index" is equal to 0

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with heatmap widget
Given new "CreateDashboard" request
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"title":"{{ unique }}",
"description":null,
"widgets":[
{
"layout":{
"x":0,
"y":0,
"width":47,
"height":30
},
"definition":{
"title":"",
"title_size":"16",
"title_align":"left",
"time":{

},
"type":"geomap",
"requests":[
{
"formulas":[
{
"formula":"query1"
}
],
"queries":[
{
"name":"query1",
"data_source":"rum",
"search":{
"query":""
},
"indexes":[
"*"
],
"compute":{
"aggregation":"count"
},
"group_by":[
{
"facet":"@geo.country_iso_code",
"limit":250,
"sort":{
"order":"desc",
"aggregation":"count"
}
}
]
}
],
"sort": {
"count":250,
"order_by":[
{
"type":"formula",
"index":0,
"order":"desc"
}
]
},
"response_format":"scalar"
}
],
"style":{
"palette":"hostmap_blues",
"palette_flip":false
},
"view":{
"custom_extent":[-30, -40, 40, 30]
}
}
}
],
"template_variables":[

],
"layout_type":"free",
"notify_list":[

]
}
14 changes: 11 additions & 3 deletions services/dashboards/src/v1/models/GeomapWidgetDefinitionView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client";
*/
export class GeomapWidgetDefinitionView {
/**
* The 2-letter ISO code of a country to focus the map on. Or `WORLD`.
* A custom extent of the map defined by an array of four numbers in the order `[minLongitude, minLatitude, maxLongitude, maxLatitude]`.
*/
"focus": string;
"customExtent"?: [number, number, number, number];
/**
* The ISO code of a country, subdivision, or region to focus the map on. Or `WORLD`. Mutually exclusive with `custom_extent`.
*/
"focus"?: string;
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
Expand All @@ -23,10 +27,14 @@ export class GeomapWidgetDefinitionView {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
customExtent: {
baseName: "custom_extent",
type: "[number, number, number, number]",
format: "double",
},
focus: {
baseName: "focus",
type: "string",
required: true,
},
additionalProperties: {
baseName: "additionalProperties",
Expand Down