Skip to content

Commit

Permalink
UI remove mention of "email" and request a username (#933)
Browse files Browse the repository at this point in the history
updated UI to remove email referencing and @ in username

> So this will work -- the full auth system integration will break (it requires emails),
> but given that this is separate that's fine.
by Elijah

---------

Co-authored-by: zilto <tjean@DESKTOP-V6JDCS2>
  • Loading branch information
zilto and zilto authored Jun 4, 2024
1 parent ab1b8a2 commit 47e7fa3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
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

0 comments on commit 47e7fa3

Please sign in to comment.