Merge pull request #3569 from apple502j/remove-flag

Remove app flag
This commit is contained in:
chrisgarrity 2020-04-22 07:28:11 -04:00 committed by GitHub
commit 8d385afa44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 100 deletions

View file

@ -4,8 +4,6 @@ const React = require('react');
const FlexRow = require('../../components/flex-row/flex-row.jsx');
const {CHROME_APP_RELEASED} = require('../../lib/feature-flags.js');
require('./extension-landing.scss');
const ExtensionRequirements = props => (
@ -30,24 +28,22 @@ const ExtensionRequirements = props => (
/>
macOS 10.13+
</span>
{CHROME_APP_RELEASED && (
<React.Fragment>
<span>
<img
alt=""
src="/svgs/extensions/chromeos.svg"
/>
ChromeOS
</span>
<span>
<img
alt=""
src="/svgs/extensions/android.svg"
/>
Android 6.0+
</span>
</React.Fragment>
)}
<React.Fragment>
<span>
<img
alt=""
src="/svgs/extensions/chromeos.svg"
/>
ChromeOS
</span>
<span>
<img
alt=""
src="/svgs/extensions/android.svg"
/>
Android 6.0+
</span>
</React.Fragment>
<span>
<img src="/svgs/extensions/bluetooth.svg" />
Bluetooth

View file

@ -3,7 +3,6 @@ const FormattedMessage = require('react-intl').FormattedMessage;
const React = require('react');
const OS_ENUM = require('../../lib/os-enum.js');
const {CHROME_APP_RELEASED} = require('../../lib/feature-flags.js');
const {isDownloaded, isFromGooglePlay} = require('./install-util.js');
@ -27,24 +26,10 @@ const InstallScratch = ({
<div className="blue install-scratch">
<FlexRow className="inner column">
<h2 className="title">
{CHROME_APP_RELEASED ? (
<FormattedMessage
id="installScratch.appHeaderTitle"
values={{operatingsystem: currentOS}}
/>
) : (
<React.Fragment>
{isDownloaded(currentOS) && (
<FormattedMessage id="installScratch.desktopHeaderTitle" />
)}
{isFromGooglePlay(currentOS) && (
<FormattedMessage
id="installScratch.appHeaderTitle"
values={{operatingsystem: currentOS}}
/>
)}
</React.Fragment>
)}
<FormattedMessage
id="installScratch.appHeaderTitle"
values={{operatingsystem: currentOS}}
/>
</h2>
<Steps>
<div className="step">
@ -56,14 +41,12 @@ const InstallScratch = ({
<React.Fragment>
{currentOS === OS_ENUM.WINDOWS && (
<FormattedMessage
id={CHROME_APP_RELEASED ? 'installScratch.getScratchAppWindows' :
'installScratch.downloadScratchDesktop'}
id="installScratch.getScratchAppWindows"
/>
)}
{currentOS === OS_ENUM.MACOS && (
<FormattedMessage
id={CHROME_APP_RELEASED ? 'installScratch.getScratchAppMacOs' :
'installScratch.downloadScratchDesktop'}
id="installScratch.getScratchAppMacOs"
/>
)}
{isFromGooglePlay(currentOS) && (

View file

@ -4,8 +4,6 @@ const FormattedMessage = require('react-intl').FormattedMessage;
const PropTypes = require('prop-types');
const React = require('react');
const {CHROME_APP_RELEASED} = require('../../lib/feature-flags.js');
const FlexRow = require('../../components/flex-row/flex-row.jsx');
const Button = require('../../components/forms/button.jsx');
@ -35,28 +33,24 @@ const OSChooser = props => (
<img src="/svgs/extensions/mac.svg" />
macOS
</Button>
{CHROME_APP_RELEASED && (
<React.Fragment>
<Button
className={classNames({active: props.currentOS === OS_ENUM.CHROMEOS})}
onClick={() => // eslint-disable-line react/jsx-no-bind
props.handleSetOS(OS_ENUM.CHROMEOS)
}
>
<img src="/svgs/extensions/chromeos.svg" />
ChromeOS
</Button>
<Button
className={classNames({active: props.currentOS === OS_ENUM.ANDROID})}
onClick={() => // eslint-disable-line react/jsx-no-bind
props.handleSetOS(OS_ENUM.ANDROID)
}
>
<img src="/svgs/extensions/android.svg" />
Android
</Button>
</React.Fragment>
)}
<Button
className={classNames({active: props.currentOS === OS_ENUM.CHROMEOS})}
onClick={() => // eslint-disable-line react/jsx-no-bind
props.handleSetOS(OS_ENUM.CHROMEOS)
}
>
<img src="/svgs/extensions/chromeos.svg" />
ChromeOS
</Button>
<Button
className={classNames({active: props.currentOS === OS_ENUM.ANDROID})}
onClick={() => // eslint-disable-line react/jsx-no-bind
props.handleSetOS(OS_ENUM.ANDROID)
}
>
<img src="/svgs/extensions/android.svg" />
Android
</Button>
</FlexRow>
</div>
);

View file

@ -141,10 +141,7 @@
"installScratch.or": "or",
"installScratch.directDownload": "Direct download",
"installScratch.desktopHeaderTitle": "Install Scratch Desktop",
"installScratch.appHeaderTitle": "Install the Scratch app for {operatingsystem}",
"installScratch.downloadScratchDesktop": "Download Scratch Desktop",
"installScratch.downloadScratchAppGeneric": "Download Scratch for {operatingsystem}",
"installScratch.getScratchAppPlay": "Get the Scratch app on the Google Play Store",
"installScratch.getScratchAppMacOs": "Get the Scratch app on the Mac App Store",
"installScratch.getScratchAppWindows": "Get the Scratch app on the Microsoft Store",

View file

@ -1,6 +1,5 @@
import bowser from 'bowser';
import OS_ENUM from './os-enum.js';
import {CHROME_APP_RELEASED} from './feature-flags.js';
/**
* Helper function to the current Operating System.
@ -9,10 +8,8 @@ import {CHROME_APP_RELEASED} from './feature-flags.js';
export default function () {
// matching OS strings from https://github.com/lancedikson/bowser/blob/master/src/constants.js
if (bowser.osname === 'macOS') return OS_ENUM.MACOS;
if (CHROME_APP_RELEASED) {
if (bowser.osname === 'Chrome OS') return OS_ENUM.CHROMEOS;
if (bowser.osname === 'Android') return OS_ENUM.ANDROID;
}
if (bowser.osname === 'Chrome OS') return OS_ENUM.CHROMEOS;
if (bowser.osname === 'Android') return OS_ENUM.ANDROID;
// if (bowser.osname === 'iOS') return OS_ENUM.IOS; // @todo
return OS_ENUM.WINDOWS;
}

View file

@ -8,6 +8,5 @@ const flagInUrl = flag => {
};
module.exports = {
CHROME_APP_RELEASED: true,
CONTACT_US_POPUP: isStaging() && flagInUrl('CONTACT_US_POPUP')
};

View file

@ -10,7 +10,6 @@ const Page = require('../../components/page/www/page.jsx');
const render = require('../../lib/render.jsx');
const detectOS = require('../../lib/detect-os.js').default;
const OS_ENUM = require('../../lib/os-enum.js');
const {CHROME_APP_RELEASED} = require('../../lib/feature-flags.js');
const OSChooser = require('../../components/os-chooser/os-chooser.jsx');
const InstallScratch = require('../../components/install-scratch/install-scratch.jsx');
const {isDownloaded, isFromGooglePlay} = require('../../components/install-scratch/install-util.js');
@ -52,14 +51,12 @@ class Download extends React.Component {
width="40"
/>
<FormattedMessage
id={CHROME_APP_RELEASED ? 'download.appTitle' :
'download.title'}
id="download.appTitle"
/>
</h1>
<span className="download-description">
<FormattedMessage
id={CHROME_APP_RELEASED ? 'download.appIntro' :
'download.intro'}
id="download.appIntro"
/>
</span>
</FlexRow>
@ -82,24 +79,20 @@ class Download extends React.Component {
/>
macOS 10.13+
</span>
{CHROME_APP_RELEASED && (
<React.Fragment>
<span>
<img
alt=""
src="/svgs/extensions/chromeos.svg"
/>
<span>
<img
alt=""
src="/svgs/extensions/chromeos.svg"
/>
ChromeOS
</span>
<span>
<img
alt=""
src="/svgs/extensions/android.svg"
/>
</span>
<span>
<img
alt=""
src="/svgs/extensions/android.svg"
/>
Android 6.0+
</span>
</React.Fragment>
)}
</span>
</FlexRow>
</FlexRow>
</FlexRow>

View file

@ -1,6 +1,4 @@
{
"download.title": "Scratch Desktop",
"download.intro": "You can install the Scratch Desktop editor to work on projects without an internet connection. This version will work on Windows and MacOS.",
"download.appTitle": "Download the Scratch App",
"download.appIntro": "Would you like to create and save Scratch projects without an internet connection? Download the free Scratch app.",
"download.requirements": "Requirements",
@ -23,7 +21,7 @@
"download.macMoveToApplications" : "Open the .dmg file. Move Scratch Desktop into Applications.",
"download.winMoveToApplications" : "Run the .exe file.",
"download.doIHaveToDownload" : "Do I have to download an app to use Scratch?",
"download.doIHaveToDownloadAnswer" : "No. You can also use the Scratch project editor in any web browser on any device by going to scratch.mit.edu and clicking \"Create\".",
"download.doIHaveToDownloadAnswer" : "No. You can also use the Scratch project editor in most web browsers on most devices by going to scratch.mit.edu and clicking \"Create\".",
"download.canIUseScratchLink" : "Can I use Scratch Link to connect to extensions?",
"download.canIUseScratchLinkAnswer" : "Yes. However, you will need an Internet connection to use Scratch Link.",
"download.canIUseExtensions" : "Can I connect to hardware extensions?",