-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[dashboard] Welcome existing users to new updates #3618
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
Merged
Merged
Changes from all commits
Commits
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 hidden or 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 hidden or 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 hidden or 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,75 @@ | ||
/** | ||
* Copyright (c) 2021 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 { User } from "@gitpod/gitpod-protocol"; | ||
import { useContext } from "react"; | ||
import Modal from "./components/Modal"; | ||
import { getGitpodService } from "./service/service"; | ||
import { UserContext } from "./user-context"; | ||
|
||
const news = 'April-2021'; | ||
export function shouldSeeWhatsNew(user: User): boolean { | ||
const whatsNewSeen = user?.additionalData?.whatsNewSeen; | ||
return user.creationDate <= '2021-04-08' && (!whatsNewSeen || !whatsNewSeen[news]); | ||
} | ||
|
||
export function WhatsNew(props: { visible: boolean, onClose: () => void }) { | ||
const {user, setUser} = useContext(UserContext); | ||
const internalClose = async (switchToCode?: boolean) => { | ||
if (!user) { | ||
return; | ||
} | ||
const additionalData = user.additionalData || {}; | ||
additionalData.whatsNewSeen = { | ||
...additionalData.whatsNewSeen, | ||
[news]: new Date().toISOString() | ||
} | ||
if (switchToCode) { | ||
const ideSettings = additionalData.ideSettings || {}; | ||
ideSettings.defaultIde = 'code'; | ||
} | ||
await getGitpodService().server.updateLoggedInUser({ | ||
additionalData | ||
}); | ||
setUser(user); | ||
props.onClose(); | ||
} | ||
return <Modal visible={props.visible} onClose={internalClose}> | ||
<h3 className="pb-4">What's New 🎁</h3> | ||
<div className="border-t border-gray-200 -mx-6 px-6 py-4"> | ||
<p className="pb-2 text-gray-900 text-base font-medium">New Dashboard</p> | ||
<p className="pb-2 text-gray-500 text-sm">We have made some layout changes on the dashboard to improve the overall user experience of the product.</p> | ||
</div> | ||
<div className="border-t border-b border-gray-200 -mx-6 px-6 py-4"> | ||
<p className="pb-2 text-gray-900 text-base font-medium">VS Code</p> | ||
<p className="pb-4 text-gray-500 text-sm">We are changing the default IDE to VS Code.</p> | ||
<ol className="pb-2 text-gray-500 text-sm list-outside list-decimal space-y-2"> | ||
<li className="ml-5"> | ||
<div> | ||
<p className="text-gray-500 text-sm">We're preserving all <span className="font-bold">user settings and extensions</span>.</p> | ||
<p className="text-gray-400 text-sm">Extensions you have manually uploaded are not transfered. You'll need to search and install those extensions through the extension panel in VS Code.</p> | ||
</div> | ||
</li> | ||
<li className="ml-5"> | ||
<div> | ||
<p className="text-gray-500 text-sm">We've reduced the number of <span className="font-bold">pre-installed extensions</span>.</p> | ||
<p className="text-gray-400 text-sm">The Theia-based editor included pre-installed extensions for the most popular programming languages which was convenienvt for starters but added additional bloat. You can now install any extensions you need and leave out those you don't.</p> | ||
</div> | ||
</li> | ||
<li className="ml-5"> | ||
<div> | ||
<p className="text-gray-500 text-sm">You can still <span className="font-bold">switch the editor</span> to Theia.</p> | ||
<p className="text-gray-400 text-sm">In case you run into trouble with the new IDE, you can go to the settings and switch back to the Theia-based editor.</p> | ||
</div> | ||
</li> | ||
</ol> | ||
</div> | ||
<div className="flex justify-end mt-6"> | ||
<button className="secondary" onClick={() => internalClose()}>Dismiss</button> | ||
<button className="ml-2" onClick={() => internalClose(true)} >Continue</button> | ||
</div> | ||
</Modal> | ||
} |
This file contains hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.