Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/layout swagger endpoints #8

Merged
Merged
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
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)"
}
}
}
}
}