fix(bulk): mode and RST were offered but could not be saved
A bulk-editable field passes through THREE tables: the list the dialog shows, bulkFieldColumns in app.go, and bulkEditableCols in internal/qso. I added mode, submode and RST to the first and the third and missed the middle one, so the dialog offered them and every save came back "unknown field". Nothing warns about that. Each table is perfectly valid on its own, and the mismatch only surfaces when an operator picks the one field that falls through the gap — which is exactly how it was found. So both directions are pinned now: every mapped field must be writable by the qso layer, and every writable column must have a field mapping to it. A column nothing maps to looks supported from the inside and cannot be reached from outside, which is the same fault wearing the other hat.
This commit is contained in:
@@ -896,6 +896,23 @@ var bulkEditableExtras = map[string]string{
|
||||
// BulkExtraKey maps a frontend field id to its ADIF key in extras_json, or "".
|
||||
func BulkExtraKey(field string) string { return bulkEditableExtras[field] }
|
||||
|
||||
// BulkEditable reports whether a COLUMN may be bulk-written. Exported so the
|
||||
// app layer can check its own field mapping against this whitelist: the two
|
||||
// lists are separate, valid on their own, and a field present in one and absent
|
||||
// from the other fails only when an operator tries to use it.
|
||||
func BulkEditable(column string) bool { return bulkEditableCols[column] }
|
||||
|
||||
// BulkEditableColumns lists every bulk-writable column, for the same check from
|
||||
// the other side: a column nothing maps to looks supported and cannot be used.
|
||||
func BulkEditableColumns() []string {
|
||||
out := make([]string, 0, len(bulkEditableCols))
|
||||
for c := range bulkEditableCols {
|
||||
out = append(out, c)
|
||||
}
|
||||
sort.Strings(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// BulkSetExtra sets one whitelisted extras_json field on every listed QSO,
|
||||
// leaving the other extras untouched. An empty value REMOVES the key rather than
|
||||
// storing a blank — an empty extra would otherwise be carried into every export.
|
||||
|
||||
Reference in New Issue
Block a user