From 3d6a0a4109d8a3a96142be99c0eaafdeae31faf4 Mon Sep 17 00:00:00 2001 From: Grady Ward Date: Sat, 20 Jan 2024 19:46:29 -0700 Subject: [PATCH] Holdings Date Fixes --- cmd/server/pactasrv/portfolio.go | 7 +++++++ frontend/components/form/FieldHeader.vue | 2 +- .../inputs/{HoldingDate.vue => HoldingsDate.vue} | 0 frontend/components/portfolio/Editor.vue | 8 ++++++++ frontend/lang/en.json | 4 +++- frontend/pages/upload.vue | 2 +- 6 files changed, 20 insertions(+), 3 deletions(-) rename frontend/components/inputs/{HoldingDate.vue => HoldingsDate.vue} (100%) diff --git a/cmd/server/pactasrv/portfolio.go b/cmd/server/pactasrv/portfolio.go index b93f5a2..41adde6 100644 --- a/cmd/server/pactasrv/portfolio.go +++ b/cmd/server/pactasrv/portfolio.go @@ -90,6 +90,13 @@ func (s *Server) UpdatePortfolio(ctx context.Context, request api.UpdatePortfoli if request.Body.Description != nil { mutations = append(mutations, db.SetPortfolioDescription(*request.Body.Description)) } + if request.Body.PropertyHoldingsDate != nil { + hd, err := conv.HoldingsDateFromOAPI(request.Body.PropertyHoldingsDate) + if err != nil { + return nil, err + } + mutations = append(mutations, db.SetPortfolioPropertyHoldingsDate(hd)) + } if request.Body.PropertyESG != nil { mutations = append(mutations, db.SetPortfolioPropertyESG(conv.OptionalBoolFromOAPI(*request.Body.PropertyESG))) } diff --git a/frontend/components/form/FieldHeader.vue b/frontend/components/form/FieldHeader.vue index d7a2d18..5289171 100644 --- a/frontend/components/form/FieldHeader.vue +++ b/frontend/components/form/FieldHeader.vue @@ -66,7 +66,7 @@ const helpTextTextClass = computed(() => helpTextExpanded.value ? 'mb-2' : 'h-0'
{{ props.helpText }} diff --git a/frontend/components/inputs/HoldingDate.vue b/frontend/components/inputs/HoldingsDate.vue similarity index 100% rename from frontend/components/inputs/HoldingDate.vue rename to frontend/components/inputs/HoldingsDate.vue diff --git a/frontend/components/portfolio/Editor.vue b/frontend/components/portfolio/Editor.vue index 05bb713..db5b55e 100644 --- a/frontend/components/portfolio/Editor.vue +++ b/frontend/components/portfolio/Editor.vue @@ -40,6 +40,14 @@ const evs = computed({ auto-resize /> + + + { label="Holdings Date" help-text="The holdings date for the portfolio" > -