-
Notifications
You must be signed in to change notification settings - Fork 4
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
Disable transfers when in maintenance mode #1243
Conversation
6f60cec
to
1005e23
Compare
@@ -0,0 +1,9 @@ | |||
<div class="well maintenance-message"> | |||
<% if ENV.fetch('MAINTENANCE_MESSAGE_TRANSFER', false) %> | |||
<h4 class="hd-5"><%= ENV['MAINTENANCE_MESSAGE_TRANSFER'].to_s %></h4> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to trust this input and making this .html_safe
instead of .to_s
would allow more flexibility in the custom messages.
app/views/transfer/new.html.erb
Outdated
|
||
<% if Flipflop.enabled?(:maintenance_mode) %> | ||
<script type="text/javascript"> | ||
$(':input').prop('disabled', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
$('#new_transfer').hide();
in addition to disabling feels like it would be slightly less confusing to someone that stumbled across this. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a good suggestion. I don't see any downside to hiding the form as well.
8cbb438
to
937f46f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
Why these changes are being introduced: In anticipation of migrating to new AWS infrastructure, we will need to pause file uploads for a bit. Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/ETD-649 How this addresses that need: This adds a maintenance mode feature, toggled via the flipflop gem, that disables and hides the thesis transfer form and changes the welcome message on `transfer/new` to explain what is happening. A custom message can be configured to provide additional details. Side effects of this change: * It is still technically possible to post a new transfer if one were to bypass the form. I find it unlikely that transfer submitters would try to hack this, but if it's a concern, we could try a different approach. * Currently, maintenance mode only disables thesis transfers. I chose to give the feature a more generalized name in case we want to use it to disable additional functionality in the future.
937f46f
to
27b96b3
Compare
Why these changes are being introduced:
In anticipation of migrating to new AWS infrastructure, we will need to pause file uploads for a bit.
Relevant ticket(s):
How this addresses that need:
This adds a maintenance mode feature, toggled via the flipflop gem, that disables the thesis transfer form and changes the welcome message on
transfer/new
to explain what is happening. A custom message can be configured to provide additional details.Side effects of this change:
Developer
our guide and
all issues introduced by these changes have been resolved or opened as new
issues (link to those issues in the Pull Request details above)
Code Reviewer
(not just this pull request message)
Requires database migrations?
NO
Includes new or updated dependencies?
YES