Skip to content

Commit c628474

Browse files
authored
feat(admin-ui): add create and edit organization screen (#978)
* refactor: rename kyc css to edit.module.css * feat: add panel for edit kyc * chore: open edit kyc from navbar * chore: add edit org fields * chore: add countries list * feat: add organization types to config api * feat: add edit org screen * feat: update org after update state * chore: remove hardcoded url * feat: add create org form * fix: edit form state * fix: make other type optional * chore: remove curly braces * refactor: replace controller with register
1 parent c2d4357 commit c628474

File tree

15 files changed

+1711
-18
lines changed

15 files changed

+1711
-18
lines changed

pkg/server/config.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ type GRPCConfig struct {
2626
func (cfg Config) grpcAddr() string { return fmt.Sprintf("%s:%d", cfg.Host, cfg.GRPC.Port) }
2727

2828
type UIConfig struct {
29-
Port int `yaml:"port" mapstructure:"port"`
30-
Title string `yaml:"title" mapstructure:"title"`
31-
Logo string `yaml:"logo" mapstructure:"logo"`
32-
AppURL string `yaml:"app_url" mapstructure:"app_url"`
33-
TokenProductId string `yaml:"token_product_id" mapstructure:"token_product_id"`
29+
Port int `yaml:"port" mapstructure:"port"`
30+
Title string `yaml:"title" mapstructure:"title"`
31+
Logo string `yaml:"logo" mapstructure:"logo"`
32+
AppURL string `yaml:"app_url" mapstructure:"app_url"`
33+
TokenProductId string `yaml:"token_product_id" mapstructure:"token_product_id"`
34+
OrganizationTypes []string `yaml:"organization_types" mapstructure:"organization_types"`
3435
}
3536

3637
type Config struct {

pkg/server/server.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ const (
5858
)
5959

6060
type UIConfigApiResponse struct {
61-
Title string `json:"title"`
62-
Logo string `json:"logo"`
63-
AppUrl string `json:"app_url"`
61+
Title string `json:"title"`
62+
Logo string `json:"logo"`
63+
AppUrl string `json:"app_url"`
64+
TokenProductId string `json:"token_product_id"`
65+
OrganizationTypes []string `json:"organization_types"`
6466
}
6567

6668
func ServeUI(ctx context.Context, logger log.Logger, uiConfig UIConfig, apiServerConfig Config) {
@@ -94,9 +96,11 @@ func ServeUI(ctx context.Context, logger log.Logger, uiConfig UIConfig, apiServe
9496
http.HandleFunc("/configs", func(w http.ResponseWriter, r *http.Request) {
9597
w.Header().Set("Content-Type", "application/json")
9698
confResp := UIConfigApiResponse{
97-
Title: uiConfig.Title,
98-
Logo: uiConfig.Logo,
99-
AppUrl: uiConfig.AppURL,
99+
Title: uiConfig.Title,
100+
Logo: uiConfig.Logo,
101+
AppUrl: uiConfig.AppURL,
102+
TokenProductId: uiConfig.TokenProductId,
103+
OrganizationTypes: uiConfig.OrganizationTypes,
100104
}
101105
json.NewEncoder(w).Encode(confResp)
102106
})

0 commit comments

Comments
 (0)