From 4491d985fc8ffed276872ea2689705326543e747 Mon Sep 17 00:00:00 2001
From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com>
Date: Mon, 31 Jul 2023 11:31:34 -0700
Subject: [PATCH] fix: move the 'if Scratch Link is not running' advice into
the Troubleshooting section
---
.../extension-troubleshooting.jsx | 30 ++++++++++++++-----
.../install-scratch-link.jsx | 5 ----
src/l10n.json | 5 ++--
src/views/boost/boost.jsx | 5 +++-
src/views/download/scratch-link/download.jsx | 1 +
src/views/ev3/ev3.jsx | 1 +
src/views/gdxfor/gdxfor.jsx | 1 +
src/views/microbit/microbit.jsx | 5 +++-
src/views/wedo2/wedo2.jsx | 5 +++-
9 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/src/components/extension-landing/extension-troubleshooting.jsx b/src/components/extension-landing/extension-troubleshooting.jsx
index 7e168f1fa..737ce4505 100644
--- a/src/components/extension-landing/extension-troubleshooting.jsx
+++ b/src/components/extension-landing/extension-troubleshooting.jsx
@@ -4,6 +4,9 @@ const React = require('react');
const ExtensionSection = require('./extension-section.jsx');
+const OS_ENUM = require('../../lib/os-enum.js');
+const {isDownloaded} = require('../install-scratch/install-util.js');
+
// TODO: after the Scratch Conference 2022, migrate from the individual extension landing pages all the
// troubleshooting steps which are common to all extensions.
const ExtensionTroubleshooting = props => {
@@ -17,14 +20,24 @@ const ExtensionTroubleshooting = props => {
id="extensions.troubleshootingTitle"
values={sharedValues}
/>
-
-
+ {(isDownloaded(props.currentOS)) && (
+
+
+
+
)}
{props.children}
{!props.scratchLinkOnly && (
@@ -44,6 +57,7 @@ const ExtensionTroubleshooting = props => {
ExtensionTroubleshooting.propTypes = {
children: PropTypes.node,
+ currentOS: PropTypes.string.isRequired,
deviceName: PropTypes.string.isRequired,
deviceNameShort: PropTypes.string,
scratchLinkOnly: PropTypes.bool
diff --git a/src/components/extension-landing/install-scratch-link.jsx b/src/components/extension-landing/install-scratch-link.jsx
index 9c6418b6a..a50354436 100644
--- a/src/components/extension-landing/install-scratch-link.jsx
+++ b/src/components/extension-landing/install-scratch-link.jsx
@@ -75,11 +75,6 @@ const InstallScratchLink = ({
}-toolbar.png`}
/>
-
-
+
{isDownloaded(this.state.OS) && (
diff --git a/src/views/download/scratch-link/download.jsx b/src/views/download/scratch-link/download.jsx
index 94e7e4c0e..5cff4263c 100644
--- a/src/views/download/scratch-link/download.jsx
+++ b/src/views/download/scratch-link/download.jsx
@@ -103,6 +103,7 @@ const ScratchLink = ({intl}) => {
diff --git a/src/views/ev3/ev3.jsx b/src/views/ev3/ev3.jsx
index 539ab33ad..37aba205f 100644
--- a/src/views/ev3/ev3.jsx
+++ b/src/views/ev3/ev3.jsx
@@ -283,6 +283,7 @@ class EV3 extends ExtensionLanding {
diff --git a/src/views/gdxfor/gdxfor.jsx b/src/views/gdxfor/gdxfor.jsx
index ecd0f1b48..f10c506bb 100644
--- a/src/views/gdxfor/gdxfor.jsx
+++ b/src/views/gdxfor/gdxfor.jsx
@@ -207,6 +207,7 @@ class GdxFor extends ExtensionLanding {
diff --git a/src/views/microbit/microbit.jsx b/src/views/microbit/microbit.jsx
index c53b3f6f7..c2ba778ab 100644
--- a/src/views/microbit/microbit.jsx
+++ b/src/views/microbit/microbit.jsx
@@ -319,7 +319,10 @@ class MicroBit extends ExtensionLanding {
-
+
{isDownloaded(this.state.OS) && (
diff --git a/src/views/wedo2/wedo2.jsx b/src/views/wedo2/wedo2.jsx
index c42e52ec9..18138b52d 100644
--- a/src/views/wedo2/wedo2.jsx
+++ b/src/views/wedo2/wedo2.jsx
@@ -192,7 +192,10 @@ class Wedo2 extends ExtensionLanding {
/>
-
+
{isDownloaded(this.state.OS) && (