Explorar o código

feature flag update

jusrhee %!s(int64=2) %!d(string=hai) anos
pai
achega
17e3a57403

+ 1 - 0
api/types/project.go

@@ -66,6 +66,7 @@ type Project struct {
 // retrieve feature flags from the `GET /projects/{project_id}` response instead
 type FeatureFlags struct {
 	AzureEnabled                    bool   `json:"azure_enabled,omitempty"`
+	BillingEnabled 									bool   `json:"billing_enabled,omitempty"`
 	CapiProvisionerEnabled          string `json:"capi_provisioner_enabled,omitempty"`
 	EnableReprovision               bool   `json:"enable_reprovision,omitempty"`
 	FullAddOns                      bool   `json:"full_add_ons,omitempty"`

+ 3 - 3
dashboard/package.json

@@ -8,11 +8,11 @@
     "@loadable/component": "^5.15.2",
     "@material-ui/core": "^4.11.3",
     "@material-ui/lab": "^4.0.0-alpha.61",
-    "@stripe/stripe-js": "^3.0.10",
-    "@stripe/react-stripe-js": "^2.6.2",
     "@react-spring/web": "^9.6.1",
     "@sentry/react": "^6.13.2",
     "@sentry/tracing": "^6.13.2",
+    "@stripe/react-stripe-js": "^2.6.2",
+    "@stripe/stripe-js": "^3.0.10",
     "@tanstack/react-query": "^4.13.0",
     "@tanstack/react-query-devtools": "^4.13.5",
     "@visx/axis": "^3.3.0",
@@ -181,4 +181,4 @@
       "prettier --write"
     ]
   }
-}
+}

+ 1 - 2
dashboard/src/main/home/project-settings/ProjectSettings.tsx

@@ -90,8 +90,7 @@ function ProjectSettings(props: any) {
         label: "Additional settings",
       });
 
-      console.log(currentProject);
-      console.log(currentProject?.billing_enabled);
+      console.log("is billing enabled?", currentProject?.billing_enabled);
       if (currentProject?.billing_enabled) {
         tabOpts.push({
           value: "billing",

+ 1 - 0
internal/models/project.go

@@ -338,6 +338,7 @@ func (p *Project) ToProjectListType() *types.ProjectList {
 		// note: all of these fields should be considered deprecated
 		// in an api response
 		Roles:                  roles,
+		BillingEnabled:         p.BillingEnabled,
 		PreviewEnvsEnabled:     p.PreviewEnvsEnabled,
 		RDSDatabasesEnabled:    p.RDSDatabasesEnabled,
 		ManagedInfraEnabled:    p.ManagedInfraEnabled,