Skip to content
Closed
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
8 changes: 0 additions & 8 deletions assets/css/admin/facebook-for-woocommerce-connection.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@
min-height: calc(100vh - 200px);
}

#facebook-commerce-iframe-enhanced {
width: 100%;
max-width: 1100px;
min-height: calc(100vh - 200px);
background: transparent;
border: none;
}

.woocommerce-embed-page #wpbody-content {
padding-bottom: 0;
}
80 changes: 80 additions & 0 deletions assets/css/admin/facebook-for-woocommerce-shops.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#facebook-commerce-iframe-enhanced {
width: 100%;
max-width: 1100px;
min-height: calc(100vh - 200px);
background: transparent;
border: none;
}

.centered-container {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
margin-top: 20px;
}

.drawer-toggle-button {
width: 100%;
max-width: 1100px;
background-color: #fff;
border: 1px solid #ccc;
padding: 10px 20px;
text-align: left;
cursor: pointer;
font-size: 16px;
font-weight: 600;
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
box-sizing: border-box;
}

.drawer-toggle-button:hover {
background-color: #f9f9f9;
}

.caret {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #000;
transition: transform 0.3s ease;
}

.settings-drawer {
width: 100%;
max-width: 1100px;
background-color: #fff;
border-bottom: 1px solid #ccc;
border-right: 1px solid #ccc;
border-left: 1px solid #ccc;
overflow: hidden;
transition: max-height 0.3s ease, margin-bottom 0.3s ease;
max-height: 0;
margin: 0 auto;
box-sizing: border-box;
}

.settings-drawer-content {
padding: 20px;
padding-bottom: 0;
}

.button:disabled {
background-color: #f1f1f1;
cursor: not-allowed;
}

.sync-description {
font-size: 12px;
color: #666;
padding-top: 8px;
}

.woocommerce-embed-page #wpbody-content {
padding-bottom: 0;
}
80 changes: 3 additions & 77 deletions includes/Admin/Settings_Screens/Shops.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function enqueue_assets() {
return;
}

wp_enqueue_style( 'wc-facebook-admin-connection-settings', facebook_for_woocommerce()->get_plugin_url() . '/assets/css/admin/facebook-for-woocommerce-connection.css', array(), \WC_Facebookcommerce::VERSION );
wp_enqueue_style( 'wc-facebook-admin-shops-settings', facebook_for_woocommerce()->get_plugin_url() . '/assets/css/admin/facebook-for-woocommerce-shops.css', array(), \WC_Facebookcommerce::VERSION );

wp_enqueue_script(
'wc-facebook-enhanced-settings-sync',
Expand Down Expand Up @@ -191,20 +191,18 @@ private function render_facebook_iframe() {
*/
private function render_troubleshooting_button_and_drawer() {
?>
<!-- Toggle Button -->
<div class="centered-container">
<button id="toggle-troubleshooting-drawer" class="drawer-toggle-button">
Troubleshooting
<span id="caret" class="caret"></span>
</button>
</div>

<!-- Drawer -->
<div id="troubleshooting-drawer" class="settings-drawer" style="display: none;">
<div class="settings-drawer-content">
<table class="form-table">
<tbody>
<tr valign="top" class="wc-facebook-connected-sample">
<tr valign="top" class="wc-facebook-shops-sample">
<th scope="row" class="titledesc">
Product data sync
</th>
Expand All @@ -220,7 +218,7 @@ class="button"
</p>
</td>
</tr>
<tr valign="top" class="wc-facebook-connected-sample">
<tr valign="top" class="wc-facebook-shops-sample">
<th scope="row" class="titledesc">
Coupon codes sync
</th>
Expand All @@ -242,79 +240,7 @@ class="button"
</div>
</div>

<style>
.centered-container {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
margin-top: 20px;
}

.drawer-toggle-button {
width: 100%;
max-width: 1100px;
background-color: #fff;
border: 1px solid #ccc;
padding: 10px 20px;
text-align: left;
cursor: pointer;
font-size: 16px;
font-weight: 600;
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
box-sizing: border-box;
}

.drawer-toggle-button:hover {
background-color: #f9f9f9;
}

.caret {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #000;
transition: transform 0.3s ease;
}

.settings-drawer {
width: 100%;
max-width: 1100px;
background-color: #fff;
border-bottom: 1px solid #ccc;
border-right: 1px solid #ccc;
border-left: 1px solid #ccc;
overflow: hidden;
transition: max-height 0.3s ease, margin-bottom 0.3s ease;
max-height: 0;
margin: 0 auto;
box-sizing: border-box;
}

.settings-drawer-content {
padding: 20px;
padding-bottom: 0;
}

.button:disabled {
background-color: #f1f1f1;
cursor: not-allowed;
}

.sync-description {
font-size: 12px;
color: #666;
padding-top: 8px;
}
</style>

<script>
// Toggle drawer visibility
document.getElementById('toggle-troubleshooting-drawer').addEventListener('click', function() {
var drawer = document.getElementById('troubleshooting-drawer');
var caret = document.getElementById('caret');
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Admin/Settings/ShopsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testEnqueueAssetsWhenNotOnPage(): void {
// No styles should be enqueued
$shops->enqueue_assets();

$this->assertFalse(wp_style_is('wc-facebook-admin-connection-settings'));
$this->assertFalse(wp_style_is('wc-facebook-admin-shops-settings'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Admin/Settings_Screens/ShopsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function test_render_facebook_box_iframe() {
// Since we can't directly test the private render_facebook_iframe method,
// we'll verify that the render method doesn't output the legacy Facebook box
// when enhanced onboarding is enabled
$this->assertStringNotContainsString('wc-facebook-shops-box', $output);
$this->assertStringNotContainsString('wc-facebook-connection-box', $output);
}

/**
Expand Down