Skip to content

Commit

Permalink
⚡ Fixed CSS issues and additional message if moodle incorrect config
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeeptrivedi13 committed Jan 7, 2025
1 parent c3dc07c commit cca0420
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
3 changes: 2 additions & 1 deletion edwiser-bridge/admin/assets/css/eb-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
border: 1px solid #d6d6d6;
padding: 10px 10px 10px 20px;
background: #fafafa;
margin-top: 10px;
}

.eb_test_conct_log_url{
Expand Down Expand Up @@ -1339,7 +1340,7 @@ span.eb-option-input .eb-option-div select {

/*** START User Sync CSS ***/
.linkresponse-box {
margin-top: 3%;
margin-top: 15px;
/* position: absolute; */
/* margin-left: 20px; */
display: block;
Expand Down
10 changes: 7 additions & 3 deletions edwiser-bridge/admin/assets/js/eb-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@
});

async function start_diagnostics(url, token, $this, checks) {
jQuery('.run-diagnostics-start').html('');
jQuery('.run-diagnostics-start').html('<h2>' + eb_admin_js_object.running_diagnostics + '</h2>');
checks.forEach( async(check) => {
const res = await single_diagnostic(url, token, $this, check);
// jQuery('.run-diagnostics-start img.' + check + '_loader + .diagnostic_check_name').after( '<span class="auto_fix_issue eb_' + check + '_fix">Fix Now</span><div class="autofix_custom_message"></div>' );
Expand All @@ -797,10 +797,10 @@
} else {
if ( check == 'json_valid' || check == 'token_validation' ) {
jQuery('.run-diagnostics-start img.' + check + '_loader').attr('src', eb_admin_js_object.plugin_url + 'images/error.png');
jQuery('.run-diagnostics-start img.' + check + '_loader + .diagnostic_check_name').after( '<span class="auto_fix_issue eb_' + check + '_fix">Fix Now</span><div class="autofix_custom_message"></div>' );
jQuery('.run-diagnostics-start img.' + check + '_loader + .diagnostic_check_name').after( '<span class="auto_fix_issue eb_' + check + '_fix">' + eb_admin_js_object.eb_fix_now + '</span><div class="autofix_custom_message"></div>' );
} else {
jQuery('.run-diagnostics-start img.' + check + '_loader').attr('src', eb_admin_js_object.plugin_url + 'images/error.png');
jQuery('.run-diagnostics-start img.' + check + '_loader + .diagnostic_check_name').after( '<span class="auto_fix_issue eb_' + check + '_fix">Get More Details</span><div class="autofix_custom_message"></div>' );
jQuery('.run-diagnostics-start img.' + check + '_loader + .diagnostic_check_name').after( '<span class="auto_fix_issue eb_' + check + '_fix">' + eb_admin_js_object.get_more_details + '</span><div class="autofix_custom_message"></div>' );
}
}
console.log('--->', check + res);
Expand Down Expand Up @@ -946,6 +946,10 @@
jQuery('.eb_server_blocking_check_fix + .autofix_custom_message').text(eb_admin_js_object.not_authorized);
jQuery('.eb_server_blocking_check_fix + .autofix_custom_message').slideDown();
}
if ( response.data.validate_access.length == 0) {
jQuery('.eb_server_blocking_check_fix + .autofix_custom_message').text(eb_admin_js_object.check_mdl_config);
jQuery('.eb_server_blocking_check_fix + .autofix_custom_message').slideDown();
}
return;
},
error: function(jqXHR, textStatus, errorThrown) {
Expand Down
12 changes: 8 additions & 4 deletions edwiser-bridge/admin/assets/js/eb-setup-wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@
});

async function start_diagnostics(url, token, $this, checks) {
jQuery('.run-diagnostics-start').html('');
jQuery('.run-diagnostics-start').html('<h2>' + eb_setup_wizard.running_diagnostics + '</h2>');
checks.forEach( async(check) => {
const res = await single_diagnostic(url, token, $this, check);
// jQuery('.run-diagnostics-start img.' + check + '_loader + .diagnostic_check_name').after( '<span class="auto_fix_issue eb_' + check + '_fix">Fix Now</span><div class="autofix_custom_message"></div>' );
Expand All @@ -672,10 +672,10 @@
} else {
if ( check == 'json_valid' || check == 'token_validation' ) {
jQuery('.run-diagnostics-start img.' + check + '_loader').attr('src', eb_setup_wizard.plugin_url + 'images/error.png');
jQuery('.run-diagnostics-start img.' + check + '_loader + .diagnostic_check_name').after( '<span class="auto_fix_issue eb_' + check + '_fix">Fix Now</span><div class="autofix_custom_message"></div>' );
jQuery('.run-diagnostics-start img.' + check + '_loader + .diagnostic_check_name').after( '<span class="auto_fix_issue eb_' + check + '_fix">' + eb_setup_wizard.eb_fix_now + '</span><div class="autofix_custom_message"></div>' );
} else {
jQuery('.run-diagnostics-start img.' + check + '_loader').attr('src', eb_setup_wizard.plugin_url + 'images/error.png');
jQuery('.run-diagnostics-start img.' + check + '_loader + .diagnostic_check_name').after( '<span class="auto_fix_issue eb_' + check + '_fix">Get More Details</span><div class="autofix_custom_message"></div>' );
jQuery('.run-diagnostics-start img.' + check + '_loader + .diagnostic_check_name').after( '<span class="auto_fix_issue eb_' + check + '_fix">' + eb_setup_wizard.get_more_details + '</span><div class="autofix_custom_message"></div>' );
}
}
console.log('--->', check + res);
Expand Down Expand Up @@ -801,7 +801,7 @@
var token = $('#eb_setup_test_conn_token').val();
$.ajax({
method: "post",
url: eb_setup_wizard.ajaxurl,
url: eb_setup_wizard.ajax_url,
data: {
'action': 'eb_server_blocking_check',
'url': url.trim(),
Expand All @@ -821,6 +821,10 @@
jQuery('.eb_server_blocking_check_fix + .autofix_custom_message').text(eb_setup_wizard.not_authorized);
jQuery('.eb_server_blocking_check_fix + .autofix_custom_message').slideDown();
}
if ( response.data.validate_access.length == 0) {
jQuery('.eb_server_blocking_check_fix + .autofix_custom_message').text(eb_setup_wizard.check_mdl_config);
jQuery('.eb_server_blocking_check_fix + .autofix_custom_message').slideDown();
}
return;
},
error: function(jqXHR, textStatus, errorThrown) {
Expand Down
4 changes: 2 additions & 2 deletions edwiser-bridge/admin/class-eb-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,11 @@ class="<?php echo esc_attr( $value['class'] ); ?>"
if ( $show ) {
?>
<tr valign="top" class="<?php echo esc_attr( $value['parent_row_class'] ); ?>" style="position: relative;">
<?php if ( 'eb_test_connection_button' == $value['id'] ) { ?>
<?php if ( 'eb_diagnose_issues_button' != $value['id'] ) { ?>
<th scope="row" class="titledesc">
</th>
<?php } ?>
<td class="forminp forminp-<?php echo esc_html( sanitize_title( $value['type'] ) ); ?>">
<td class="forminp forminp-<?php echo esc_html( sanitize_title( $value['type'] ) ); ?>" style="position: relative;">
<input
name="<?php echo esc_attr( $value['id'] ); ?>"
id="<?php echo esc_attr( $value['id'] ); ?>"
Expand Down
4 changes: 4 additions & 0 deletions edwiser-bridge/admin/class-eb-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ public function admin_enqueue_scripts() {
'contact_support_misc' => esc_html__( 'Please contact our support team to check the issue.', 'edwiser-bridge' ),
'contact_support_get' => esc_html__( 'The GET endpoint seems to be missing please contact our support team to check the issue.', 'edwiser-bridge' ),
'contact_support_post' => esc_html__( 'The POST endpoint seems to be missing please contact our support team to check the issue.', 'edwiser-bridge' ),
'check_mdl_config' => esc_html__( 'Please check the moodle configuration and make sure the webservice is enabled and the user has the required permissions.', 'edwiser-bridge' ),
'running_diagnostics' => esc_html__( 'Running Diagnostics', 'edwiser-bridge' ),
'eb_fix_now' => esc_html__( 'Fix Now', 'edwiser-bridge' ),
'get_more_details' => esc_html__( 'Get More Details', 'edwiser-bridge' ),
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,10 @@ public function enqueue_scripts() {
'contact_support_misc' => esc_html__( 'Please contact our support team to check the issue.', 'edwiser-bridge' ),
'contact_support_get' => esc_html__( 'The GET endpoint seems to be missing please contact our support team to check the issue.', 'edwiser-bridge' ),
'contact_support_post' => esc_html__( 'The POST endpoint seems to be missing please contact our support team to check the issue.', 'edwiser-bridge' ),
'check_mdl_config' => esc_html__( 'Please check the moodle configuration and make sure the webservice is enabled and the user has the required permissions.', 'edwiser-bridge' ),
'running_diagnostics' => esc_html__( 'Running Diagnostics', 'edwiser-bridge' ),
'eb_fix_now' => esc_html__( 'Fix Now', 'edwiser-bridge' ),
'get_more_details' => esc_html__( 'Get More Details', 'edwiser-bridge' ),
)
);

Expand Down

0 comments on commit cca0420

Please sign in to comment.