-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unsupported notification if accessing Code Eval from non-micro:bi…
…t targets (#10357) * Disallow web crawlers from going to --eval * Unify places that need a "home URL" * Show unsupported experience modal in teacher tool if in the wrong target
- Loading branch information
Showing
9 changed files
with
78 additions
and
42 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# robots.txt for PXT sites | ||
# robots.txt for PXT sites (except micro:bit) | ||
|
||
# Disable crawling in /v2 path for micro:bit | ||
# Disable crawling in /v2 & /--eval | ||
User-agent: * | ||
Disallow: /v2 | ||
Disallow: /v2 | ||
Disallow: /--eval |
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
30 changes: 30 additions & 0 deletions
30
react-common/components/experiences/UnsupportedExperienceModal.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,30 @@ | ||
/// <reference path="../types.d.ts" /> | ||
|
||
import { Modal, ModalAction } from "../controls/Modal"; | ||
|
||
/** | ||
* A modal that displays a message when the specified experience is not supported | ||
* by the current target. Contains a button to return to the home page and no dismiss. | ||
*/ | ||
export const UnsupportedExperienceModal = () => { | ||
function fireGoBackTick() { | ||
pxt.tickEvent("unsupportedexperience.goback"); | ||
} | ||
|
||
const homeUrl = pxt.U.getHomeUrl(); | ||
|
||
const goBackAction: ModalAction = { | ||
label: lf("Go Back"), | ||
onClick: fireGoBackTick, | ||
className: "primary", | ||
url: homeUrl | ||
} | ||
|
||
return ( | ||
<Modal title={lf("Unsupported Experience")} hideDismissButton={true} actions={[goBackAction]}> | ||
<div className="ui unsupported-modal-content"> | ||
<p>{lf("The current experience is not supported in {0}.", pxt.appTarget.nickname || pxt.appTarget.id)}</p> | ||
</div> | ||
</Modal> | ||
); | ||
}; |
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