|
@@ -171,7 +171,14 @@
|
|
|
class="material-icons"
|
|
|
content="View Report"
|
|
|
v-tippy
|
|
|
- @click="view(report._id)"
|
|
|
+ @click="
|
|
|
+ openModal({
|
|
|
+ modal: 'viewReport',
|
|
|
+ data: {
|
|
|
+ reportId: report._id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ "
|
|
|
>
|
|
|
open_in_full
|
|
|
</i>
|
|
@@ -192,7 +199,6 @@
|
|
|
</a>
|
|
|
</template>
|
|
|
</modal>
|
|
|
- <view-report v-if="modals.viewReport" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -200,13 +206,16 @@
|
|
|
import { mapState, mapGetters, mapActions } from "vuex";
|
|
|
import Toast from "toasters";
|
|
|
import ws from "@/ws";
|
|
|
+import { mapModalState } from "@/vuex_helpers";
|
|
|
|
|
|
-import ViewReport from "@/components/modals/ViewReport.vue";
|
|
|
import SongItem from "@/components/SongItem.vue";
|
|
|
import ReportInfoItem from "@/components/ReportInfoItem.vue";
|
|
|
|
|
|
export default {
|
|
|
- components: { ViewReport, SongItem, ReportInfoItem },
|
|
|
+ components: { SongItem, ReportInfoItem },
|
|
|
+ props: {
|
|
|
+ modalUuid: { type: String, default: "" }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
icons: {
|
|
@@ -339,8 +348,8 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState({
|
|
|
- song: state => state.modals.report.song
|
|
|
+ ...mapModalState("modals/report/MODAL_UUID", {
|
|
|
+ song: state => state.song
|
|
|
}),
|
|
|
...mapState("modalVisibility", {
|
|
|
modals: state => state.modals
|
|
@@ -362,6 +371,10 @@ export default {
|
|
|
{ modal: "report" }
|
|
|
);
|
|
|
},
|
|
|
+ beforeUnmount() {
|
|
|
+ // Delete the VueX module that was created for this modal, after all other cleanup tasks are performed
|
|
|
+ this.$store.unregisterModule(["modals", "report", this.modalUuid]);
|
|
|
+ },
|
|
|
methods: {
|
|
|
init() {
|
|
|
this.socket.dispatch(
|
|
@@ -380,10 +393,6 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
- view(reportId) {
|
|
|
- this.viewReport(reportId);
|
|
|
- this.openModal("viewReport");
|
|
|
- },
|
|
|
create() {
|
|
|
const issues = [];
|
|
|
|
|
@@ -419,8 +428,7 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
- ...mapActions("modalVisibility", ["openModal", "closeModal"]),
|
|
|
- ...mapActions("modals/viewReport", ["viewReport"])
|
|
|
+ ...mapActions("modalVisibility", ["openModal", "closeModal"])
|
|
|
}
|
|
|
};
|
|
|
</script>
|