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

Site Activity: adds contextual popover menu item to add site credentials #40014

Merged
merged 3 commits into from
Mar 10, 2020
Merged
Changes from all commits
Commits
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
21 changes: 20 additions & 1 deletion client/my-sites/activity/activity-log-item/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,15 @@ class ActivityLogItem extends Component {

renderRewindAction() {
const {
activity,
canAutoconfigure,
createBackup,
createRewind,
disableRestore,
disableBackup,
activity,
siteId,
siteSlug,
trackAddCreds,
translate,
} = this.props;

Expand All @@ -255,6 +259,20 @@ class ActivityLogItem extends Component {
{ translate( 'Restore to this point' ) }
</PopoverMenuItem>

{ disableRestore && (
<PopoverMenuItem
icon="plus"
href={
canAutoconfigure
? `/start/rewind-auto-config/?blogid=${ siteId }&siteSlug=${ siteSlug }`
: `/settings/security/${ siteSlug }`
}
onClick={ trackAddCreds }
>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add some analytics to this new link?

{ translate( 'Add server credentials to enable restoring' ) }
</PopoverMenuItem>
) }

<PopoverMenuSeparator />

<PopoverMenuItem
Expand Down Expand Up @@ -471,6 +489,7 @@ const mapDispatchToProps = ( dispatch, { activity: { activityId }, siteId } ) =>
dispatch(
recordTracksEvent( 'calypso_activitylog_event_get_help', { activity_name: activityName } )
),
trackAddCreds: () => dispatch( recordTracksEvent( 'calypso_activitylog_event_add_credentials' ) ),
trackFixCreds: () => dispatch( recordTracksEvent( 'calypso_activitylog_event_fix_credentials' ) ),
} );

Expand Down