Skip to content

Commit

Permalink
Visualize internal property names in UI (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
pivovarit authored Jul 13, 2024
1 parent 399fd23 commit 9782df5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions quesma/quesma/ui/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ func (qmc *QuesmaManagementConsole) generateSchemas() []byte {
buffer.Html(`<tr class="tableName"`)
buffer.Html(fmt.Sprintf(` id="%s"`, id))
buffer.Html(`>`)
buffer.Html(`<th colspan=2><h2>`)
buffer.Html(`<th colspan=3><h2>`)
buffer.Html(`Index Name: `)
buffer.Text(schemaName.AsString())

buffer.Html(`</h2></th>`)
buffer.Html(`</tr>`)
buffer.Html(`<tr>`)
buffer.Html(`<th>`)
buffer.Html(`Name`)
buffer.Html(`Public Name`)
buffer.Html(`</th>`)
buffer.Html(`<th>`)
buffer.Html(`Internal Name`)
buffer.Html(`</th>`)
buffer.Html(`<th>`)
buffer.Html(`Type`)
Expand All @@ -44,6 +47,9 @@ func (qmc *QuesmaManagementConsole) generateSchemas() []byte {
buffer.Text(fieldName.AsString())
buffer.Html(`</td>`)
buffer.Html(`<td>`)
buffer.Text(field.InternalPropertyName.AsString())
buffer.Html(`</td>`)
buffer.Html(`<td>`)
buffer.Text(fmt.Sprintf("%s %s", field.Type.Name, field.Type.Properties))
buffer.Html(`</td>`)
buffer.Html(`</tr>`)
Expand All @@ -53,6 +59,9 @@ func (qmc *QuesmaManagementConsole) generateSchemas() []byte {
targetFieldName := schema.Aliases[aliasFieldName]
buffer.Html(`<tr>`)
buffer.Html(`<td>`)
buffer.Text("-")
buffer.Html(`</td>`)
buffer.Html(`<td>`)
buffer.Text(fmt.Sprintf("%s->%s", aliasFieldName.AsString(), targetFieldName.AsString()))
buffer.Html(`</td>`)
buffer.Html(`<td>`)
Expand Down

0 comments on commit 9782df5

Please sign in to comment.