mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Collected Offer CRUD actions
refs https://github.com/TryGhost/Toolbox/issues/356 - this allows collection of CRUD events for Offers but we currently don't show them in the UI until it's overhauled to avoid being monotonously long
This commit is contained in:
parent
74e6b4bcf7
commit
9bdba0250a
@ -26,7 +26,7 @@ export default class AuditLogEventFilter extends Helper {
|
||||
filterParts.push(`event:-[${excludedEventsArray.join(',')}]`);
|
||||
}
|
||||
|
||||
const IGNORED_RESOURCES = ['product'];
|
||||
const IGNORED_RESOURCES = ['offer', 'product'];
|
||||
const excludedResourcesArray = Array.from(excludedResourcesSet).concat(IGNORED_RESOURCES).reject(isBlank);
|
||||
if (excludedResourcesArray.length > 0) {
|
||||
filterParts.push(`resource_type:-[${excludedResourcesArray.join(',')}]`);
|
||||
|
@ -54,6 +54,15 @@ function getLinkTarget(ev) {
|
||||
route: 'settings.integration',
|
||||
models: [ev.resource.id]
|
||||
};
|
||||
case 'offer':
|
||||
if (!ev.resource.id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
route: 'offer',
|
||||
models: [ev.resource.id]
|
||||
};
|
||||
case 'tag':
|
||||
if (!ev.resource.slug) {
|
||||
return null;
|
||||
|
@ -3,6 +3,9 @@ const ghostBookshelf = require('./base');
|
||||
const Offer = ghostBookshelf.Model.extend({
|
||||
tableName: 'offers',
|
||||
|
||||
actionsCollectCRUD: true,
|
||||
actionsResourceType: 'offer',
|
||||
|
||||
product() {
|
||||
return this.belongsTo('Product', 'product_id', 'id');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user