Skip to content

Commit

Permalink
for #7380 use one support email config value
Browse files Browse the repository at this point in the history
  • Loading branch information
moellep committed Dec 16, 2024
1 parent db910fe commit 7f863fe
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 11 deletions.
5 changes: 5 additions & 0 deletions sirepo/feature_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ def _test(msg):
),
schema_common=dict(
hide_guest_warning=_dev("Hide the guest warning in the UI"),
support_email=(
"support@radiasoft.net",
str,
"Support email address",
),
),
sim_types=(set(), set, "simulation types (codes) to be imported"),
srw=dict(
Expand Down
2 changes: 1 addition & 1 deletion sirepo/package_data/static/html/http-forbidden.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="row">
<div class="col-sm-6 col-sm-offset-2">
<h1>Forbidden</h1>
<p>Your browser does not have permission to this page. If you believe this is in error, please send a message to our support team <a href="mailto:support@radiasoft.net">support@radiasoft.net</a>.</p>
<p>Your browser does not have permission to this page. If you believe this is in error, please send a message to our support team <span data-support-email=""></span>.</p>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion sirepo/package_data/static/html/missing-cookies.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="col-sm-6 col-sm-offset-2">
<h1>Missing Cookies</h1>
It seems that your browser does not support cookies. Sirepo requires that cookies be enabled for you to access your simulation data.
If you think cookies are enabled in your browser, but are still getting this error message, please send a message to our support team <a href="mailto:support@radiasoft.net">support@radiasoft.net</a>.
If you think cookies are enabled in your browser, but are still getting this error message, please send a message to our support team <span data-support-email=""></span>.
</div>
</div>
</div>
27 changes: 22 additions & 5 deletions sirepo/package_data/static/js/sirepo-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -2608,7 +2608,7 @@ SIREPO.app.directive('appHeaderRight', function(appDataService, authState, appSt
<li class=dropdown><a href class="dropdown-toggle" data-toggle="dropdown"><span
class="glyphicon glyphicon-question-sign"></span> <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="mailto:support@radiasoft.net" target="_blank"><span
<li><span data-support-email=""></span><span
class="glyphicon glyphicon-envelope"></span> Contact Support</a></li>
<li><a href="https://github.com/radiasoft/sirepo/issues" target="_blank"><span
class="glyphicon glyphicon-exclamation-sign"></span> Report a Bug</a></li>
Expand Down Expand Up @@ -3595,7 +3595,10 @@ SIREPO.app.directive('emailLogin', function(requestSender, errorService) {
}
else {
$scope.showWarning = true;
$scope.warningText = 'Server reported an error, please contact support@sirepo.com.';
$scope.warningText = `
Server reported an error, please contact
${SIREPO.APP_SCHEMA.feature_config.support_email}.
`;
}
}

Expand Down Expand Up @@ -3687,7 +3690,10 @@ SIREPO.app.directive('ldapLogin', function (requestSender) {
showWarning(data.form_error);
}
else {
showWarning('Server reported an error, please contact support@sirepo.com.');
showWarning(`
Server reported an error, please contact
${SIREPO.APP_SCHEMA.feature_config.support_email}.
`);
}
}

Expand Down Expand Up @@ -4382,12 +4388,12 @@ SIREPO.app.directive('moderationRequest', function(appState, errorService, panel
};
});

SIREPO.app.directive('moderationPending', function(appState, panelState) {
SIREPO.app.directive('moderationPending', function() {
return {
restrict: 'A',
template: `
<div>Your request to access {{ appName }} has been received. For additional information, contact
<a href="mailto:support@radiasoft.net">support@radiasoft.net</a>.
<span data-support-email=""></span>.
</div>
`,
controller: function(requestSender, $scope) {
Expand Down Expand Up @@ -5847,3 +5853,14 @@ SIREPO.app.directive('slider', function(appState, panelState) {
},
};
});

SIREPO.app.directive('supportEmail', function() {
return {
restrict: 'A',
scope: {},
template: '<a data-ng-attr-href="mailto:{{ supportEmail }}">{{ supportEmail }}</a>',
controller: function($scope) {
$scope.supportEmail = SIREPO.APP_SCHEMA.feature_config.support_email;
},
};
});
17 changes: 14 additions & 3 deletions sirepo/package_data/static/js/sirepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,10 @@ SIREPO.app.factory('authState', function(appDataService, appState, errorService,
return;
}
controller.showWarning = true;
controller.warningText = 'Server reported an error, please contact support@radiasoft.net.';
controller.warningText = `
Server reported an error, please contact
${SIREPO.APP_SCHEMA.feature_config.support_email}.
`;
};

self.isPremiumUser = function() {
Expand Down Expand Up @@ -1256,7 +1259,11 @@ SIREPO.app.service('sbatchLoginService', function($rootScope, appState, authStat
return null;
}
}
return `There was a problem connecting to ${authState.sbatchHostDisplayName}. Please try again. If the issue persists contact support@sirepo.com.`;
return `
There was a problem connecting to ${authState.sbatchHostDisplayName}.
Please try again. If the issue persists contact
${SIREPO.APP_SCHEMA.feature_config.support_email}.
`;
}

query(name) {
Expand Down Expand Up @@ -3937,7 +3944,11 @@ SIREPO.app.factory('persistentSimulation', function(simulationQueue, appState, a
if (e) {
let m = e.split(/[\n\r]+/)[0];
if (m.toLowerCase().includes('504')){
return 'Timeout Error. Please contact support@radiasoft.net if the problem persists';
return `
Timeout Error. Please contact
${SIREPO.APP_SCHEMA.feature_config.support_email}
if the problem persists
`;
}
return 'Error: ' + m;
}
Expand Down
2 changes: 1 addition & 1 deletion sirepo/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ async def api_securityTxt(self):
return self.reply(
content="".join(
[
"Contact: mailto:support@radiasoft.net\n",
f"Contact: mailto:{sirepo.feature_config.cfg().schema_common.support_email}\n",
f"Expires: {d.isoformat()}Z\n",
]
),
Expand Down

0 comments on commit 7f863fe

Please sign in to comment.