Performer custom fields (#5487)

* Backend changes
* Show custom field values
* Add custom fields table input
* Add custom field filtering
* Add unit tests
* Include custom fields in import/export
* Anonymise performer custom fields
* Move json.Number handler functions to api
* Handle json.Number conversion in api
This commit is contained in:
WithoutPants
2024-12-03 13:49:55 +11:00
committed by GitHub
parent a0e09bbe5c
commit 8c8be22fe4
56 changed files with 2158 additions and 277 deletions

View File

@@ -645,13 +645,13 @@ func (r *mutationResolver) ConfigureUI(ctx context.Context, input map[string]int
if input != nil {
// #5483 - convert JSON numbers to float64 or int64
input = utils.ConvertMapJSONNumbers(input)
input = convertMapJSONNumbers(input)
c.SetUIConfiguration(input)
}
if partial != nil {
// #5483 - convert JSON numbers to float64 or int64
partial = utils.ConvertMapJSONNumbers(partial)
partial = convertMapJSONNumbers(partial)
// merge partial into existing config
existing := c.GetUIConfiguration()
utils.MergeMaps(existing, partial)
@@ -672,9 +672,9 @@ func (r *mutationResolver) ConfigureUISetting(ctx context.Context, key string, v
// #5483 - convert JSON numbers to float64 or int64
if m, ok := value.(map[string]interface{}); ok {
value = utils.ConvertMapJSONNumbers(m)
value = convertMapJSONNumbers(m)
} else if n, ok := value.(json.Number); ok {
value = utils.JSONNumberToNumber(n)
value = jsonNumberToNumber(n)
}
cfg.Set(key, value)
@@ -686,7 +686,7 @@ func (r *mutationResolver) ConfigurePlugin(ctx context.Context, pluginID string,
c := config.GetInstance()
// #5483 - convert JSON numbers to float64 or int64
input = utils.ConvertMapJSONNumbers(input)
input = convertMapJSONNumbers(input)
c.SetPluginConfiguration(pluginID, input)
if err := c.Write(); err != nil {