From 6fc52fd62d423347a4a5fff895d2339354fac433 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:48:57 -0400 Subject: [PATCH] feat: implement templ forms for consent privacy, credential assert, credential register, and profile details --- Makefile | 12 +++--- devbox.json | 22 +++++----- .../auth/forms/consent_privacy.templ | 11 +++++ .../auth/forms/consent_privacy_templ.go | 40 +++++++++++++++++++ .../auth/forms/credential_assert.templ | 11 +++++ .../auth/forms/credential_assert_templ.go | 40 +++++++++++++++++++ .../auth/forms/credential_register.templ | 11 +++++ .../auth/forms/credential_register_templ.go | 40 +++++++++++++++++++ .../auth/forms/details_profile.templ | 11 +++++ .../auth/forms/details_profile_templ.go | 40 +++++++++++++++++++ 10 files changed, 221 insertions(+), 17 deletions(-) create mode 100644 pkg/nebula/components/auth/forms/consent_privacy.templ create mode 100644 pkg/nebula/components/auth/forms/consent_privacy_templ.go create mode 100644 pkg/nebula/components/auth/forms/credential_assert.templ create mode 100644 pkg/nebula/components/auth/forms/credential_assert_templ.go create mode 100644 pkg/nebula/components/auth/forms/credential_register.templ create mode 100644 pkg/nebula/components/auth/forms/credential_register_templ.go create mode 100644 pkg/nebula/components/auth/forms/details_profile.templ create mode 100644 pkg/nebula/components/auth/forms/details_profile_templ.go diff --git a/Makefile b/Makefile index f795d0b29..52586a6a6 100644 --- a/Makefile +++ b/Makefile @@ -295,26 +295,26 @@ sh-testnet: mod-tidy ### templ & vault ### ############################################################################### -.PHONY: motr hway templ pkl nebula +.PHONY: build-motr build-hway gen-templ gen-pkl build-nebula -hway: +build-hway: @echo "(motr) Building Highway gateway" go build -o ./build/hway ./cmd/hway -motr: +build-motr: @echo "(dwn) Building motr.wasm -> Service Worker IPFS Vault" GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./cmd/motr/motr.go -templ: +gen-templ: @echo "(templ) Generating templ files" templ generate -nebula: +build-nebula: @echo "(nebula) Building nebula" cd pkg/nebula && bun run build templ generate -pkl: +gen-pkl: @echo "(pkl) Building PKL" go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/DWN.pkl go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/ORM.pkl diff --git a/devbox.json b/devbox.json index 6b228130e..0d1a5af38 100644 --- a/devbox.json +++ b/devbox.json @@ -35,32 +35,32 @@ "make local-image" ], "build:hway": [ - "make nebula", - "make hway" + "make build-nebula", + "make build-hway" ], "build:nebula": [ - "make nebula" + "make build-nebula" ], "build:motr": [ - "make motr" + "make build-motr" ], "build:sonrd": [ - "make motr", + "make build-motr", "make build" ], "build": [ - "make motr", + "make build-motr", "make build", - "make hway" + "make build-hway" ], "gen:proto": [ "make proto-gen" ], "gen:pkl": [ - "make pkl" + "make gen-pkl" ], "gen:templ": [ - "make templ" + "make gen-templ" ], "start": [ "process-compose up -f ./deploy/process-compose.yaml" @@ -72,8 +72,8 @@ "make sh-testnet" ], "start:hway": [ - "make nebula", - "make hway", + "make build-nebula", + "make build-hway", "./build/hway start" ] } diff --git a/pkg/nebula/components/auth/forms/consent_privacy.templ b/pkg/nebula/components/auth/forms/consent_privacy.templ new file mode 100644 index 000000000..999bac796 --- /dev/null +++ b/pkg/nebula/components/auth/forms/consent_privacy.templ @@ -0,0 +1,11 @@ +package forms + +templ privacyConsentForm() { +
+
+
+
+
+
+
+} diff --git a/pkg/nebula/components/auth/forms/consent_privacy_templ.go b/pkg/nebula/components/auth/forms/consent_privacy_templ.go new file mode 100644 index 000000000..9f1543d59 --- /dev/null +++ b/pkg/nebula/components/auth/forms/consent_privacy_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func privacyConsentForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/auth/forms/credential_assert.templ b/pkg/nebula/components/auth/forms/credential_assert.templ new file mode 100644 index 000000000..142ecaca8 --- /dev/null +++ b/pkg/nebula/components/auth/forms/credential_assert.templ @@ -0,0 +1,11 @@ +package forms + +templ AssertCredentialForm() { +
+
+
+
+
+
+
+} diff --git a/pkg/nebula/components/auth/forms/credential_assert_templ.go b/pkg/nebula/components/auth/forms/credential_assert_templ.go new file mode 100644 index 000000000..9c3712c7f --- /dev/null +++ b/pkg/nebula/components/auth/forms/credential_assert_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func AssertCredentialForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/auth/forms/credential_register.templ b/pkg/nebula/components/auth/forms/credential_register.templ new file mode 100644 index 000000000..4e91ee1a6 --- /dev/null +++ b/pkg/nebula/components/auth/forms/credential_register.templ @@ -0,0 +1,11 @@ +package forms + +templ RegisterCredentialForm() { +
+
+
+
+
+
+
+} diff --git a/pkg/nebula/components/auth/forms/credential_register_templ.go b/pkg/nebula/components/auth/forms/credential_register_templ.go new file mode 100644 index 000000000..0ef8c8922 --- /dev/null +++ b/pkg/nebula/components/auth/forms/credential_register_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func RegisterCredentialForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/auth/forms/details_profile.templ b/pkg/nebula/components/auth/forms/details_profile.templ new file mode 100644 index 000000000..5e51c7f93 --- /dev/null +++ b/pkg/nebula/components/auth/forms/details_profile.templ @@ -0,0 +1,11 @@ +package forms + +templ ProfileDetailsForm() { +
+
+
+
+
+
+
+} diff --git a/pkg/nebula/components/auth/forms/details_profile_templ.go b/pkg/nebula/components/auth/forms/details_profile_templ.go new file mode 100644 index 000000000..2e4cc89e2 --- /dev/null +++ b/pkg/nebula/components/auth/forms/details_profile_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func ProfileDetailsForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate