|
@@ -46,7 +46,12 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
formattedMessage() {
|
|
|
- const { youtubeId, playlistId, stationId } = this.activity.payload;
|
|
|
+ const {
|
|
|
+ youtubeId,
|
|
|
+ playlistId,
|
|
|
+ stationId,
|
|
|
+ reportId
|
|
|
+ } = this.activity.payload;
|
|
|
let { message } = this.activity.payload;
|
|
|
|
|
|
if (youtubeId) {
|
|
@@ -56,6 +61,13 @@ export default {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ if (reportId) {
|
|
|
+ message = message.replace(
|
|
|
+ /<reportId>(.*)<\/reportId>/g,
|
|
|
+ `<a href='#' class='activity-item-link' @click='showReport("${reportId}")'>report</a>`
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
if (playlistId) {
|
|
|
message = message.replace(
|
|
|
/<playlistId>(.*)<\/playlistId>/g,
|
|
@@ -72,13 +84,28 @@ export default {
|
|
|
|
|
|
return {
|
|
|
template: `<p>${message}</p>`,
|
|
|
- methods: { showPlaylist: this.showPlaylist }
|
|
|
+ methods: {
|
|
|
+ showPlaylist: this.showPlaylist,
|
|
|
+ showReport: this.showReport
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
textOnlyMessage() {
|
|
|
- const { youtubeId, playlistId, stationId } = this.activity.payload;
|
|
|
+ const {
|
|
|
+ youtubeId,
|
|
|
+ playlistId,
|
|
|
+ stationId,
|
|
|
+ reportId
|
|
|
+ } = this.activity.payload;
|
|
|
let { message } = this.activity.payload;
|
|
|
|
|
|
+ if (reportId) {
|
|
|
+ message = message.replace(
|
|
|
+ /<reportId>(.*)<\/reportId>/g,
|
|
|
+ "report"
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
if (youtubeId) {
|
|
|
message = message.replace(
|
|
|
/<youtubeId>(.*)<\/youtubeId>/g,
|
|
@@ -154,6 +181,10 @@ export default {
|
|
|
|
|
|
return icons[this.activity.type];
|
|
|
},
|
|
|
+ showReport(reportId) {
|
|
|
+ this.viewReport(reportId);
|
|
|
+ this.openModal("viewReport");
|
|
|
+ },
|
|
|
showPlaylist(playlistId) {
|
|
|
this.editPlaylist(playlistId);
|
|
|
this.openModal("editPlaylist");
|
|
@@ -161,7 +192,8 @@ export default {
|
|
|
...mapActions("user/playlists", ["editPlaylist"]),
|
|
|
formatDistance,
|
|
|
parseISO,
|
|
|
- ...mapActions("modalVisibility", ["openModal"])
|
|
|
+ ...mapActions("modalVisibility", ["openModal"]),
|
|
|
+ ...mapActions("modals/viewReport", ["viewReport"])
|
|
|
}
|
|
|
};
|
|
|
</script>
|