fix: authentication redirection and UI (#4432)

* dev: update python version

* dev: handle magic code attempt exhausted

* dev: update app, space and god mode redirection paths

* fix: handled signup and signin workflow

* chore: auth input error indication and autofill styling improvement

* dev: add app redirection urls

* dev: update redirections

* chore: onboarding improvement

* chore: onboarding improvement

* chore: redirection issue in space resolved

* chore: instance empty state added

* dev: fix app, space, admin redirection in docker setitngs

---------

Co-authored-by: guru_sainath <gurusainath007@gmail.com>
Co-authored-by: Anmol Singh Bhatia <anmolsinghbhatia@plane.so>
This commit is contained in:
Nikhil 2024-05-10 17:30:38 +05:30 committed by GitHub
parent 2d1201cc92
commit 88ebda42ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 1336 additions and 541 deletions

View file

@ -140,8 +140,11 @@ export const OnBoardingForm: React.FC<Props> = observer((props) => {
</button>
</div>
<div className="flex gap-4">
<div className="space-y-1">
<label className="text-sm text-onboarding-text-300 font-medium" htmlFor="first_name">
<div className="space-y-1 w-full">
<label
className="text-sm text-onboarding-text-300 font-medium after:content-['*'] after:ml-0.5 after:text-red-500"
htmlFor="first_name"
>
First name
</label>
<Controller
@ -171,8 +174,11 @@ export const OnBoardingForm: React.FC<Props> = observer((props) => {
/>
{errors.first_name && <span className="text-sm text-red-500">{errors.first_name.message}</span>}
</div>
<div className="space-y-1">
<label className="text-sm text-onboarding-text-300 font-medium" htmlFor="last_name">
<div className="space-y-1 w-full">
<label
className="text-sm text-onboarding-text-300 font-medium after:content-['*'] after:ml-0.5 after:text-red-500"
htmlFor="last_name"
>
Last name
</label>
<Controller

View file

@ -6,5 +6,5 @@ import { IProfileStore } from "@/store/user/profile.store";
export const useUserProfile = (): IProfileStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
return context.profile;
return context.user.userProfile;
};

View file

@ -32,13 +32,17 @@ export const AuthWrapper: FC<TAuthWrapper> = observer((props) => {
<Spinner />
</div>
);
if (pageType === EPageTypes.PUBLIC) return <>{children}</>;
if (pageType === EPageTypes.INIT) {
if (!currentUser?.id) return <>{children}</>;
else {
if (currentUserProfile?.id && currentUserProfile?.onboarding_step?.profile_complete) return <>{children}</>;
if (
currentUserProfile &&
currentUserProfile?.id &&
Boolean(currentUserProfile?.onboarding_step?.profile_complete)
)
return <>{children}</>;
else {
router.push(`/onboarding`);
return <></>;

View file

@ -16,7 +16,7 @@ import { useUser, useUserProfile } from "@/hooks/store";
import { AuthWrapper } from "@/lib/wrappers";
// assets
import ProfileSetupDark from "public/onboarding/profile-setup-dark.svg";
import ProfileSetup from "public/onboarding/profile-setup.svg";
import ProfileSetup from "public/onboarding/profile-setup-light.svg";
const OnBoardingPage = observer(() => {
// router
@ -47,8 +47,8 @@ const OnBoardingPage = observer(() => {
console.log("Failed to update onboarding status");
});
if (next_path) router.replace(next_path.toString());
router.replace("/");
if (next_path) router.push(next_path.toString());
router.push("/");
};
return (

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 729 KiB

After

Width:  |  Height:  |  Size: 994 KiB

Before After
Before After

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 993 KiB

View file

@ -4,7 +4,6 @@ import { enableStaticRendering } from "mobx-react-lite";
import { IInstanceStore, InstanceStore } from "@/store/instance.store";
import { IProjectStore, ProjectStore } from "@/store/project";
import { IUserStore, UserStore } from "@/store/user";
import { IProfileStore, ProfileStore } from "@/store/user/profile.store";
import IssueStore, { IIssueStore } from "./issue";
import IssueDetailStore, { IIssueDetailStore } from "./issue_details";
@ -16,7 +15,6 @@ enableStaticRendering(typeof window === "undefined");
export class RootStore {
instance: IInstanceStore;
user: IUserStore;
profile: IProfileStore;
project: IProjectStore;
issue: IIssueStore;
@ -27,9 +25,8 @@ export class RootStore {
constructor() {
this.instance = new InstanceStore(this);
this.user = new UserStore(this);
this.profile = new ProfileStore(this);
this.project = new ProjectStore(this);
this.project = new ProjectStore(this);
this.issue = new IssueStore(this);
this.issueDetails = new IssueDetailStore(this);
this.mentionsStore = new MentionsStore(this);
@ -41,7 +38,6 @@ export class RootStore {
this.instance = new InstanceStore(this);
this.user = new UserStore(this);
this.profile = new ProfileStore(this);
this.project = new ProjectStore(this);
this.issue = new IssueStore(this);