mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-03-27 19:42:04 +01:00
Added a disabled feature of potentially better redirection after (un)subscribing.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
|
import java.net.URLEncoder
|
||||||
import java.util.concurrent.atomic.AtomicBoolean
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@@ -137,12 +138,15 @@ class Notifications @Inject()(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Redirection to a specific position does not look intuituve now, so it has been disabled for now.
|
||||||
|
private def redirectToProject(project: String)(implicit th: DefaultRequest) = Redirect(routes.Notifications.listProjects()/*.withFragment("project-" + URLEncoder.encode(project, "utf-8")).absoluteURL()*/)
|
||||||
|
|
||||||
def watch(project: String) = SecuredAction.async{ implicit req =>
|
def watch(project: String) = SecuredAction.async{ implicit req =>
|
||||||
for( _ <-notificationService.subscribe(req.identity.loginInfo, project) ) yield Redirect(routes.Notifications.listProjects())
|
for( _ <-notificationService.subscribe(req.identity.loginInfo, project) ) yield redirectToProject(project)
|
||||||
}
|
}
|
||||||
|
|
||||||
def unwatch(project: String) = SecuredAction.async{implicit req =>
|
def unwatch(project: String) = SecuredAction.async{ implicit req =>
|
||||||
for( _ <-notificationService.unsubscribe(req.identity.loginInfo, project) ) yield Redirect(routes.Notifications.listProjects())
|
for( _ <-notificationService.unsubscribe(req.identity.loginInfo, project) ) yield redirectToProject(project)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user