Skip to content

Commit

Permalink
Update wizard handling for quick actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Sep 10, 2024
1 parent 61e9903 commit 6c3f61f
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions ui/admin/setup-add.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@
<div id="pods-wizard-heading">
<ul>
<li class="pods-wizard-menu-current" data-step="1">
<i></i> <span>1</span> <?php esc_html_e( 'Create or Extend', 'pods' ); ?>
<i></i> <span>1</span> <?php esc_html_e( 'Step 1: Create or Extend', 'pods' ); ?>
<em></em>
</li>
<li data-step="2">
<i></i> <span>2</span> <?php esc_html_e( 'Configure', 'pods' ); ?>
<i></i> <span>2</span> <?php esc_html_e( 'Step 2: Configure', 'pods' ); ?>
<em></em>
</li>
</ul>
Expand Down Expand Up @@ -154,8 +154,8 @@
</a>

<?php if ( ! empty( $quick_actions ) ) : ?>
<div
id='pods-wizard-quick-actions'<?php echo( $submit_from_linked ? ' class="hidden"' : '' ); ?>>
<div id="pods-wizard-quick-actions"
<?php echo( $submit_from_linked ? 'class="hidden"' : '' ); ?>>
<h2 class="pods-wizard-one-click-actions-heading"><?php esc_html_e( 'One-Click Extend', 'pods' ); ?></h2>
<ul class="pods-wizard-one-click-actions">
<?php foreach ( $quick_actions as $quick_action_key => $quick_action ) : ?>
Expand All @@ -173,13 +173,6 @@ class="pods-wizard-quick-action"
<?php endforeach; ?>
</ul>
</div>

<div
id='pods-wizard-quick-actions-saving-in-progress'<?php echo( ! $submit_from_linked ? ' class="hidden"' : '' ); ?>>
<p><span class="pods-dfv-field__loading-indicator"
role="progressbar"></span> <?php esc_html_e( 'Creating your Extended Pod', 'pods' ); ?>
</p>
</div>
<?php endif; ?>
</div>
</div>
Expand Down Expand Up @@ -574,6 +567,14 @@ class="pods-wizard-quick-action"
</div>
</div>
</div>

<div id="pods-wizard-quick-actions-saving-in-progress"
<?php echo( ! $submit_from_linked ? 'class="hidden"' : '' ); ?>>
<p>
<span class="pods-dfv-field__loading-indicator" role="progressbar"></span>
<?php esc_html_e( 'Setting up your Extended Pod', 'pods' ); ?>
</p>
</div>
</div>

<div id="pods-wizard-actions" class="pods-wizard-button-interface">
Expand Down Expand Up @@ -606,7 +607,9 @@ class="pods-wizard-quick-action"
alert( 'Error: ' + err_msg );
if ( window.console ) console.log( err_msg );

jQuery( '#pods-wizard-quick-actions-saving-in-progress' ).hide();
jQuery( '#pods-wizard-quick-actions-saving-in-progress' ).addClass('hidden').hide();
jQuery( '#pods-wizard-start' ).click();
jQuery( '#pods-wizard-next' ).removeClass('hidden').show();
};

var pods_admin_option_select_callback = function ( $opt ) {
Expand Down Expand Up @@ -638,16 +641,17 @@ class="pods-wizard-quick-action"
jQuery( '#pods-form-ui-' + createExtend + '-pod-type' ).val( objectType );
jQuery( '#pods-form-ui-' + createExtend + '-' + objectType.replace( '_', '-' ) ).val( objectName );

jQuery( '#pods-wizard-heading li' ).removeClass().addClass('pods-wizard-menu-complete');
jQuery( '#pods-wizard-next' ).addClass('hidden').hide();
jQuery( '#pods-wizard-quick-actions-saving-in-progress' ).removeClass('hidden').show();

$action.closest( 'form' ).submit();
} );

<?php if ( $submit_from_linked ) : ?>
jQuery( '#pods-wizard-quick-action-<?php echo esc_attr( $submit_from_linked ); ?>' ).click();

$quick_actions.off( 'click' );

jQuery( '#pods-wizard-quick-actions' ).hide();
jQuery( '#pods-wizard-quick-actions-saving-in-progress' ).show();
<?php endif; ?>
}
} );
Expand Down

0 comments on commit 6c3f61f

Please sign in to comment.