Skip to content
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

Enhancement/2468 svg replacing images #2834

Merged
merged 49 commits into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1580273
Add google icon php class.
Feb 20, 2021
e8663b6
Add Google icon as svg.
Feb 20, 2021
36d4a43
Replace rocket.png with placeholder rocket.svg.
Feb 20, 2021
03fe76c
Replace sun small png with svg.
Feb 21, 2021
87eac6c
Replace thumbs up image with svg.
Feb 21, 2021
a1eaf86
Remove image properties from legacy Notification component.
Feb 21, 2021
4397814
Replace legacy dashboard-module-arts winImage with WinImageSVG.
Feb 21, 2021
e64784c
Remove deprecated image arg.
Feb 21, 2021
1d039b8
Remove unused params from test.
Feb 21, 2021
160016e
Remove allImagesLoaded.
Feb 21, 2021
3958261
Remove imagemin.
Feb 21, 2021
6b75afc
Remove imagemin from webpack.
Feb 21, 2021
3504aeb
Update svg files.
Feb 22, 2021
dd4955e
Revert "Remove imagemin."
Feb 22, 2021
4dd98eb
Revert "Remove imagemin from webpack."
Feb 22, 2021
d1d51f4
Replace colour via php.
Feb 23, 2021
78e3b12
Merge branch 'develop' into enhancement/2468-svg-replacing-images.
Feb 23, 2021
cfe2673
Remove imagemin dependencies.
Feb 23, 2021
15121d3
Remove imagemin scripts.
Feb 23, 2021
85d82fd
Update reference images.
Feb 23, 2021
d3d0223
Update assets/js/components/legacy-notifications/dashboard-modules-al…
tofumatt Feb 23, 2021
48a6401
Update assets/js/components/legacy-notifications/notification.js
ivankruchkoff Feb 25, 2021
953fb9a
Update assets/js/components/legacy-notifications/notification.js
ivankruchkoff Feb 25, 2021
885a1f0
Update includes/Core/Admin/Screen.php
ivankruchkoff Feb 25, 2021
8fa5f2e
Update includes/Core/Util/Google_Icon.php
ivankruchkoff Feb 25, 2021
a21e592
Update includes/Core/Util/Google_Icon.php
ivankruchkoff Feb 25, 2021
abed585
Update includes/Core/Util/Google_Icon.php
ivankruchkoff Feb 25, 2021
2e264b0
Update dimensions on rocket.
Feb 25, 2021
1adf6ff
Update includes/Core/Admin/Screen.php
ivankruchkoff Feb 25, 2021
a75afc1
Update rocket image.
Feb 26, 2021
d1e3f86
Update svg css and reference images.
Feb 26, 2021
2502ef0
Set sunsmall svg as the image.
Feb 26, 2021
5c25465
Account for different fill colours and update icon.
Feb 26, 2021
45df755
Update includes/Core/Util/Google_Icon.php
ivankruchkoff Feb 26, 2021
5baeeb8
Update includes/Core/Util/Google_Icon.php
ivankruchkoff Feb 26, 2021
7dc1eb3
Update variable.
Feb 26, 2021
9a524fc
Use older version of npm for lockfile v1.
Feb 26, 2021
bf8eace
Update package-lock with older version of npm.
Feb 26, 2021
6f76bed
Exclude rule for medium screen.
Mar 1, 2021
cbeb8a1
Update reference image.
Mar 1, 2021
0a83d76
Update assets/sass/components/global/_googlesitekit-publisher-wins.scss
ivankruchkoff Mar 2, 2021
4e07c85
Merge branch 'develop' into enhancement/2468-svg-replacing-images.
Mar 3, 2021
54b3fa4
Update package lock.
Mar 3, 2021
f2918a6
Upse get_current_screen to determine whether we are on a googlesiteki…
Mar 3, 2021
86e9a12
Update includes/Core/Admin/Screen.php
ivankruchkoff Mar 4, 2021
c08a18b
Merge branch 'develop' into enhancement/2468-svg-replacing-images.
Mar 4, 2021
373c8c0
Bail on non array $menu.
Mar 4, 2021
574bb2d
Update svg to align with other icons.
Mar 4, 2021
808631a
Update svg dimensions to match current icon.
aaemnnosttv Mar 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@
s.parentNode.insertBefore( wf, s );
} )();

const allImagesLoaded = new Promise( ( resolve ) => {
// Wait for the document to completely finish loading before checking for images.
window.addEventListener( 'load', () => {
imagesLoaded( '.googlesitekit-plugin-preview', { background: true }, resolve );
} );
} );

Promise.all( [
webFontsLoaded,
allImagesLoaded,
] ).then( () => {
// Signal Backstop that the environment is ready to go.
document.body.classList.add( 'backstopjs-ready' );
Expand Down
Binary file removed assets/images/logo-g_white_small.png
Binary file not shown.
Binary file removed assets/images/rocket.png
Binary file not shown.
Binary file removed assets/images/sun-small.png
Binary file not shown.
Binary file removed assets/images/thumbs-up.png
Binary file not shown.
2 changes: 2 additions & 0 deletions assets/js/components/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { Component, Fragment } from '@wordpress/element';
*/
import data, { TYPE_MODULES } from './data';
import Notification from './legacy-notifications/notification';
import SunSmallSVG from '../../svg/sun-small.svg';

class Alert extends Component {
constructor( props ) {
Expand Down Expand Up @@ -82,6 +83,7 @@ class Alert extends Component {
key={ item.id }
title={ item.title }
description={ item.message || item.description }
WinImageSVG={ SunSmallSVG }
dismiss={ __( 'Dismiss', 'google-site-kit' ) }
isDismissable={ item.isDismissible }
format="small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class DashboardModulesAlerts extends Component {
title={ notification.title || '' }
description={ notification.description || '' }
blockData={ notification.blockData || [] }
winImage={ notification.winImage ? `${ global._googlesitekitLegacyData.admin.assetsRoot }images/${ notification.winImage }` : '' }
WinImageSVG={ notification.WinImageSVG }
format={ notification.format || 'small' }
learnMoreURL={ notification.learnMoreURL || '' }
learnMoreDescription={ notification.learnMoreDescription || '' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { applyFilters } from '@wordpress/hooks';
import { getQueryParameter, getModulesData } from '../../util';
import Notification from './notification';
import ModulesList from '../ModulesList';
import rocketImage from '../../../images/rocket.png';
import RocketImageSVG from '../../../svg/rocket.svg';
import UserInputSuccessNotification from '../notifications/UserInputSuccessNotification';

class DashboardSetupAlerts extends Component {
Expand Down Expand Up @@ -82,7 +82,7 @@ class DashboardSetupAlerts extends Component {
title={ sprintf( __( 'Congrats on completing the setup for %s!', 'google-site-kit' ), winData.setupTitle ) }
description={ winData.description }
handleDismiss={ () => {} }
winImage={ global._googlesitekitLegacyData.admin.assetsRoot + rocketImage }
WinImageSVG={ RocketImageSVG }
dismiss={ __( 'OK, Got it!', 'google-site-kit' ) }
format="large"
type="win-success"
Expand Down
10 changes: 2 additions & 8 deletions assets/js/components/legacy-notifications/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,8 @@ class Notification extends Component {
title,
description,
blockData,
winImage,
WinImageSVG,
SmallImageSVG,
smallImage,
format,
learnMoreURL,
learnMoreDescription,
Expand Down Expand Up @@ -302,12 +300,11 @@ class Notification extends Component {
</div>
}

{ ( smallImage || SmallImageSVG ) &&
{ SmallImageSVG &&
<div className="
mdc-layout-grid__cell
mdc-layout-grid__cell--span-1
">
{ smallImage && <img className="googlesitekit-publisher-win__small-image" alt="" src={ smallImage } /> }
{ SmallImageSVG && <SmallImageSVG /> }
</div>
}
Expand Down Expand Up @@ -352,7 +349,7 @@ class Notification extends Component {

</div>

{ ( winImage || WinImageSVG ) &&
{ WinImageSVG &&
<div className="
mdc-layout-grid__cell
mdc-layout-grid__cell--order-1-phone
Expand All @@ -361,7 +358,6 @@ class Notification extends Component {
mdc-layout-grid__cell--span-4-desktop
">
<div className="googlesitekit-publisher-win__image-large">
{ winImage && <img alt="" src={ winImage } /> }
{ WinImageSVG && <WinImageSVG /> }
</div>
</div>
Expand Down Expand Up @@ -394,9 +390,7 @@ Notification.propTypes = {
learnMoreDescription: PropTypes.string,
learnMoreLabel: PropTypes.string,
blockData: PropTypes.array,
winImage: PropTypes.string,
WinImageSVG: PropTypes.elementType,
smallImage: PropTypes.string,
SmallImageSVG: PropTypes.elementType,
format: PropTypes.string,
ctaLink: PropTypes.string,
Expand Down
4 changes: 2 additions & 2 deletions assets/js/components/settings/SettingsModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import Notification from '../legacy-notifications/notification';
import SettingsModule from './settings-module';
import SettingsOverlay from './SettingsOverlay';
import { isPermissionScopeError } from '../../util/errors';
import thumbsUpImage from '../../../images/thumbs-up.png';
import ThumbsUpSVG from '../../../svg/thumbs-up.svg';

class SettingsModules extends Component {
constructor( props ) {
Expand Down Expand Up @@ -288,7 +288,7 @@ class SettingsModules extends Component {
title={ __( 'Congrats, you’ve connected all services!', 'google-site-kit' ) }
description={ __( 'We’re working on adding new services to Site Kit by Google all the time, so please check back in the future.', 'google-site-kit' ) }
format="small"
smallImage={ global._googlesitekitLegacyData.admin.assetsRoot + thumbsUpImage }
SmallImageSVG={ ThumbsUpSVG }
type="win-success"
/>
</div>
Expand Down
3 changes: 0 additions & 3 deletions assets/js/googlesitekit-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ import {
clearWebStorage,
} from './util/standalone';

// Load image for the parent menu item.
import '../images/logo-g_white_small.png';

if ( 'toplevel_page_googlesitekit-dashboard' !== global.pagenow && 'site-kit_page_googlesitekit-splash' !== global.pagenow && 'admin_page_googlesitekit-splash' !== global.pagenow && global.localStorage ) {
// The total notifications count should always rely on local storage
// directly for external availability.
Expand Down
Loading