account page: can now reorder entries under shops sections by drag and drop

This commit is contained in:
2026-01-26 13:51:40 -07:00
parent a2d8993e0e
commit a50c0ef18d
14 changed files with 682 additions and 88 deletions
+48 -16
View File
@@ -10,41 +10,41 @@ type (
)
const (
Etsy Platform = "Etsy"
Tiktok Platform = "Tiktok"
Wix Platform = "Wix"
Ebay Platform = "ebay"
WalmartMarketplace Platform = "walmart_marketplace"
Amazon Platform = "amazon"
BigCartel Platform = "big_cartel"
Ebay Platform = "ebay"
Ecwid Platform = "ecwid"
Zoho Platform = "zoho"
Etsy Platform = "Etsy"
Shopify Platform = "shopify"
SquareOnline Platform = "square_online"
Squarespace Platform = "squarespace"
Tiktok Platform = "Tiktok"
WalmartMarketplace Platform = "walmart_marketplace"
Wix Platform = "Wix"
WooCommerce Platform = "woo_commerce"
Shopify Platform = "shopify"
Zoho Platform = "zoho"
)
var (
allValues = []Platform{
Etsy,
Tiktok,
Wix,
Ebay,
WalmartMarketplace,
allPlatforms = []Platform{
Amazon,
BigCartel,
Ebay,
Ecwid,
Zoho,
Etsy,
Shopify,
SquareOnline,
Squarespace,
Tiktok,
WalmartMarketplace,
Wix,
WooCommerce,
Shopify,
Zoho,
}
)
func NewPlatform(s string) (Platform, error) {
for _, v := range allValues {
for _, v := range allPlatforms {
if strings.ToLower(s) == strings.ToLower(string(v)) {
return v, nil
}
@@ -52,6 +52,38 @@ func NewPlatform(s string) (Platform, error) {
return "", fmt.Errorf("unrecognized constant: %q", s)
}
func (p Platform) PrettyPrint() string {
switch p {
case Etsy:
return "Etsy"
case Tiktok:
return "Tiktok"
case Wix:
return "Wix"
case Ebay:
return "Ebay"
case WalmartMarketplace:
return "Walmart Marketplace"
case Amazon:
return "Amazon"
case BigCartel:
return "Big Cartel"
case Ecwid:
return "Ecwid"
case Zoho:
return "Zoho"
case SquareOnline:
return "Square Online"
case Squarespace:
return "Squarespace"
case WooCommerce:
return "Woo Commerce"
case Shopify:
return "Shopify"
}
return ""
}
// sql.Scanner implementation
func (p *Platform) Scan(src any) error {
var s string