Skip to content

Commit

Permalink
Merge pull request #666 from google/feature/auth-proxy
Browse files Browse the repository at this point in the history
Auth Proxy
  • Loading branch information
felixarntz authored Oct 22, 2019
2 parents 423ff84 + 7af152b commit 4574cfe
Show file tree
Hide file tree
Showing 53 changed files with 1,286 additions and 970 deletions.
6 changes: 3 additions & 3 deletions .storybook/storybook-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,10 @@ module.exports = [
},
},
{
id: 'setup--client-id',
id: 'setup--step-one',
kind: 'Setup',
name: 'Client ID',
story: 'Client ID',
name: 'Step One',
story: 'Step One',
parameters: {
fileName: './stories/setup.stories.js',
options: {
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ branches:
only:
- master
- develop
- datapoint-refactoring
- feature/auth-proxy

# Before install, failures in this section will result in build status 'errored'
before_install:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ class DashboardSplashApp extends Component {
__webpack_public_path__ = window.googlesitekit.publicPath;
}

const { proxySetupURL } = googlesitekit.admin;

if ( ! this.state.showAuthenticationSetupWizard && ! this.state.showModuleSetupWizard ) {
let introDescription, outroDescription, buttonLabel, onButtonClick;

Expand Down Expand Up @@ -150,7 +152,10 @@ class DashboardSplashApp extends Component {

let Setup = null;

if ( this.state.showAuthenticationSetupWizard ) {
// proxySetupURL is only set if the proxy is in use.
if ( proxySetupURL ) {
Setup = lazy( () => import( /* webpackChunkName: "chunk-googlesitekit-setup-wizard-proxy" */'../setup/setup-proxy' ) );
} else if ( this.state.showAuthenticationSetupWizard ) {
Setup = lazy( () => import( /* webpackChunkName: "chunk-googlesitekit-setup-wizard" */'../setup' ) );
} else {
Setup = lazy( () => import( /* webpackChunkName: "chunk-googlesitekit-setup-wrapper" */'../setup/setup-wrapper' ) );
Expand Down
79 changes: 11 additions & 68 deletions assets/js/components/settings/settings-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import Optin from 'GoogleComponents/optin';
import data, { TYPE_CORE } from 'GoogleComponents/data';
import {
clearAppLocalStorage,
moduleIcon,
getSiteKitAdminURL,
} from 'GoogleUtil';

Expand Down Expand Up @@ -88,12 +87,6 @@ class SettingsAdmin extends Component {
const {
dialogActive,
} = this.state;
const {
clientID,
clientSecret,
projectId,
projectUrl,
} = googlesitekit.admin;

return (
<Fragment>
Expand All @@ -118,8 +111,7 @@ class SettingsAdmin extends Component {
googlesitekit-heading-4
googlesitekit-settings-module__title
">
{ moduleIcon( 'logo-google-cloud', false, '24', '26', 'googlesitekit-settings-module__title-icon' ) }
{ __( 'API Credentials', 'google-site-kit' ) }
{ __( 'Plugin Status', 'google-site-kit' ) }
</h3>
</div>
<div className="
Expand All @@ -130,73 +122,24 @@ class SettingsAdmin extends Component {
mdc-layout-grid__cell--align-middle
mdc-layout-grid__cell--align-right-tablet
">
<p className="googlesitekit-settings-module__status">
{ __( 'Site Kit is connected', 'google-site-kit' ) }
<span className="
googlesitekit-settings-module__status-icon
googlesitekit-settings-module__status-icon--connected
">
<span className="screen-reader-text">
{ __( 'Connected', 'google-site-kit' ) }
</span>
</span>
</p>
</div>
<div className="
mdc-layout-grid__cell
mdc-layout-grid__cell--span-12
">
<div className="googlesitekit-settings-module__meta-items">
<div className="googlesitekit-settings-module__meta-item">
<p className="googlesitekit-settings-module__meta-item-type">
{ __( 'Client ID', 'google-site-kit' ) }
</p>
<h5 className="
googlesitekit-settings-module__meta-item-data
googlesitekit-settings-module__meta-item-data--wrap
">
{ clientID }
</h5>
</div>
<div className="googlesitekit-settings-module__meta-item">
<p className="googlesitekit-settings-module__meta-item-type">
{ __( 'Client Secret', 'google-site-kit' ) }
</p>
<h5 className="
googlesitekit-settings-module__meta-item-data
googlesitekit-settings-module__meta-item-data--wrap
<p className="googlesitekit-settings-module__status">
{ __( 'Site Kit is connected', 'google-site-kit' ) }
<span className="
googlesitekit-settings-module__status-icon
googlesitekit-settings-module__status-icon--connected
">
{ clientSecret }
</h5>
</div>
<span className="screen-reader-text">
{ __( 'Connected', 'google-site-kit' ) }
</span>
</span>
</p>
</div>
{ ( projectId && projectUrl ) &&
<div className="googlesitekit-settings-module__meta-items">
<div className="
googlesitekit-settings-module__meta-item
googlesitekit-settings-module__meta-item--nomargin
">
<p className="googlesitekit-settings-module__meta-item-type">
{ __( 'Project ID', 'google-site-kit' ) }
</p>
<h5 className="
googlesitekit-settings-module__meta-item-data
googlesitekit-settings-module__meta-item-data--wrap
">
{ projectId + ' ' }
<small>
<Link
href={ projectUrl }
inherit
external
>
{ __( 'Open in Google Cloud Platform', 'google-site-kit' ) }
</Link>
</small>
</h5>
</div>
</div>
}
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 4574cfe

Please sign in to comment.