Implement maintenance view (#235)

* implement backend to query maintenances

* improve backend API for maintenances

* add itemId and itemName (v1/maintenances)

* fix remaining todo in backend (/v1/maintenances)

* refactor: extract MaintenanceEditModal

* first draft (to be cleaned)

* revert dependency updates (not required)

* translation + fix deletion

* fix main menu css issues

* fix main menu "create" button (css)

* enhancement: make item name clickable

* fix: add page title (+ translate existing ones)

* fix: missing toast translation (when updating)

* bug fix: missing group check in backend (for new endpoint)

* backport from following PR (to avoid useless changes)

* maintenances => maintenance
This commit is contained in:
mcarbonne
2024-09-23 19:07:27 +02:00
committed by GitHub
parent 897f3842e0
commit a85c42b539
21 changed files with 1165 additions and 445 deletions

View File

@@ -910,7 +910,7 @@
"application/json"
],
"tags": [
"Maintenance"
"Item Maintenance"
],
"summary": "Get Maintenance Log",
"responses": {
@@ -932,7 +932,7 @@
"application/json"
],
"tags": [
"Maintenance"
"Item Maintenance"
],
"summary": "Create Maintenance Entry",
"parameters": [
@@ -956,60 +956,6 @@
}
}
},
"/v1/items/{id}/maintenance/{entry_id}": {
"put": {
"security": [
{
"Bearer": []
}
],
"produces": [
"application/json"
],
"tags": [
"Maintenance"
],
"summary": "Update Maintenance Entry",
"parameters": [
{
"description": "Entry Data",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/repo.MaintenanceEntryUpdate"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/repo.MaintenanceEntry"
}
}
}
},
"delete": {
"security": [
{
"Bearer": []
}
],
"produces": [
"application/json"
],
"tags": [
"Maintenance"
],
"summary": "Delete Maintenance Entry",
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/v1/items/{id}/path": {
"get": {
"security": [
@@ -1402,6 +1348,104 @@
}
}
},
"/v1/maintenance": {
"get": {
"security": [
{
"Bearer": []
}
],
"produces": [
"application/json"
],
"tags": [
"Maintenance"
],
"summary": "Query All Maintenance",
"parameters": [
{
"enum": [
"scheduled",
"completed",
"both"
],
"type": "string",
"x-enum-varnames": [
"MaintenanceFilterStatusScheduled",
"MaintenanceFilterStatusCompleted",
"MaintenanceFilterStatusBoth"
],
"name": "status",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/repo.MaintenanceEntryWithDetails"
}
}
}
}
}
},
"/v1/maintenance/{id}": {
"put": {
"security": [
{
"Bearer": []
}
],
"produces": [
"application/json"
],
"tags": [
"Maintenance"
],
"summary": "Update Maintenance Entry",
"parameters": [
{
"description": "Entry Data",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/repo.MaintenanceEntryUpdate"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/repo.MaintenanceEntry"
}
}
}
},
"delete": {
"security": [
{
"Bearer": []
}
],
"produces": [
"application/json"
],
"tags": [
"Maintenance"
],
"summary": "Delete Maintenance Entry",
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/v1/notifiers": {
"get": {
"security": [
@@ -2607,6 +2651,49 @@
}
}
},
"repo.MaintenanceEntryWithDetails": {
"type": "object",
"properties": {
"completedDate": {
"type": "string"
},
"cost": {
"type": "string",
"example": "0"
},
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"itemID": {
"type": "string"
},
"itemName": {
"type": "string"
},
"name": {
"type": "string"
},
"scheduledDate": {
"type": "string"
}
}
},
"repo.MaintenanceFilterStatus": {
"type": "string",
"enum": [
"scheduled",
"completed",
"both"
],
"x-enum-varnames": [
"MaintenanceFilterStatusScheduled",
"MaintenanceFilterStatusCompleted",
"MaintenanceFilterStatusBoth"
]
},
"repo.MaintenanceLog": {
"type": "object",
"properties": {
@@ -2710,9 +2797,6 @@
},
"total": {
"type": "integer"
},
"totalPrice": {
"type": "number"
}
}
},
@@ -2995,4 +3079,4 @@
"in": "header"
}
}
}
}