Revert "Basic architecture of Maintenance App - SUST-19, SUST-42. Implement Force Publish Course view. SUST-46"
This reverts commit 27646b7e6f.
This commit is contained in:
@@ -1,82 +0,0 @@
|
||||
define([ // jshint ignore:line
|
||||
'jquery',
|
||||
'underscore',
|
||||
'gettext',
|
||||
'common/js/components/utils/view_utils',
|
||||
'edx-ui-toolkit/js/utils/string-utils',
|
||||
"edx-ui-toolkit/js/utils/html-utils",
|
||||
'text!templates/maintenance/force-published-course-response.underscore'
|
||||
],
|
||||
function($, _, gettext, ViewUtils, StringUtils, HtmlUtils, ForcePublishedTemplate) {
|
||||
'use strict';
|
||||
return function (maintenanceViewURL) {
|
||||
|
||||
// Reset values
|
||||
$('#reset-button').click(function (e) {
|
||||
e.preventDefault();
|
||||
$('#course-id').val('');
|
||||
$('#dry-run').prop('checked', true);
|
||||
// clear out result container
|
||||
$('#result-container').html('');
|
||||
});
|
||||
|
||||
var showError = function(containerElSelector, error){
|
||||
var errorWrapperElSelector = containerElSelector + ' .wrapper-error';
|
||||
var errorHtml = '<div class="error" aria-live="polite" id="course-id-error">' + error + '</div>';
|
||||
HtmlUtils.setHtml(
|
||||
$(errorWrapperElSelector),
|
||||
HtmlUtils.HTML(errorHtml)
|
||||
);
|
||||
$(errorWrapperElSelector).css('display', 'inline-block');
|
||||
$(errorWrapperElSelector).fadeOut(5000);
|
||||
};
|
||||
|
||||
$('form#force_publish').submit(function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
// clear out result container
|
||||
$('#result-container').html('');
|
||||
|
||||
var submitButton = $('#submit_force_publish'),
|
||||
deferred = new $.Deferred(),
|
||||
promise = deferred.promise();
|
||||
ViewUtils.disableElementWhileRunning(submitButton, function() { return promise; });
|
||||
|
||||
var data = $('#force_publish').serialize();
|
||||
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url: maintenanceViewURL,
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
})
|
||||
.done(function(response) {
|
||||
if(response.error){
|
||||
showError('#course-id-container', response.msg);
|
||||
}
|
||||
else {
|
||||
if(response.msg) {
|
||||
showError('#result-error', response.msg);
|
||||
}
|
||||
else{
|
||||
var attrs = $.extend({}, response, {StringUtils: StringUtils});
|
||||
HtmlUtils.setHtml(
|
||||
$('#result-container'),
|
||||
HtmlUtils.template(ForcePublishedTemplate)(attrs)
|
||||
);
|
||||
}
|
||||
}
|
||||
})
|
||||
.fail(function(response) { // jshint ignore:line
|
||||
// response.responseText here because it would show some strange output, it may output Traceback
|
||||
// sometimes if unexpected issue arises. Better to show just internal error when getting 500 error.
|
||||
showError('#result-error', gettext('Internal Server Error.'));
|
||||
})
|
||||
.always(function(response) { // jshint ignore:line
|
||||
deferred.resolve();
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
@import 'views/group-configuration';
|
||||
@import 'views/video-upload';
|
||||
@import 'views/certificates';
|
||||
@import 'views/maintenance';
|
||||
|
||||
// +Base - Contexts
|
||||
// ====================
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
.maintenance-header {
|
||||
text-align: center;
|
||||
margin-top: 50px;
|
||||
|
||||
h2 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
.maintenance-content {
|
||||
padding: 3rem 0;
|
||||
.maintenance-list {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
.view-list-container {
|
||||
padding: 10px 15px;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #ddd;
|
||||
&:hover {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
.view-name {
|
||||
display: inline-block;
|
||||
width: 20%;
|
||||
float: left;
|
||||
}
|
||||
.view-desc {
|
||||
display: inline-block;
|
||||
width: 80%;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.maintenance-form {
|
||||
width: 60%;
|
||||
margin: auto;
|
||||
.result-list {
|
||||
height: calc(100vh - 200px);
|
||||
overflow: auto;
|
||||
}
|
||||
.result{
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
|
||||
margin-top: 15px;
|
||||
padding: 15px 30px;
|
||||
background: #f9f9f9;
|
||||
}
|
||||
li {
|
||||
font-size: 13px;
|
||||
line-height: 9px;
|
||||
}
|
||||
.actions {
|
||||
text-align: right;
|
||||
}
|
||||
.field-radio div {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
div.error {
|
||||
color: #F00;
|
||||
margin-top: 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
div.head-output {
|
||||
font-size: 13px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
div.main-output {
|
||||
color: #0A0;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user