Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
contentActions: function(row){
let actions = [];
if(!this.deletedContent) {
actions.push({ url: this.getUpdateUrl(row.id), icon: feather.icons['edit'].toSvg({ width: 24, height: 16 }), name: 'Update content' });
if(this.hasTranslations) {
actions.push({ url: this.getTranslationsUrl(row.id), icon: feather.icons['globe'].toSvg({ width: 24, height: 16 }), name: 'Translate content' });
}
actions.push({ url: this.getRevisionsUrl(row.id), icon: feather.icons['skip-back'].toSvg({ width: 24, height: 16 }), name: 'Revisions' });
actions.push({ url: this.getDeleteUrl(row.id), icon: feather.icons['trash-2'].toSvg({ width: 24, height: 16 }), name: 'Delete content', class: 'uk-text-danger' });
} else {
actions.push({ url: this.getRecoverUrl(row.id), icon: feather.icons['rotate-ccw'].toSvg({ width: 24, height: 16 }), name: 'Recover' });
actions.push({ url: this.getDeleteDefinitelyUrl(row.id), icon: feather.icons['x-circle'].toSvg({ width: 24, height: 16 }), name: 'Delete definitely', class: 'uk-text-danger' });
}
return actions;
},
formatDate: function(date) {
validator(type) {
if (!feather.icons[type]) {
throw new Error(`"${type}" is not an available icon type.`);
}
return true;
},
},
copyKey: function() {
let input = this.$el.getElementsByTagName('input')[0];
input.select();
document.execCommand('Copy');
window.getSelection().removeAllRanges();
UIkit.notification({
message: '<div class="uk-inline uk-text-nowrap">' + feather.icons['copy'].toSvg({ width: 24, height: 24 }) + ' ' + this.successMessage + '</div>',
status: 'primary',
pos: 'top-center',
timeout: 1000
});
}
}
validator: function validator(type) {
if (!feather.icons[type]) {
throw new Error("\"".concat(type, "\" is not an available icon type."));
}
return true;
}
}
contentActions: function(row) {
let actions = [];
if(!this.deletedContent) {
actions.push({ url: this.getUpdateUrl(row.id), icon: feather.icons['edit'].toSvg({ width: 24, height: 16 }), name: 'Update content' });
if(this.hasTranslations) {
actions.push({ url: this.getTranslationsUrl(row.id), icon: feather.icons['globe'].toSvg({ width: 24, height: 16 }), name: 'Translate content' });
}
actions.push({ url: this.getRevisionsUrl(row.id), icon: feather.icons['skip-back'].toSvg({ width: 24, height: 16 }), name: 'Revisions' });
actions.push({ url: this.getDeleteUrl(row.id), icon: feather.icons['trash-2'].toSvg({ width: 24, height: 16 }), name: 'Delete content', class: 'uk-text-danger' });
} else {
actions.push({ url: this.getRecoverUrl(row.id), icon: feather.icons['rotate-ccw'].toSvg({ width: 24, height: 16 }), name: 'Recover' });
actions.push({ url: this.getDeleteDefinitelyUrl(row.id), icon: feather.icons['x-circle'].toSvg({ width: 24, height: 16 }), name: 'Delete definitely', class: 'uk-text-danger' });
}
return actions;
},
formatDate: function(date) {
data() {
return {
width: 0,
minWidth: this.initialMinWidth || 50,
feather: feather,
allActions: [
{ key: 'update', icon: feather.icons['edit-2'].toSvg({ width: 24, height: 16 }), name: 'Update' },
{ key: 'delete', icon: feather.icons['trash-2'].toSvg({ width: 24, height: 16 }), name: 'Delete', class: 'uk-text-danger' },
{ key: 'delete_definitely', icon: feather.icons['trash-2'].toSvg({ width: 24, height: 16 }), name: 'Delete definitely', class: 'uk-text-danger' },
{ key: 'recover', icon: feather.icons['refresh-ccw'].toSvg({ width: 24, height: 16 }), name: 'Recover', class: 'uk-text-success' },
{ key: 'revisions', icon: feather.icons['list'].toSvg({ width: 24, height: 16 }), name: 'Manage versions' },
{ key: 'translations', icon: feather.icons['globe'].toSvg({ width: 24, height: 16 }), name: 'Manage translations' },
],
}
},
props: ['row', 'urls', 'identifier', 'initialMinWidth', 'embedded'],