Browse Source

refactor: Disabled strict TS on frontend and fixed modal store props errors

Owen Diffey 1 year ago
parent
commit
39bcc75469

+ 3 - 1
frontend/src/components/PlaylistTabBase.vue

@@ -60,7 +60,9 @@ const {
 
 const { autoRequest } = storeToRefs(stationStore);
 
-const manageStationStore = useManageStationStore(props);
+const manageStationStore = useManageStationStore({
+	modalUuid: props.modalUuid
+});
 const { autofill } = storeToRefs(manageStationStore);
 
 const station = computed({

+ 3 - 1
frontend/src/components/Queue.vue

@@ -20,7 +20,9 @@ const props = defineProps({
 
 const { socket } = useWebsocketsStore();
 const stationStore = useStationStore();
-const manageStationStore = useManageStationStore(props);
+const manageStationStore = useManageStationStore({
+	modalUuid: props.modalUuid
+});
 
 const actionableButtonVisible = ref(false);
 const drag = ref(false);

+ 3 - 1
frontend/src/components/Request.vue

@@ -28,7 +28,9 @@ const { musareSearch, searchForMusareSongs } = useSearchMusare();
 
 const { socket } = useWebsocketsStore();
 const stationStore = useStationStore();
-const manageStationStore = useManageStationStore(props);
+const manageStationStore = useManageStationStore({
+	modalUuid: props.modalUuid
+});
 
 const tab = ref("songs");
 const sitename = ref("Musare");

+ 3 - 1
frontend/src/components/StationInfoBox.vue

@@ -18,7 +18,9 @@ const props = defineProps({
 
 const userAuthStore = useUserAuthStore();
 const stationStore = useStationStore();
-const manageStationStore = useManageStationStore(props);
+const manageStationStore = useManageStationStore({
+	modalUuid: props.modalUuid
+});
 
 const { socket } = useWebsocketsStore();
 const { loggedIn } = storeToRefs(userAuthStore);

+ 1 - 1
frontend/src/components/modals/EditPlaylist/Tabs/AddSongs.vue

@@ -16,7 +16,7 @@ const props = defineProps({
 	modalUuid: { type: String, required: true }
 });
 
-const editPlaylistStore = useEditPlaylistStore(props);
+const editPlaylistStore = useEditPlaylistStore({ modalUuid: props.modalUuid });
 const { playlist } = storeToRefs(editPlaylistStore);
 
 const sitename = ref("Musare");

+ 1 - 1
frontend/src/components/modals/EditPlaylist/Tabs/ImportPlaylists.vue

@@ -12,7 +12,7 @@ const props = defineProps({
 
 const { socket } = useWebsocketsStore();
 
-const editPlaylistStore = useEditPlaylistStore(props);
+const editPlaylistStore = useEditPlaylistStore({ modalUuid: props.modalUuid });
 const { playlist } = storeToRefs(editPlaylistStore);
 
 const { setJob } = useLongJobsStore();

+ 1 - 1
frontend/src/components/modals/EditPlaylist/Tabs/Settings.vue

@@ -19,7 +19,7 @@ const { hasPermission } = userAuthStore;
 
 const { socket } = useWebsocketsStore();
 
-const editPlaylistStore = useEditPlaylistStore(props);
+const editPlaylistStore = useEditPlaylistStore({ modalUuid: props.modalUuid });
 const { playlist } = storeToRefs(editPlaylistStore);
 
 const { preventCloseUnsaved } = useModalsStore();

+ 1 - 1
frontend/src/components/modals/EditPlaylist/index.vue

@@ -35,7 +35,7 @@ const props = defineProps({
 });
 
 const { socket } = useWebsocketsStore();
-const editPlaylistStore = useEditPlaylistStore(props);
+const editPlaylistStore = useEditPlaylistStore({ modalUuid: props.modalUuid });
 const stationStore = useStationStore();
 const userAuthStore = useUserAuthStore();
 

+ 1 - 1
frontend/src/components/modals/EditSong/Tabs/Discogs.vue

@@ -17,7 +17,7 @@ const props = defineProps({
 	bulk: { type: Boolean, default: false }
 });
 
-const editSongStore = useEditSongStore(props);
+const editSongStore = useEditSongStore({ modalUuid: props.modalUuid });
 
 const { socket } = useWebsocketsStore();
 

+ 1 - 1
frontend/src/components/modals/EditSong/Tabs/Reports.vue

@@ -16,7 +16,7 @@ const props = defineProps({
 	modalModulePath: { type: String, default: "modals/editSong/MODAL_UUID" }
 });
 
-const editSongStore = useEditSongStore(props);
+const editSongStore = useEditSongStore({ modalUuid: props.modalUuid });
 
 const { socket } = useWebsocketsStore();
 

+ 1 - 1
frontend/src/components/modals/EditSong/Tabs/Songs.vue

@@ -16,7 +16,7 @@ const props = defineProps({
 
 const sitename = ref("Musare");
 
-const { form } = useEditSongStore(props);
+const { form } = useEditSongStore({ modalUuid: props.modalUuid });
 
 const {
 	musareSearch,

+ 1 - 1
frontend/src/components/modals/EditSong/Tabs/Youtube.vue

@@ -12,7 +12,7 @@ const props = defineProps({
 	modalModulePath: { type: String, default: "modals/editSong/MODAL_UUID" }
 });
 
-const editSongStore = useEditSongStore(props);
+const editSongStore = useEditSongStore({ modalUuid: props.modalUuid });
 
 const { form, newSong } = storeToRefs(editSongStore);
 

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

@@ -55,7 +55,7 @@ const props = defineProps({
 	songs: { type: Array, default: null }
 });
 
-const editSongStore = useEditSongStore(props);
+const editSongStore = useEditSongStore({ modalUuid: props.modalUuid });
 const stationStore = useStationStore();
 const { socket } = useWebsocketsStore();
 const userAuthStore = useUserAuthStore();

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

@@ -25,7 +25,7 @@ const props = defineProps({
 
 const { socket } = useWebsocketsStore();
 
-const importAlbumStore = useImportAlbumStore(props);
+const importAlbumStore = useImportAlbumStore({ modalUuid: props.modalUuid });
 const { discogsTab, discogsAlbum, prefillDiscogs, playlistSongs } =
 	storeToRefs(importAlbumStore);
 const {

+ 3 - 1
frontend/src/components/modals/ManageStation/Settings.vue

@@ -17,7 +17,9 @@ const props = defineProps({
 
 const { socket } = useWebsocketsStore();
 
-const manageStationStore = useManageStationStore(props);
+const manageStationStore = useManageStationStore({
+	modalUuid: props.modalUuid
+});
 const { station } = storeToRefs(manageStationStore);
 const { editStation } = manageStationStore;
 

+ 3 - 1
frontend/src/components/modals/ManageStation/index.vue

@@ -43,7 +43,9 @@ const { loggedIn, userId } = storeToRefs(userAuthStore);
 
 const { socket } = useWebsocketsStore();
 
-const manageStationStore = useManageStationStore(props);
+const manageStationStore = useManageStationStore({
+	modalUuid: props.modalUuid
+});
 const {
 	stationId,
 	sector,

+ 3 - 1
frontend/src/components/modals/ViewYoutubeVideo.vue

@@ -31,7 +31,9 @@ const activityWatchVideoDataInterval = ref(null);
 const activityWatchVideoLastStatus = ref("");
 const activityWatchVideoLastStartDuration = ref(0);
 
-const viewYoutubeVideoStore = useViewYoutubeVideoStore(props);
+const viewYoutubeVideoStore = useViewYoutubeVideoStore({
+	modalUuid: props.modalUuid
+});
 const stationStore = useStationStore();
 const { video, player } = storeToRefs(viewYoutubeVideoStore);
 const {

+ 2 - 2
frontend/src/types/global.d.ts

@@ -4,8 +4,8 @@
 declare global {
 	var lofig: {
 		config: object;
-		fetchConfig: () => Promise<unknown>;
-		get: (setting: string) => unknown;
+		fetchConfig: () => Promise<any>;
+		get: (setting: string) => any;
 	};
 	var stationInterval: number;
 	var YT: any;

+ 2 - 2
frontend/tsconfig.json

@@ -22,11 +22,11 @@
       "@intlify/vite-plugin-vue-i18n/client",
       "vitest/globals"
     ],
-    "strict": true,
+    "strict": false,
     "allowSyntheticDefaultImports": true
   },
   "exclude": [
     "./src/index.html",
     "./src/coverage"
   ]
-}
+}