From fc965cd348de9d41f2b35dc64ac40be5c4ba49ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20M=C3=BCller?=
Date: Wed, 16 Feb 2022 15:31:05 +0100
Subject: [PATCH 1/2] Site accounts improvements
---
pkg/siteacc/account/manage/template.go | 25 +++++++++---------------
pkg/siteacc/account/settings/template.go | 4 ++--
pkg/siteacc/admin/template.go | 8 ++++++++
pkg/siteacc/alerting/dispatcher.go | 2 +-
pkg/siteacc/data/account.go | 2 +-
5 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/pkg/siteacc/account/manage/template.go b/pkg/siteacc/account/manage/template.go
index 9fe3db7f2b..9862f02009 100644
--- a/pkg/siteacc/account/manage/template.go
+++ b/pkg/siteacc/account/manage/template.go
@@ -34,11 +34,6 @@ function handleRequestAccess() {
window.location.replace("{{getServerAddress}}/account/?path=contact&subject=" + encodeURIComponent("Request GOCDB access"));
}
-function handleRequestKey() {
- setState(STATE_STATUS, "Redirecting to the contact form...");
- window.location.replace("{{getServerAddress}}/account/?path=contact&subject=" + encodeURIComponent("Request API key"));
-}
-
function handleLogout() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "{{getServerAddress}}/logout");
@@ -63,19 +58,12 @@ const tplStyleSheet = `
html * {
font-family: arial !important;
}
-
-.apikey {
- font-family: monospace !important;
- background: antiquewhite;
- border: 1px solid black;
- padding: 2px;
-}
`
const tplBody = `
Hello {{.Account.FirstName}} {{.Account.LastName}},
-
On this page, you can manage your ScienceMesh user account. This includes editing your personal information, requesting an API key or access to the GOCDB and more.
+
On this page, you can manage your ScienceMesh user account. This includes editing your personal information, requesting access to the GOCDB and more.
@@ -92,8 +80,7 @@ const tplBody = `
Account data:
-
- API Key: {{if .Account.Data.APIKey}}{{.Account.Data.APIKey}} {{else}}(no key assigned yet){{end}}
+
GOCDB access: {{if .Account.Data.GOCDBAccess}}Granted{{else}}Not granted{{end}}
@@ -102,10 +89,16 @@ const tplBody = `
Settings
Edit account
- Request API Key
Request GOCDB access
Logout
+
`
diff --git a/pkg/siteacc/account/settings/template.go b/pkg/siteacc/account/settings/template.go
index e3a2d94b69..6c3a058f2a 100644
--- a/pkg/siteacc/account/settings/template.go
+++ b/pkg/siteacc/account/settings/template.go
@@ -77,8 +77,8 @@ const tplBody = `
-
- Receive email notifications about site alerts
+
+ Receive email notifications about site alerts (mandatory; always on)
diff --git a/pkg/siteacc/admin/template.go b/pkg/siteacc/admin/template.go
index 6dccaca3df..07374f7fdc 100644
--- a/pkg/siteacc/admin/template.go
+++ b/pkg/siteacc/admin/template.go
@@ -68,19 +68,23 @@ const tplBody = `
+
GOCDB access: {{if .Data.GOCDBAccess}}Granted{{else}}Not granted{{end}}