add-space-after-colon #211

Merged
lash merged 20 commits from add-space-after-colon into master 2024-12-19 11:35:14 +01:00
Member
  • Add a space after the colon for each menu item
  • Capitalize the first letter for custom defined menu items
- Add a space after the colon for each menu item - Capitalize the first letter for custom defined menu items
Alfred-mk added 6 commits 2024-12-12 13:26:52 +01:00
Alfred-mk changed title from add-space-after-colon to WIP: add-space-after-colon 2024-12-12 13:27:00 +01:00
Alfred-mk added 2 commits 2024-12-12 19:12:53 +01:00
Alfred-mk changed title from WIP: add-space-after-colon to add-space-after-colon 2024-12-12 19:17:12 +01:00
lash requested changes 2024-12-12 20:53:52 +01:00
@ -122,6 +123,7 @@ func main() {
flag.UintVar(&size, "s", 160, "max size of output")
flag.StringVar(&host, "h", initializers.GetEnv("HOST", "127.0.0.1"), "http host")
flag.UintVar(&port, "p", initializers.GetEnvUint("PORT", 7123), "http port")
flag.StringVar(&separator, "sep", ": ", "custom separator for the menu")
Owner

this is probably more a config thing than an arg thing?

this is probably more a config thing than an arg thing?
Author
Member

This has been resolved

This has been resolved
Alfred-mk marked this conversation as resolved
@ -25,3 +25,3 @@
for i, h := range holdings {
symbols = append(symbols, fmt.Sprintf("%d:%s", i+1, h.TokenSymbol))
symbols = append(symbols, fmt.Sprintf("%d: %s", i+1, h.TokenSymbol))
Owner

won't this break if separator is set to something else by config/arg?

won't this break if separator is set to something else by config/arg?
Alfred-mk marked this conversation as resolved
@ -1901,3 +1901,3 @@
}
formattedTransactions = append(formattedTransactions, fmt.Sprintf("%d:%s %s %s %s", i+1, status, value, sym, date))
formattedTransactions = append(formattedTransactions, fmt.Sprintf("%d: %s %s %s %s", i+1, status, value, sym, date))
Owner

same here, will break

same here, will break
Author
Member

This has been resolved

This has been resolved
Alfred-mk added 1 commit 2024-12-12 23:11:12 +01:00
Alfred-mk changed title from add-space-after-colon to WIP: add-space-after-colon 2024-12-13 08:54:03 +01:00
Alfred-mk added 4 commits 2024-12-13 09:44:10 +01:00
Alfred-mk changed title from WIP: add-space-after-colon to add-space-after-colon 2024-12-13 09:44:38 +01:00
lash requested changes 2024-12-13 09:52:12 +01:00
@ -1676,6 +1676,11 @@ func (h *Handlers) CheckVouchers(ctx context.Context, sym string, input []byte)
func (h *Handlers) GetVoucherList(ctx context.Context, sym string, input []byte) (resource.Result, error) {
var res resource.Result
menuSeparator, ok := ctx.Value("MenuSeparator").(string)
Owner

why wouldnt this be set directly as a property in the handler?

why wouldnt this be set directly as a property in the handler?
Author
Member

It would be easier setting it in the context for use by downstream functions, similar to how the database is set.

Also. it won't be used by most of the handler functions. It's only usable by functions that generate custom menu items (such as the voucher list and transfers list)

It would be easier setting it in the context for use by downstream functions, similar to how the database is set. Also. it won't be used by most of the handler functions. It's only usable by functions that generate custom menu items (such as the voucher list and transfers list)
Owner

ref phone conversation, let store a function pointer in the handlers that does the translation with the separator selected :)

ref phone conversation, let store a function pointer in the handlers that does the translation with the separator selected :)
Author
Member

This has been done. The function is passed from the LocalHandlerService to the Handlers

This has been done. The function is passed from the LocalHandlerService to the Handlers
Alfred-mk changed title from add-space-after-colon to WIP: add-space-after-colon 2024-12-18 08:12:20 +01:00
Alfred-mk added 3 commits 2024-12-18 19:59:17 +01:00
Alfred-mk added 2 commits 2024-12-18 20:25:54 +01:00
Alfred-mk added 1 commit 2024-12-18 20:30:48 +01:00
Alfred-mk changed title from WIP: add-space-after-colon to add-space-after-colon 2024-12-18 20:35:12 +01:00
lash requested changes 2024-12-19 09:42:31 +01:00
@ -102,0 +100,4 @@
accountService: accountService,
prefixDb: prefixDb,
profile: &models.Profile{Max: 6},
ReplaceSeparator: replaceSeparator,
Owner

Let's name it ReplaceSeparatorFunc

Let's name it `ReplaceSeparatorFunc`
Author
Member

This has been done

This has been done
Alfred-mk added 1 commit 2024-12-19 11:33:02 +01:00
lash merged commit 235af3519d into master 2024-12-19 11:35:14 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: urdt/ussd#211
No description provided.