-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Organization onboarding welcome message #20577
Draft
filiptronicek
wants to merge
24
commits into
main
Choose a base branch
from
ft/org-welcome-msg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7,480
−2,278
Draft
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
3c62068
WIP
filiptronicek 99b0b71
Backend iteration
filiptronicek d42f22d
Tweak design
filiptronicek 0d7d880
Update organization onboarding settings to support optional welcome m…
filiptronicek 6293167
Implement new user onboarding flow with welcome message
filiptronicek 3a05bca
Refactor welcome message components and update dependencies
filiptronicek f3266bc
Fix localStorage and Markdown styling in dashboard components
filiptronicek 0b3eda8
Merge remote-tracking branch 'origin/main' into ft/org-welcome-msg
filiptronicek aff357b
Fix build issues
filiptronicek 5009281
Improve welcome message configuration with error handling
filiptronicek 9b13421
Properly do partial org opts
filiptronicek b216fa4
Remove suggested repository management from repository list
filiptronicek e6ee954
Proper partial updating for `onboardingSettings`
filiptronicek 00c1213
center view button
filiptronicek ef10501
Don't overshare
filiptronicek cf3124b
update comments
filiptronicek 3d8f8b0
Small drive-by for insights export toast
filiptronicek b7353c3
Colored suggestions
filiptronicek b4149c6
Update protobuf import paths for organization onboarding settings and…
filiptronicek ac0e2c5
Merge remote-tracking branch 'origin/main' into ft/org-welcome-msg
filiptronicek 004e07a
fix org service test expecting member list to include admin
filiptronicek ba2538d
Fix OIDC callback to properly append newUser query parameter
filiptronicek 0bad6df
Fix test checks
filiptronicek f601310
Merge remote-tracking branch 'origin/main' into ft/org-welcome-msg
filiptronicek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
components/dashboard/src/components/podkit/forms/TextArea.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Copyright (c) 2025 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License.AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import * as React from "react"; | ||
|
||
import { cn } from "@podkit/lib/cn"; | ||
|
||
const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<"textarea">>( | ||
({ className, ...props }, ref) => { | ||
return ( | ||
<textarea | ||
className={cn( | ||
"flex min-h-[80px] w-full rounded-md border border-input bg-pk-surface-primary px-3 py-2 text-base ring-offset-background placeholder:text-pk-content-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", | ||
className, | ||
)} | ||
ref={ref} | ||
{...props} | ||
/> | ||
); | ||
}, | ||
); | ||
Textarea.displayName = "Textarea"; | ||
|
||
export { Textarea }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
components/dashboard/src/teams/onboarding/OrgMemberAvatarInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* Copyright (c) 2025 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License.AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import { useState } from "react"; | ||
import { useListOrganizationMembers } from "../../data/organizations/members-query"; | ||
|
||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@podkit/dropdown/DropDown"; | ||
import { Button } from "@podkit/buttons/Button"; | ||
import type { OnboardingSettings_WelcomeMessage } from "@gitpod/public-api/lib/gitpod/v1/organization_pb"; | ||
|
||
type Props = { | ||
settings: OnboardingSettings_WelcomeMessage | undefined; | ||
setFeaturedMemberId: (featuredMemberId: string | undefined) => void; | ||
}; | ||
export const OrgMemberAvatarInput = ({ settings, setFeaturedMemberId }: Props) => { | ||
const { data: members } = useListOrganizationMembers(); | ||
|
||
const [avatarUrl, setAvatarUrl] = useState<string | undefined>(settings?.featuredMemberResolvedAvatarUrl); | ||
|
||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger> | ||
<div className="flex flex-col justify-center items-center gap-2"> | ||
{avatarUrl ? ( | ||
<img src={avatarUrl} alt="" className="w-16 h-16 rounded-full" /> | ||
) : ( | ||
<div className="w-16 h-16 rounded-full bg-[#EA71DE]" /> | ||
)} | ||
<Button variant="secondary" size="sm" type="button"> | ||
Change Photo | ||
</Button> | ||
</div> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent> | ||
<DropdownMenuItem | ||
key="disabled" | ||
onClick={() => { | ||
setFeaturedMemberId(undefined); | ||
setAvatarUrl(undefined); | ||
}} | ||
> | ||
<div className="flex items-center gap-2"> | ||
<div className="w-4 h-4 rounded-full bg-pk-surface-tertiary" /> | ||
Disable image | ||
</div> | ||
</DropdownMenuItem> | ||
{members?.map((member) => ( | ||
<DropdownMenuItem | ||
key={member.userId} | ||
onClick={() => { | ||
setFeaturedMemberId(member.userId); | ||
setAvatarUrl(member.avatarUrl); | ||
}} | ||
> | ||
<div className="flex items-center gap-2"> | ||
<img src={member.avatarUrl} alt={member.fullName} className="w-4 h-4 rounded-full" /> | ||
{member.fullName} | ||
</div> | ||
</DropdownMenuItem> | ||
))} | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
); | ||
}; |
61 changes: 61 additions & 0 deletions
61
components/dashboard/src/teams/onboarding/OrganizationJoinModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Copyright (c) 2025 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License.AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import { Button } from "@podkit/buttons/Button"; | ||
import { ModalHeader } from "../../components/Modal"; | ||
import { ModalBody } from "../../components/Modal"; | ||
import { ModalFooter } from "../../components/Modal"; | ||
import { Modal } from "../../components/Modal"; | ||
import { useMemo, useCallback, useState, useEffect } from "react"; | ||
import { storageAvailable } from "../../utils"; | ||
import { OrganizationSettings } from "@gitpod/public-api/lib/gitpod/v1/organization_pb"; | ||
import { WelcomeMessagePreview } from "./WelcomeMessagePreview"; | ||
|
||
type Props = { | ||
orgSettings: OrganizationSettings; | ||
}; | ||
export const OrganizationJoinModal = ({ orgSettings }: Props) => { | ||
const initialOrgOnboardingPending = useMemo(() => { | ||
if (storageAvailable("localStorage")) { | ||
return localStorage.getItem("newUserOnboardingPending") === "true"; | ||
} | ||
}, []); | ||
const dismissOrgOnboardingPending = useCallback(() => { | ||
if (storageAvailable("localStorage")) { | ||
localStorage.removeItem("newUserOnboardingPending"); | ||
} | ||
|
||
setOrgOnboardingPending(false); | ||
}, []); | ||
const [orgOnboardingPending, setOrgOnboardingPending] = useState(initialOrgOnboardingPending ?? false); | ||
|
||
// if the org-wide welcome message is not enabled, prevent showing it in the future | ||
useEffect(() => { | ||
if (!orgSettings?.onboardingSettings?.welcomeMessage?.enabled) { | ||
dismissOrgOnboardingPending(); | ||
} | ||
}, [orgSettings?.onboardingSettings?.welcomeMessage?.enabled, dismissOrgOnboardingPending]); | ||
|
||
if (!orgSettings?.onboardingSettings?.welcomeMessage?.enabled) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Modal | ||
visible={orgOnboardingPending} | ||
onClose={dismissOrgOnboardingPending} | ||
containerClassName="min-[576px]:max-w-[650px]" | ||
> | ||
<ModalHeader>Welcome to Gitpod</ModalHeader> | ||
<ModalBody> | ||
<WelcomeMessagePreview hideHeader /> | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button onClick={dismissOrgOnboardingPending}>Get Started</Button> | ||
</ModalFooter> | ||
</Modal> | ||
); | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use this localStorage item as a token, which the workspace list redeems in exchange for a modal with the organization join message.