Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email subscription drop rate #5145

Merged
merged 3 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion pkg/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3511,10 +3511,13 @@ func (c *Controller) GetSetupState(w http.ResponseWriter, r *http.Request) {
writeError(w, r, http.StatusInternalServerError, err)
return
}

state := string(savedState)
// no need to create an admin user if users are managed externally
if c.Config.IsAuthTypeAPI() {
state = string(auth.SetupStateInitialized)
} else if savedState == auth.SetupStateNotInitialized {
c.Collector.CollectEvent(stats.Event{Class: "global", Name: "preinit", Client: httputil.GetRequestLakeFSClient(r)})
}
response := SetupState{
State: swag.String(state),
Expand Down Expand Up @@ -3605,8 +3608,14 @@ func (c *Controller) SetupCommPrefs(w http.ResponseWriter, r *http.Request, body
return
}

// this is the "natural" next step in the setup process
nextStep := auth.SetupStateCommPrefsDone
// if users are managed externally, we can skip the admin user creation step
if c.Config.IsAuthTypeAPI() {
nextStep = auth.SetupStateInitialized
}
response := NextStep{
NextStep: string(auth.SetupStateCommPrefsDone),
NextStep: string(nextStep),
}

if *body.Email == "" {
Expand Down
4 changes: 2 additions & 2 deletions webui/src/pages/setup/communicationPreferences.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {ChangeEvent, FC, useCallback, useState} from "react";
import React, {ChangeEvent, FC, FormEvent, useCallback, useState} from "react";
import Button from "react-bootstrap/Button";
import Card from "react-bootstrap/Card";
import Col from "react-bootstrap/Col";
Expand All @@ -21,7 +21,7 @@ export const CommunicationPreferencesSetup: FC<CommunicationPreferencesSetupProp
const [updatesCheck, setUpdatesCheck] = useState<boolean>(false);
const [securityCheck, setSecurityCheck] = useState<boolean>(false);

const submitHandler = useCallback((e) => {
const submitHandler = useCallback((e: FormEvent) => {
onSubmit(userEmail, updatesCheck, securityCheck);
e.preventDefault();
}, [onSubmit, userEmail, updatesCheck, securityCheck]);
Expand Down