Skip to content

Commit

Permalink
layout endpoints in swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamDawidKrol committed Mar 5, 2024
1 parent a2b42a5 commit d627cd2
Showing 1 changed file with 183 additions and 0 deletions.
183 changes: 183 additions & 0 deletions src/swagger/dashboard-swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,136 @@
}
}
}
},
"/api/dashboard/{dashboardId}/layout": {
"post": {
"tags": ["Dashboard"],
"summary": "Add a layout item to a specific dashboard",
"description": "Endpoint for adding a layout item to a specific dashboard by its ID.",
"parameters": [
{
"name": "dashboardId",
"in": "path",
"description": "Unique ID of the dashboard",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "layoutItemData",
"description": "Layout item data to add",
"required": true,
"schema": {
"$ref": "#/definitions/LayoutItemInput"
}
}
],
"responses": {
"201": {
"description": "Layout item added to dashboard"
},
"500": {
"description": "Internal server error"
}
}
},
"get": {
"tags": ["Dashboard"],
"summary": "Get layout items from a specific dashboard",
"description": "Endpoint for retrieving all layout items from a specific dashboard by its ID.",
"parameters": [
{
"name": "dashboardId",
"in": "path",
"description": "Unique ID of the dashboard",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "List of layout items retrieved",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/LayoutItem"
}
}
},
"500": {
"description": "Internal server error"
}
}
}
},
"/api/dashboard/{dashboardId}/layout/{layoutItemId}": {
"put": {
"tags": ["Dashboard"],
"summary": "Update a layout item in a specific dashboard",
"description": "Endpoint for updating a layout item in a specific dashboard by its ID.",
"parameters": [
{
"name": "dashboardId",
"in": "path",
"description": "Unique ID of the dashboard",
"required": true,
"type": "string"
},
{
"name": "layoutItemId",
"in": "path",
"description": "Unique ID of the layout item to update",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "layoutItemData",
"description": "Updated layout item data",
"required": true,
"schema": {
"$ref": "#/definitions/LayoutItemInput"
}
}
],
"responses": {
"200": {
"description": "Layout item updated in dashboard"
},
"500": {
"description": "Internal server error"
}
}
},
"delete": {
"tags": ["Dashboard"],
"summary": "Remove a layout item from a specific dashboard",
"description": "Endpoint for removing a layout item from a specific dashboard by its ID.",
"parameters": [
{
"name": "dashboardId",
"in": "path",
"description": "Unique ID of the dashboard",
"required": true,
"type": "string"
},
{
"name": "layoutItemId",
"in": "path",
"description": "Unique ID of the layout item to remove",
"required": true,
"type": "string"
}
],
"responses": {
"202": {
"description": "Layout item removed from dashboard"
},
"500": {
"description": "Internal server error"
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -657,6 +787,59 @@
"enum": ["date_picker", "select", "multiselect", "checkbox", "radio"]
}
}
},
"LayoutItem": {
"type": "object",
"required": ["elementId", "x", "y", "w", "h"],
"properties": {
"elementId": {
"type": "string"
},
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"w": {
"type": "number"
},
"h": {
"type": "number"
},
"static": {
"type": "boolean"
}
}
},
"LayoutItemInput": {
"type": "object",
"properties": {
"elementId": {
"type": "string",
"description": "Unique ID of the element associated with this layout item (if applicable)"
},
"x": {
"type": "number",
"description": "The x coordinate of the layout item on the dashboard grid"
},
"y": {
"type": "number",
"description": "The y coordinate of the layout item on the dashboard grid"
},
"w": {
"type": "number",
"description": "The width of the layout item on the dashboard grid"
},
"h": {
"type": "number",
"description": "The height of the layout item on the dashboard grid"
},
"static": {
"type": "boolean",
"description": "Indicates whether the layout item is static (not movable or resizable)"
}
}
}
}
}

0 comments on commit d627cd2

Please sign in to comment.