Browse Source

Added ability to open import album button from editsong

Kristian Vos 3 years ago
parent
commit
b4790146d8

+ 13 - 1
frontend/src/components/modals/EditSong.vue

@@ -436,6 +436,12 @@
 										Data quality:
 										<span>{{ result.dataQuality }}</span>
 									</p>
+									<button
+										class="button is-primary"
+										@click="importAlbum(result)"
+									>
+										Import album
+									</button>
 									<div class="tracks">
 										<div
 											class="track"
@@ -1108,6 +1114,11 @@ export default {
 		});
 	},
 	methods: {
+		importAlbum(result) {
+			this.selectDiscogsAlbum(result);
+			this.openModal("importAlbum");
+			this.closeModal("editSong");
+		},
 		save(songToCopy, verify, close) {
 			const song = JSON.parse(JSON.stringify(songToCopy));
 
@@ -1626,6 +1637,7 @@ export default {
 		// 		new Toast(res.message);
 		// 	});
 		// },
+		...mapActions("modals/importAlbum", ["selectDiscogsAlbum"]),
 		...mapActions("modals/editSong", [
 			"stopVideo",
 			"loadVideoById",
@@ -1635,7 +1647,7 @@ export default {
 			"updateSongField",
 			"selectDiscogsInfo"
 		]),
-		...mapActions("modalVisibility", ["closeModal"])
+		...mapActions("modalVisibility", ["closeModal", "openModal"])
 	}
 };
 </script>

+ 1 - 2
frontend/src/components/modals/ImportAlbum.vue

@@ -343,8 +343,7 @@ export default {
 			currentEditSongIndex: 0,
 			search: {
 				playlist: {
-					query:
-						"https://www.youtube.com/playlist?list=PLhQ__WZiNh3XPkYQuZ2d08LK0vP-pVz2F"
+					query: ""
 				}
 			},
 			discogsQuery: "",

+ 2 - 0
frontend/src/pages/Admin/tabs/HiddenSongs.vue

@@ -107,6 +107,7 @@
 				</tbody>
 			</table>
 		</div>
+		<import-album v-if="modals.importAlbum" />
 		<edit-song v-if="modals.editSong" />
 		<floating-box
 			id="keyboardShortcutsHelper"
@@ -185,6 +186,7 @@ import ws from "@/ws";
 export default {
 	components: {
 		EditSong: () => import("@/components/modals/EditSong.vue"),
+		ImportAlbum: () => import("@/components/modals/ImportAlbum.vue"),
 		UserIdToUsername,
 		FloatingBox
 	},

+ 2 - 0
frontend/src/pages/Admin/tabs/UnverifiedSongs.vue

@@ -116,6 +116,7 @@
 				</tbody>
 			</table>
 		</div>
+		<import-album v-if="modals.importAlbum" />
 		<edit-song v-if="modals.editSong" />
 		<floating-box
 			id="keyboardShortcutsHelper"
@@ -197,6 +198,7 @@ import ws from "@/ws";
 export default {
 	components: {
 		EditSong: () => import("@/components/modals/EditSong.vue"),
+		ImportAlbum: () => import("@/components/modals/ImportAlbum.vue"),
 		UserIdToUsername,
 		FloatingBox,
 		Confirm

+ 0 - 1
frontend/src/store/modules/modalVisibility.js

@@ -33,7 +33,6 @@ const actions = {
 			});
 
 		commit("closeModal", modal);
-		commit("closeCurrentModal");
 	},
 	openModal: ({ commit }, modal) => {
 		commit("openModal", modal);