Remove intro

[MAILPOET-2402]
This commit is contained in:
Pavel Dohnal
2019-09-30 14:45:13 +02:00
committed by Jack Kitterhing
parent 4fbf8ed7be
commit 8a5cd7c353
10 changed files with 0 additions and 218 deletions

View File

@ -19,10 +19,8 @@
@import 'components/pagesCustom';
@import 'components/premiumPage';
@import 'components/mp2migrator';
@import '../../../node_modules/intro.js/introjs';
@import 'components/newsletterTemplates';
@import 'components/welcomeWizard';
@import 'components/intro';
@import 'components/featureAnnouncement';
@import 'components/newsletterCongratulate.scss';
@import 'components/discounts';

View File

@ -1,83 +0,0 @@
.mailpoet-intro-active #adminmenuback {
z-index: auto;
}
#adminmenuwrap.introjs-fixParent {
position: absolute;
}
#adminmenu li.introjs-showElement {
background: inherit;
}
.introjs-helperLayer {
background-color: rgba(255, 255, 255, .7);
border: none;
border-radius: 3px;
}
.introjs-tooltip {
min-width: 240px;
&[style*='top:'] {
margin-top: -8px;
}
}
.introjs-tooltip .introjs-tooltipbuttons {
display: flex;
justify-content: flex-end;
}
.introjs-tooltip .button {
margin-top: 15px;
position: relative;
&:hover,
&:focus {
z-index: 1;
}
&:focus {
height: 100%;
margin-bottom: -1px;
&:after {
background: #5b9dd9;
bottom: 0;
content: '';
height: 1px;
left: 0;
position: absolute;
right: 0;
}
}
&.introjs-hidden {
display: none;
}
&.introjs-skipbutton:not(.introjs-donebutton) {
margin-right: auto;
+ .button {
margin-left: 10px;
}
}
&.introjs-donebutton {
order: 1;
}
&.introjs-prevbutton {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
&:not(.introjs-hidden) + .introjs-nextbutton,
&.introjs-donebutton {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
margin-left: -1px;
}
}

View File

@ -1 +0,0 @@
@import '../../../node_modules/intro.js/introjs-rtl';

View File

@ -1,92 +0,0 @@
import introJs from 'intro.js';
import MailPoet from 'mailpoet';
const getIntroSteps = () => {
const steps = [];
const segmentsMenuItem = document.querySelector('#toplevel_page_mailpoet-newsletters > ul > li > a[href*=mailpoet-segments]');
if (segmentsMenuItem) {
steps.push({
element: segmentsMenuItem.parentNode,
intro: MailPoet.I18n.t('introLists'),
});
}
const formMenuItem = document.querySelector('#toplevel_page_mailpoet-newsletters > ul > li > a[href*=mailpoet-forms]');
if (formMenuItem) {
steps.push({
element: formMenuItem.parentNode,
intro: MailPoet.I18n.t('introForms'),
});
}
steps.push({
element: '.mailpoet-chat',
intro: MailPoet.I18n.t('introChat'),
});
steps.push({
element: '#mailpoet-new-email',
intro: MailPoet.I18n.t('introEmails'),
});
return steps;
};
let introActive = false;
function Intro() {
if (introActive) {
return;
}
// don't show on small screens
if (window.innerWidth <= 960) {
return;
}
const intro = introJs();
intro.setOptions({
steps: getIntroSteps(),
nextLabel: `${MailPoet.I18n.t('introNext')}`,
prevLabel: `${MailPoet.I18n.t('introBack')}`,
skipLabel: MailPoet.I18n.t('introSkip'),
doneLabel: MailPoet.I18n.t('introDone'),
positionPrecedence: ['right', 'left', 'bottom', 'top'],
buttonClass: 'button',
hidePrev: true,
hideNext: true,
helperElementPadding: 12,
scrollToElement: false,
showStepNumbers: false,
tooltipPosition: 'auto',
});
intro.onafterchange((targetElement) => {
// fix for intro.js positioning bug on 'position: fixed' elements
if (getComputedStyle(targetElement).getPropertyValue('position') === 'fixed') {
const helperLayer = document.querySelector('.introjs-helperLayer');
const referenceLayer = document.querySelector('.introjs-tooltipReferenceLayer');
referenceLayer.style.top = `${parseInt(referenceLayer.style.top, 10) - window.pageYOffset}px`;
helperLayer.style.top = `${parseInt(helperLayer.style.top, 10) - window.pageYOffset}px`;
}
});
intro.onexit(() => {
introActive = false;
document.body.classList.remove('mailpoet-intro-active');
});
intro.onskip(() => {
// this is called also when "Done" button used
MailPoet.Ajax.post({
api_version: window.mailpoet_api_version,
endpoint: 'settings',
action: 'set',
data: {
show_intro: 0,
},
});
});
intro.start();
introActive = true;
document.body.classList.add('mailpoet-intro-active');
}
MailPoet.showIntro = Intro;

View File

@ -11,7 +11,6 @@ import 'settings/settings.jsx'; // side effect - renders ReactDOM to document
import 'forms/forms.jsx'; // side effect - renders ReactDOM to document
import 'settings/tabs.js'; // side effect - assigns to MailPoet.Router, executes code on doc ready
import 'help/help.jsx'; // side effect - renders ReactDOM to document
import 'intro.jsx'; // side effect - assigns to MailPoet.showIntro
import 'poll.jsx'; // side effect - assigns to MailPoet.Poll
import 'settings/reinstall_from_scratch.js'; // side effect - adds event handler to document
import 'subscribers/importExport/import.jsx'; // side effect - executes on doc ready, adds events

View File

@ -83,10 +83,6 @@ class Changelog {
}
private function setupNewInstallation() {
// ensure there was no MP2 migration (migration resets $version so it must be checked)
if ($this->settings->get(MP2Migrator::MIGRATION_STARTED_SETTING_KEY) === null) {
$this->settings->set('show_intro', true);
}
$this->settings->set('show_congratulate_after_first_newsletter', true);
$this->settings->set('show_poll_success_delivery_preview', true);
}

5
package-lock.json generated
View File

@ -6830,11 +6830,6 @@
"integrity": "sha1-ggzdWIuGj/sZGoCVBtbJyPISsbA=",
"dev": true
},
"intro.js": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/intro.js/-/intro.js-2.9.0.tgz",
"integrity": "sha512-8egYKQYUeMS2KPc0lGcM+D+XMCxB6HcKYtjsg4j84kiLS1BAnWRMEJ1KiIWwSrH2L02tTzafKUc2S2I5h6hWCg=="
},
"invariant": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz",

View File

@ -33,7 +33,6 @@
"handlebars": "^4.1.2",
"html2canvas": "^1.0.0-alpha.12",
"interact.js": "~1.2.8",
"intro.js": "2.9.0",
"jquery": "3.4.0",
"moment": "^2.22.1",
"mousetrap": "^1.6.3",

View File

@ -332,15 +332,6 @@
'selectAutomaticEmailsEventsHeading': __('Select %$1s events'),
'cronNotAccessibleNotice': __('Oops! There seems to be an issue with the sending on your website. [link]See our guide[/link] to solve this yourself.'),
'introLists': __('Welcome on board. Lets get you started quickly. Here, you can create new lists.'),
'introForms': __('Create a form and add it to your website so your visitors can subscribe to your list.'),
'introChat': __('You have a question? Start a chat or send a message to get an answer from our support team.'),
'introEmails': __('We suggest you begin by creating a newsletter, a welcome email or a post notification. Enjoy!'),
'introNext': _x('Next', 'A label on a button'),
'introBack': _x('Back', 'A label on a button'),
'introSkip': _x('Skip', 'A label on a button'),
'introDone': _x('Done', 'A label on a button'),
'whatsNew': __("Whats new"),
'updateMailPoetNotice': __('[link]Update MailPoet[/link] to see the latest changes'),
@ -403,22 +394,3 @@
<% block after_translations %>
<%= do_action('mailpoet_newsletters_translations_after') %>
<% endblock %>
<% block after_javascript %>
<% if settings.show_intro %>
<script>
const initIntro = () => {
const beacon = document.querySelector('#beacon-container iframe');
if (beacon) {
beacon.classList.add('mailpoet-chat');
MailPoet.showIntro();
} else {
setTimeout(initIntro, 200);
}
};
document.addEventListener('DOMContentLoaded', function(){
initIntro();
}, false);
</script>
<% endif %>
<% endblock %>

View File

@ -52,7 +52,6 @@ const baseConfig = {
'papaparse': 'papaparse/papaparse.min.js',
'html2canvas': 'html2canvas/dist/html2canvas.js',
'asyncqueue': 'vendor/jquery.asyncqueue.js',
'intro.js': 'intro.js/intro.js',
},
},
node: {