2
0
Эх сурвалжийг харах

Merge tag 'v3.7.1' into staging

Owen Diffey 2 жил өмнө
parent
commit
2382975f9f

+ 0 - 47
.github/dependabot.yml

@@ -1,47 +0,0 @@
-version: 2
-updates:
-
-  # Maintain dependencies for GitHub Actions
-  - package-ecosystem: "github-actions"
-    directory: "/"
-    target-branch: "staging"
-    schedule:
-      interval: "weekly"
-      day: "friday"
-      time: "12:00"
-
-  # Maintain dependencies for backend npm
-  - package-ecosystem: "npm"
-    directory: "/backend"
-    target-branch: "staging"
-    schedule:
-      interval: "weekly"
-      day: "friday"
-      time: "12:00"
-
-  # Maintain dependencies for backend docker
-  - package-ecosystem: "docker"
-    directory: "/backend"
-    target-branch: "staging"
-    schedule:
-      interval: "weekly"
-      day: "friday"
-      time: "12:00"
-
-  # Maintain dependencies for frontend npm
-  - package-ecosystem: "npm"
-    directory: "/frontend"
-    target-branch: "staging"
-    schedule:
-      interval: "weekly"
-      day: "friday"
-      time: "12:00"
-
-  # Maintain dependencies for frontend docker
-  - package-ecosystem: "docker"
-    directory: "/frontend"
-    target-branch: "staging"
-    schedule:
-      interval: "weekly"
-      day: "friday"
-      time: "12:00"

+ 18 - 0
CHANGELOG.md

@@ -1,5 +1,23 @@
 # Changelog
 
+## [v3.7.1] - 2022-09-02
+
+Upgrade instructions can be found at [.wiki/Upgrading](.wiki/Upgrading.md).
+
+### Added
+
+- feat: Added update events to view punishment modal
+
+### Fixed
+
+- fix: Unable to resume station with no current song
+- fix: Unable to create new songs with editSong modal
+- fix: Unable to change casing of username
+
+### Removed
+
+- chore: Removed dependabot action
+
 ## [v3.7.0] - 2022-08-27
 
 This release contains mostly internal refactors, and includes all

+ 1 - 0
backend/logic/actions/apis.js

@@ -135,6 +135,7 @@ export default {
 			room.startsWith("edit-user.") ||
 			room.startsWith("view-api-request.") ||
 			room.startsWith("view-youtube-video.") ||
+			room.startsWith("view-punishment.") ||
 			room === "import-album" ||
 			room === "edit-songs"
 		) {

+ 1 - 1
backend/logic/actions/users.js

@@ -2011,7 +2011,7 @@ export default {
 
 				(user, next) => {
 					if (!user) return next();
-					if (user._id === updatingUserId) return next();
+					if (user._id.toString() === updatingUserId) return next();
 					return next("That username is already in use.");
 				},
 

+ 2 - 2
backend/logic/punishments.js

@@ -148,9 +148,9 @@ class _PunishmentsModule extends CoreClass {
 									this
 								).finally(() => {
 									WSModule.runJob(
-										"EMIT_TO_ROOM",
+										"EMIT_TO_ROOMS",
 										{
-											room: `admin.punishments`,
+											rooms: [`admin.punishments`, `view-punishment.${punishment.punishmentId}`],
 											args: [
 												"event:admin.punishment.updated",
 												{ data: { punishment: { ...punishment, status: "Inactive" } } }

+ 19 - 0
frontend/src/components/modals/ViewPunishment.vue

@@ -28,6 +28,19 @@ const init = () => {
 	socket.dispatch(`punishments.findOne`, punishmentId.value, res => {
 		if (res.status === "success") {
 			viewPunishment(res.data.punishment);
+
+			socket.dispatch(
+				"apis.joinRoom",
+				`view-punishment.${punishmentId.value}`
+			);
+
+			socket.on(
+				"event:admin.punishment.updated",
+				({ data }) => {
+					punishment.value = data.punishment;
+				},
+				{ modalUuid: props.modalUuid }
+			);
 		} else {
 			new Toast("Punishment with that ID not found");
 			closeCurrentModal();
@@ -55,6 +68,12 @@ onMounted(() => {
 });
 
 onBeforeUnmount(() => {
+	socket.dispatch(
+		"apis.leaveRoom",
+		`view-punishment.${punishmentId.value}`,
+		() => {}
+	);
+
 	// Delete the Pinia store that was created for this modal, after all other cleanup tasks are performed
 	viewPunishmentStore.$dispose();
 });