Made caching work well for hooks
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
module shuffle-shared
|
module shuffle-shared
|
||||||
|
|
||||||
replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared
|
//replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared
|
||||||
|
|
||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ require (
|
|||||||
github.com/gorilla/mux v1.8.0
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/h2non/filetype v1.1.3
|
github.com/h2non/filetype v1.1.3
|
||||||
github.com/satori/go.uuid v1.2.0
|
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
|
golang.org/x/crypto v0.16.0
|
||||||
google.golang.org/api v0.125.0
|
google.golang.org/api v0.125.0
|
||||||
google.golang.org/grpc v1.55.0
|
google.golang.org/grpc v1.55.0
|
||||||
|
|||||||
@@ -67,9 +67,15 @@ const Priorities = (props) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const dismissNotification = (alert_id) => {
|
const dismissNotification = (alert_id, disabled) => {
|
||||||
// Don't really care about the logout
|
var notificationurl = `${globalUrl}/api/v1/notifications/${alert_id}/markasread`
|
||||||
fetch(`${globalUrl}/api/v1/notifications/${alert_id}/markasread`, {
|
if (disabled === true) {
|
||||||
|
notificationurl += "?disabled=true"
|
||||||
|
} else if (disabled === false) {
|
||||||
|
notificationurl += "?disabled=false"
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch(notificationurl , {
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -85,12 +91,50 @@ const Priorities = (props) => {
|
|||||||
})
|
})
|
||||||
.then(function (responseJson) {
|
.then(function (responseJson) {
|
||||||
if (responseJson.success === true) {
|
if (responseJson.success === true) {
|
||||||
const newNotifications = notifications.filter(
|
// Mark current one as read
|
||||||
(data) => data.id !== alert_id
|
var newNotifications = notifications.map((notification) => {
|
||||||
);
|
if (notification.id === alert_id) {
|
||||||
console.log("NEW NOTIFICATIONS: ", newNotifications);
|
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)
|
setNotifications(newNotifications)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -174,6 +218,14 @@ const Priorities = (props) => {
|
|||||||
style={{marginRight: 15, height: 25, }}
|
style={{marginRight: 15, height: 25, }}
|
||||||
/>
|
/>
|
||||||
: null}
|
: null}
|
||||||
|
{data.ignored === true ?
|
||||||
|
<Chip
|
||||||
|
label={"Disabled"}
|
||||||
|
variant="outlined"
|
||||||
|
color="primary"
|
||||||
|
style={{marginRight: 15, height: 25, }}
|
||||||
|
/>
|
||||||
|
: null}
|
||||||
{data.read === false ?
|
{data.read === false ?
|
||||||
<Chip
|
<Chip
|
||||||
label={"Unread"}
|
label={"Unread"}
|
||||||
@@ -227,6 +279,22 @@ const Priorities = (props) => {
|
|||||||
Dismiss
|
Dismiss
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
|
<Tooltip title="Disabling a notification makes it so similar notifications to this one will NOT be re-opened. It will NOT forward notifications to your notification workflow, but WILL still keep counting." placement="top">
|
||||||
|
<Button
|
||||||
|
color="secondary"
|
||||||
|
variant={data.ignored === true ? "contained" : "outlined"}
|
||||||
|
style={{ marginTop: 15, }}
|
||||||
|
onClick={() => {
|
||||||
|
if (data.ignored === true) {
|
||||||
|
dismissNotification(data.id, false)
|
||||||
|
} else {
|
||||||
|
dismissNotification(data.id, true)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{data.ignored === true ? "Re-enable" : "Disable"}
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|
||||||
<Typography variant="body2" color="textSecondary" style={{marginLeft: 20, marginTop: 20, }}>
|
<Typography variant="body2" color="textSecondary" style={{marginLeft: 20, marginTop: 20, }}>
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ const Priority = (props) => {
|
|||||||
let newdescription = priority.description
|
let newdescription = priority.description
|
||||||
const descsplit = priority.description.split("&")
|
const descsplit = priority.description.split("&")
|
||||||
if (appFramework !== undefined && descsplit.length === 5 && priority.description.includes(":default")) {
|
if (appFramework !== undefined && descsplit.length === 5 && priority.description.includes(":default")) {
|
||||||
console.log("descsplit: ", descsplit)
|
|
||||||
if (descsplit[1] === "") {
|
if (descsplit[1] === "") {
|
||||||
const item = findSpecificApp(appFramework, descsplit[0])
|
const item = findSpecificApp(appFramework, descsplit[0])
|
||||||
|
|
||||||
|
|||||||
@@ -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" ?
|
{selectedAuthentication.type === "oauth" || selectedAuthentication.type === "oauth2" || selectedAuthentication.type === "oauth2-app" ?
|
||||||
<div>
|
<div>
|
||||||
<Typography variant="body1" color="textSecondary" style={{ marginBottom: 0, marginTop: 10 }}>
|
<Typography variant="body1" color="textSecondary" style={{ marginBottom: 0, marginTop: 10 }}>
|
||||||
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.
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
:
|
: null }
|
||||||
selectedAuthentication.fields.map((data, index) => {
|
|
||||||
|
{selectedAuthentication.fields.map((data, index) => {
|
||||||
var fieldname = data.key.replaceAll("_", " ")
|
var fieldname = data.key.replaceAll("_", " ")
|
||||||
if (fieldname.endsWith(" basic")) {
|
if (fieldname.endsWith(" basic")) {
|
||||||
fieldname = fieldname.substring(0, fieldname.length - 6)
|
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)
|
//console.log("DATA: ", data, selectedAuthentication)
|
||||||
return (
|
return (
|
||||||
<div key={index}>
|
<div key={index}>
|
||||||
|
|||||||
Reference in New Issue
Block a user