diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index 98f8f418..278ea169 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -1,6 +1,6 @@ module shuffle-shared -replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared +//replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared go 1.19 @@ -18,7 +18,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/h2non/filetype v1.1.3 github.com/satori/go.uuid v1.2.0 - github.com/shuffle/shuffle-shared v0.5.65 + github.com/shuffle/shuffle-shared v0.5.77 golang.org/x/crypto v0.16.0 google.golang.org/api v0.125.0 google.golang.org/grpc v1.55.0 diff --git a/frontend/src/components/Priorities.jsx b/frontend/src/components/Priorities.jsx index 63c06515..bd6e5fa8 100644 --- a/frontend/src/components/Priorities.jsx +++ b/frontend/src/components/Priorities.jsx @@ -67,9 +67,15 @@ const Priorities = (props) => { }) } - const dismissNotification = (alert_id) => { - // Don't really care about the logout - fetch(`${globalUrl}/api/v1/notifications/${alert_id}/markasread`, { + const dismissNotification = (alert_id, disabled) => { + var notificationurl = `${globalUrl}/api/v1/notifications/${alert_id}/markasread` + if (disabled === true) { + notificationurl += "?disabled=true" + } else if (disabled === false) { + notificationurl += "?disabled=false" + } + + fetch(notificationurl , { credentials: "include", method: "GET", headers: { @@ -85,12 +91,50 @@ const Priorities = (props) => { }) .then(function (responseJson) { if (responseJson.success === true) { - const newNotifications = notifications.filter( - (data) => data.id !== alert_id - ); - console.log("NEW NOTIFICATIONS: ", newNotifications); + // Mark current one as read + var newNotifications = notifications.map((notification) => { + if (notification.id === alert_id) { + notification.read = true + } - if (setNotifications !== undefined) { + return notification + }) + + + if (disabled === true) { + toast("Notification disabled, and will not be shown again.") + + newNotifications = newNotifications.map((notification) => { + if (notification.id === alert_id) { + notification.ignored = true + } + + return notification + }) + + console.log("NEW NOTIFICATIONS: ", newNotifications); + } else if (disabled === false) { + toast("Notification re-enabled successfully") + + newNotifications = newNotifications.map((notification) => { + if (notification.id === alert_id) { + notification.ignored = false + } + + return notification + }) + + } else { + toast("Notification dismissed successfully") + } + + //const newNotifications = notifications.filter( + // (data) => data.id !== alert_id + //) + + //console.log("NEW NOTIFICATIONS: ", newNotifications); + + if (setNotifications !== undefined && newNotifications !== undefined) { setNotifications(newNotifications) } } else { @@ -174,6 +218,14 @@ const Priorities = (props) => { style={{marginRight: 15, height: 25, }} /> : null} + {data.ignored === true ? + + : null} {data.read === false ? { Dismiss ) : null} + + + diff --git a/frontend/src/components/Priority.jsx b/frontend/src/components/Priority.jsx index 13c278d3..60e4bce2 100644 --- a/frontend/src/components/Priority.jsx +++ b/frontend/src/components/Priority.jsx @@ -32,7 +32,6 @@ const Priority = (props) => { let newdescription = priority.description const descsplit = priority.description.split("&") if (appFramework !== undefined && descsplit.length === 5 && priority.description.includes(":default")) { - console.log("descsplit: ", descsplit) if (descsplit[1] === "") { const item = findSpecificApp(appFramework, descsplit[0]) diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index 7bdc2fb5..ce774122 100755 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -1867,16 +1867,24 @@ If you're interested, please let me know a time that works for you, or set up a {selectedAuthentication.type === "oauth" || selectedAuthentication.type === "oauth2" || selectedAuthentication.type === "oauth2-app" ?
- Only the name of the auth can be modified for Oauth2. Please remake the authentication to change the fields like Client ID, Secret, Scopes etc. + Only the name and url can be modified for Oauth2/OpenID connect. Please remake the authentication if you want to change the other fields like Client ID, Secret, Scopes etc.
- : - selectedAuthentication.fields.map((data, index) => { + : null } + + {selectedAuthentication.fields.map((data, index) => { var fieldname = data.key.replaceAll("_", " ") if (fieldname.endsWith(" basic")) { fieldname = fieldname.substring(0, fieldname.length - 6) } + if (selectedAuthentication.type === "oauth" || selectedAuthentication.type === "oauth2" || selectedAuthentication.type === "oauth2-app") { + if (selectedAuthentication.fields[index].key !== "url") { + return null + } + } + + //console.log("DATA: ", data, selectedAuthentication) return (