Breaking changes
Replaces the JSON-backed Kommandant::Command
model with a database backed version (#25)
Also adds a UI for CRUDing commands. The easiest way to migrate is to convert your old JSON file to a script:
// commands.json
{
"id": "find_policy",
"icon": "file_invoice_dollar",
"path": "/kommandant/commands/find_policy",
"http_method": "get",
"resource_class": "Policy",
"text_keys": [
"insurable"
],
"translations": {
"da": {
"name": "Find police",
"placeholder": "Søg på kundenavn, nummerplade, pantdeklarationsnummer eller id"
}
}
}
# your shiny new migration script
Kommandant::Command.create!(
icon: "file_invoice_dollar",
http_method: "get",
resource_class: "Policy",
search_result_text_method: "name",
translations: {da: {
name: "Find police",
placeholder: "Søg på kundenavn, nummerplade, pantdeklarationsnummer eller id"
}}
)
Note that the path is no longer needed for search commands and the text_keys
object has been replaced with a field called search_result_text_method
.