Issue 18: Added a popup to modify table columns (#31)

Added a new popup to modify the columns of the table. With this new popup, the user can:

- Show and hide columns
- Move columns around
- Add new columns which are derived from the value of an expression
- Delete columns

Also got the overlay mechanisms working.
This commit is contained in:
Leon Mika 2022-10-04 22:23:48 +11:00 committed by GitHub
parent f373a3313a
commit 982d3a9ca7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 1050 additions and 166 deletions

View file

@ -2,13 +2,13 @@ package main
import (
"context"
"flag"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/brianvoe/gofakeit/v6"
"github.com/google/uuid"
"github.com/lmika/audax/internal/dynamo-browse/models"
"github.com/lmika/audax/internal/dynamo-browse/providers/dynamo"
"github.com/lmika/audax/internal/dynamo-browse/services/tables"
@ -18,9 +18,13 @@ import (
)
func main() {
var flagSeed = flag.Int64("seed", 0, "random seed to use")
var flagCount = flag.Int("count", 500, "number of items to produce")
flag.Parse()
ctx := context.Background()
tableName := "business-addresses"
totalItems := 500
totalItems := *flagCount
cfg, err := config.LoadDefaultConfig(ctx)
if err != nil {
@ -53,8 +57,11 @@ func main() {
_, _ = tableService, tableInfo
log.Printf("using seed: %v", *flagSeed)
gofakeit.Seed(*flagSeed)
for i := 0; i < totalItems; i++ {
key := uuid.New().String()
key := gofakeit.UUID()
if err := tableService.Put(ctx, tableInfo, models.Item{
"pk": &types.AttributeValueMemberS{Value: key},
"sk": &types.AttributeValueMemberS{Value: key},
@ -64,6 +71,12 @@ func main() {
"phone": &types.AttributeValueMemberN{Value: gofakeit.Phone()},
"web": &types.AttributeValueMemberS{Value: gofakeit.URL()},
"officeOpened": &types.AttributeValueMemberBOOL{Value: gofakeit.Bool()},
"colors": &types.AttributeValueMemberM{
Value: map[string]types.AttributeValue{
"door": &types.AttributeValueMemberS{Value: gofakeit.Color()},
"front": &types.AttributeValueMemberS{Value: gofakeit.Color()},
},
},
"ratings": &types.AttributeValueMemberL{Value: []types.AttributeValue{
&types.AttributeValueMemberN{Value: fmt.Sprint(gofakeit.IntRange(0, 5))},
&types.AttributeValueMemberN{Value: fmt.Sprint(gofakeit.IntRange(0, 5))},