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

UI remove mention of "email" and request a username #933

Merged
merged 3 commits into from
Jun 4, 2024
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
2 changes: 1 addition & 1 deletion ui/frontend/src/auth/LocalAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const LocalAccount = () => {
const localAccount = useContext(UserContext)?.username;
return (
<div className="mt-20">
<h1 className="text-3xl font-bold text-gray-700 pl-5 pb-4">Email: {localAccount}</h1>
<h1 className="text-3xl font-bold text-gray-700 pl-5 pb-4">Username: {localAccount}</h1>
<ProjectLogInstructions
projectId={undefined}
username={localAccount || ""}
Expand Down
10 changes: 1 addition & 9 deletions ui/frontend/src/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const UserContext = createContext<UserContextType | undefined>(

export const LocalLoginProvider = (props: { children: React.ReactNode }) => {
const [localUsername, setLocalUsername] = useState<string>("");
const isValidEmail = localUsername.includes("@"); // Quick hack -- todo: use email-validator
const [username, setUsername] = useLocalStorage(
"hamilton-username",
undefined
Expand All @@ -31,9 +30,6 @@ export const LocalLoginProvider = (props: { children: React.ReactNode }) => {
};

const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
if (!isValidEmail) {
return;
}
event.preventDefault();
setUsername(localUsername); // Store username
};
Expand All @@ -45,9 +41,6 @@ export const LocalLoginProvider = (props: { children: React.ReactNode }) => {
<h2 className="mt-6 text-center text-3xl font-extrabold text-gray-900">
Welcome to the Hamilton UI!
</h2>
<p className="mt-4 text-center text-sm text-gray-600">
Please enter an email address
</p>
</div>
<form className="mt-8 space-y-6" onSubmit={handleSubmit}>
<input
Expand All @@ -62,8 +55,7 @@ export const LocalLoginProvider = (props: { children: React.ReactNode }) => {
/>
<button
type="submit"
className={`group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white ${isValidEmail ? "bg-dwdarkblue" : "bg-dwdarkblue/50"} focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-dwdarkblue`}
disabled={!isValidEmail}
className={`group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-dwdarkblue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-dwdarkblue`}
>
Get started!
</button>
Expand Down
2 changes: 1 addition & 1 deletion ui/sdk/src/hamilton_sdk/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def __init__(
:param modules: Modules to use, same as standard Hamilton driver.
:param project_id: Identifier for the project to use to store this DAG under.
:param api_key: API key to use for authentication. Remember not to save this in plaintext!
:param username: email address to use for authentication.
:param username: username for authentication.
:param dag_name: name for this DAG. You will use this for top level curation of DAGs
within a project.
:param tags: Optional key value string pairs to help identify and curate this instance of
Expand Down
Loading