Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #7380 replace slack link with support email #7401

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions sirepo/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,6 @@ def user_registration(self, uid, display_name=None):
return res

def _auth_state(self):
def _get_slack_uri():
return sirepo.feature_config.cfg().slack_uri + (
self._qcall_bound_user() or ""
)

s = self._qcall_bound_state()
v = pkcollections.Dict(
avatarUrl=None,
Expand All @@ -671,7 +666,6 @@ def _get_slack_uri():
method=self._qcall_bound_method(),
needCompleteRegistration=s == _STATE_COMPLETE_REGISTRATION,
roles=[],
slackUri=_get_slack_uri(),
userName=None,
uiWebSocket=sirepo.feature_config.cfg().ui_websocket,
visibleMethods=visible_methods,
Expand Down
10 changes: 5 additions & 5 deletions sirepo/feature_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ def _test(msg):
),
schema_common=dict(
hide_guest_warning=_dev("Hide the guest warning in the UI"),
support_email=(
"[email protected]",
str,
"Support email address",
),
),
sim_types=(set(), set, "simulation types (codes) to be imported"),
slack_uri=(
"https://slack.com/",
str,
"Link to Sirepo Slack workspace; uid will be appended",
),
srw=dict(
app_url=("/en/xray-beamlines.html", str, "URL for SRW link"),
mask_in_toolbar=_test("Show the mask element in toolbar"),
Expand Down
10 changes: 0 additions & 10 deletions sirepo/package_data/jupyterhub_templates/page.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
{% extends "templates/page.html" %}
{% block nav_bar_right_items %}
<li>
<a id="sirepo-slack-link" href="https://slack.sirepo.com">
<span>
<img style="filter: invert(0.5);" width="70" src="/static/svg/slack.svg" title="Join us on Slack"/>
</span>
</a>
</li>
<script>
const SIREPO = {};
</script>
{# POSIT: '/auth-state' is defined in schema common ie. "authState": "/auth-state" #}
<script src="/auth-state">
</script>
<script>
document.getElementById('sirepo-slack-link').href = SIREPO.authState.slackUri;
</script>
{{ super() }}
{% endblock %}
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:[email protected]">[email protected]</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:[email protected]">[email protected]</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>
33 changes: 23 additions & 10 deletions sirepo/package_data/static/js/sirepo-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -2605,14 +2605,11 @@ SIREPO.app.directive('appHeaderRight', function(appDataService, authState, appSt
<li data-ng-transclude="appHeaderRightSimListSlot"></li>
</ul>
<ul class="nav navbar-nav sr-navbar-right">
<li>
<a href="{{ slackUri }}" target="_blank" style="padding: 11px 0px 10px 0px;">
<span><img class="sr-slack-img" width="70" src="/static/svg/slack.svg" title="Join us on Slack"/></span>
</a>
</li>
<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 data-ng-href="mailto:{{:: SIREPO.APP_SCHEMA.feature_config.support_email }}">
<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>
<li data-help-link="helpUserManualURL" data-title="User Manual" data-icon="list-alt"></li>
Expand All @@ -2639,7 +2636,6 @@ SIREPO.app.directive('appHeaderRight', function(appDataService, authState, appSt
},
controller: function($scope, stringsService) {
$scope.authState = authState;
$scope.slackUri = $scope.authState.slackUri;
$scope.SIREPO = SIREPO;
$scope.modeIsDefault = function () {
return appDataService.isApplicationMode('default');
Expand Down Expand Up @@ -3599,7 +3595,10 @@ SIREPO.app.directive('emailLogin', function(requestSender, errorService) {
}
else {
$scope.showWarning = true;
$scope.warningText = 'Server reported an error, please contact [email protected].';
$scope.warningText = `
Server reported an error, please contact
${SIREPO.APP_SCHEMA.feature_config.support_email}.
`;
}
}

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

Expand Down Expand Up @@ -4386,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:[email protected]">[email protected]</a>.
<span data-support-email=""></span>.
</div>
`,
controller: function(requestSender, $scope) {
Expand Down Expand Up @@ -5851,3 +5853,14 @@ SIREPO.app.directive('slider', function(appState, panelState) {
},
};
});

SIREPO.app.directive('supportEmail', function() {
return {
restrict: 'A',
scope: {},
template: '<a data-ng-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 [email protected].';
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 [email protected].`;
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 [email protected] 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
41 changes: 0 additions & 41 deletions sirepo/package_data/static/svg/slack.svg

This file was deleted.

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:[email protected]\n",
f"Contact: mailto:{sirepo.feature_config.cfg().schema_common.support_email}\n",
f"Expires: {d.isoformat()}Z\n",
]
),
Expand Down
Loading