mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 19:48:50 +03:00
Added recommendations as suggestions to the Button, Header, Email CTA cards (#18293)
closes https://github.com/TryGhost/Product/issues/3933
This commit is contained in:
parent
fd13712579
commit
a04c691fa0
@ -287,14 +287,22 @@ export default class KoenigLexicalEditor extends Component {
|
||||
};
|
||||
|
||||
const donationLink = () => {
|
||||
// TODO: remove feature condition once Tips & Donations have been released
|
||||
if (this.feature.tipsAndDonations) {
|
||||
if (this.settings.donationsEnabled) {
|
||||
return [{
|
||||
label: 'Tip or donation',
|
||||
value: '#/portal/support'
|
||||
}];
|
||||
}
|
||||
if (this.feature.tipsAndDonations && this.settings.donationsEnabled) {
|
||||
return [{
|
||||
label: 'Tip or donation',
|
||||
value: '#/portal/support'
|
||||
}];
|
||||
}
|
||||
|
||||
return [];
|
||||
};
|
||||
|
||||
const recommendationLink = () => {
|
||||
if (this.settings.recommendationsEnabled) {
|
||||
return [{
|
||||
label: 'Recommendations',
|
||||
value: '#/portal/recommendations'
|
||||
}];
|
||||
}
|
||||
|
||||
return [];
|
||||
@ -307,7 +315,7 @@ export default class KoenigLexicalEditor extends Component {
|
||||
};
|
||||
});
|
||||
|
||||
return [...defaults, ...memberLinks(), ...donationLink(), ...offersLinks];
|
||||
return [...defaults, ...memberLinks(), ...donationLink(), ...recommendationLink(), ...offersLinks];
|
||||
};
|
||||
|
||||
const fetchLabels = async () => {
|
||||
|
@ -55,7 +55,7 @@ export default class SettingsService extends Service.extend(ValidationEngine) {
|
||||
_loadSettings() {
|
||||
if (!this._loadingPromise) {
|
||||
this._loadingPromise = this.store
|
||||
.queryRecord('setting', {group: 'site,theme,private,members,portal,newsletter,email,amp,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations'})
|
||||
.queryRecord('setting', {group: 'site,theme,private,members,portal,newsletter,email,amp,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations,recommendations'})
|
||||
.then((settings) => {
|
||||
this._loadingPromise = null;
|
||||
return settings;
|
||||
|
@ -73,14 +73,18 @@ export default class KoenigCardButtonComponent extends Component {
|
||||
}]);
|
||||
}
|
||||
|
||||
// TODO: remove feature condition once Tips & Donations have been released
|
||||
if (this.feature.tipsAndDonations) {
|
||||
if (this.settings.donationsEnabled) {
|
||||
urls.push({
|
||||
name: 'Tip or donation',
|
||||
url: '#/portal/support'
|
||||
});
|
||||
}
|
||||
if (this.feature.tipsAndDonations && this.settings.donationsEnabled) {
|
||||
urls.push({
|
||||
name: 'Tip or donation',
|
||||
url: '#/portal/support'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.settings.recommendationsEnabled) {
|
||||
urls.push({
|
||||
name: 'Recommendations',
|
||||
url: '#/portal/recommendations'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.offers) {
|
||||
|
@ -97,14 +97,18 @@ export default class KoenigCardEmailCtaComponent extends Component {
|
||||
}]);
|
||||
}
|
||||
|
||||
// TODO: remove feature condition once Tips & Donations have been released
|
||||
if (this.feature.tipsAndDonations) {
|
||||
if (this.settings.donationsEnabled) {
|
||||
urls.push({
|
||||
name: 'Tip or donation',
|
||||
url: '#/portal/support'
|
||||
});
|
||||
}
|
||||
if (this.feature.tipsAndDonations && this.settings.donationsEnabled) {
|
||||
urls.push({
|
||||
name: 'Tip or donation',
|
||||
url: '#/portal/support'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.settings.recommendationsEnabled) {
|
||||
urls.push({
|
||||
name: 'Recommendations',
|
||||
url: '#/portal/recommendations'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.offers) {
|
||||
|
@ -86,14 +86,18 @@ export default class KoenigCardHeaderComponent extends Component {
|
||||
}]);
|
||||
}
|
||||
|
||||
// TODO: remove feature condition once Tips & Donations have been released
|
||||
if (this.feature.tipsAndDonations) {
|
||||
if (this.settings.donationsEnabled) {
|
||||
urls.push({
|
||||
name: 'Tip or donation',
|
||||
url: '#/portal/support'
|
||||
});
|
||||
}
|
||||
if (this.feature.tipsAndDonations && this.settings.donationsEnabled) {
|
||||
urls.push({
|
||||
name: 'Tip or donation',
|
||||
url: '#/portal/support'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.settings.recommendationsEnabled) {
|
||||
urls.push({
|
||||
name: 'Recommendations',
|
||||
url: '#/portal/recommendations'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.offers) {
|
||||
|
Loading…
Reference in New Issue
Block a user