Skip to content

Commit

Permalink
Merge pull request #28 from newfold-labs/update/cleanup
Browse files Browse the repository at this point in the history
cleanup for release 1.1.18
  • Loading branch information
circlecube authored Jan 26, 2024
2 parents 70c0d04 + 34f5644 commit 0c0126b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 40 deletions.
55 changes: 24 additions & 31 deletions includes/ComingSoon.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function __construct( Container $container ) {
'admin_notice_text' => __( 'Your site has Coming Soon mode active.', 'newfold-module-coming-soon' ),
'admin_bar_text' => '<div>' . __( 'Coming Soon Active', 'newfold-module-coming-soon' ) . '</div>',
'admin_bar_label' => __( 'Site Status: ', 'newfold-module-coming-soon' ),
'admin_bar_cs_active' => __( 'NOT LIVE', 'newfold-module-coming-soon' ),
'admin_bar_cs_inactive' => __( 'LIVE', 'newfold-module-coming-soon' ),
'admin_bar_cs_active' => __( 'Not Live', 'newfold-module-coming-soon' ),
'admin_bar_cs_inactive' => __( 'Live', 'newfold-module-coming-soon' ),
'template_page_title' => __( 'Coming Soon!', 'newfold-module-coming-soon' ),
'template_styles' => false,
'template_content' => false,
Expand Down Expand Up @@ -153,7 +153,6 @@ public function conditionally_trigger_coming_soon_action_hooks( bool $isEnabled
*/
public function trigger_enabled_action_hook() {
if ( ! did_action( 'newfold/coming-soon/enabled' ) ) {
ray( 'enabled' );
do_action( 'newfold/coming-soon/enabled' );
}
}
Expand All @@ -165,7 +164,6 @@ public function trigger_enabled_action_hook() {
*/
public function trigger_disabled_action_hook() {
if ( ! did_action( 'newfold/coming-soon/disabled' ) ) {
ray( 'disabled' );
do_action( 'newfold/coming-soon/disabled' );
}
}
Expand Down Expand Up @@ -254,47 +252,45 @@ public function admin_bar_coming_soon_admin_styles() {
?>
<style>
#nfd-site-status {
align-items: center;
background-color: #F8F8F8;
border-radius: 2px;
border-style: solid;
border-width: 1px;
color: #333333;
padding: 0 16px;
font-weight: 510;
display:flex;
height: 22px;
align-items: center;
display: flex;
font-weight: 500;
gap: 2px;
border-radius: 2px;
height: 22px;
margin-top: 4px;
padding: 0 14px;
}

#wpadminbar #wp-admin-bar-site-status .ab-item{
#wpadminbar #wp-admin-bar-site-status .ab-item{
height:22px;
}

#nfd-site-status-coming-soon {
color: #E01C1C;
display: none;
font-weight: 510;
}

#nfd-site-status-live {
color: #048200;
display: none;
font-weight: 510;
}

#nfd-site-status[data-coming-soon="true"] {
border: 1px solid var(--Dark-Red, #C71919);
border-color: var(--Dark-Red, #C71919);
}

#nfd-site-status[data-coming-soon="false"] {
border: 1px solid var(--A11y-GRN, #278224);
border-color: var(--A11y-GRN, #278224);
}

#nfd-site-status span {
display: none;
text-transform: uppercase;
font-weight: 500;
}

#nfd-site-status[data-coming-soon="true"] #nfd-site-status-coming-soon {
display: inline-block;
}
color: var(--Dark-Red, #C71919);
display: inline-block;
}

#nfd-site-status[data-coming-soon="false"] #nfd-site-status-live {
#nfd-site-status[data-coming-soon="false"] #nfd-site-status-live {
color: var(--A11y-GRN, #278224);
display: inline-block;
}
</style>
Expand Down Expand Up @@ -326,9 +322,6 @@ public function newfold_site_status( \WP_Admin_Bar $admin_bar ) {
'parent' => 'top-secondary',
'href' => admin_url( 'admin.php?page=' . $this->container->plugin()->id . '&nfd-target=coming-soon-section#/settings' ),
'title' => $content,
'meta' => array(
'title' => esc_attr__( 'Launch Your Site', 'newfold-module-coming-soon' ),
),
);
$admin_bar->add_menu( $site_status_menu );
}
Expand Down
20 changes: 11 additions & 9 deletions tests/cypress/integration/coming-soon.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe( 'Coming Soon', function () {

it( 'Coming Soon Toggle Functions', () => {
// Initial Coming Soon State
cy.get( '#wp-toolbar #wp-admin-bar-site-status' )
.contains( 'span', 'Coming Soon' )
cy.get( '#wp-toolbar #wp-admin-bar-site-status #nfd-site-status-coming-soon' )
.scrollIntoView()
.should( 'be.visible' );

cy.get( appClass + '-app-settings-coming-soon' )
Expand All @@ -26,7 +26,7 @@ describe( 'Coming Soon', function () {
.should( 'be.visible' );

cy.get( appClass + '-app-settings-coming-soon' )
.contains( 'label', 'Coming soon' )
.contains( 'label', 'Coming' )
.scrollIntoView()
.should( 'be.visible' );

Expand All @@ -41,8 +41,8 @@ describe( 'Coming Soon', function () {
cy.get( '[data-id="coming-soon-toggle"]' )
.should( 'have.attr', 'aria-checked' )
.and( 'include', 'false' );
cy.get( '#wp-toolbar #wp-admin-bar-site-status' )
.contains( 'span', 'Live' )
cy.get( '#wp-toolbar #wp-admin-bar-site-status #nfd-site-status-live' )
.scrollIntoView()
.should( 'be.visible' );
cy.get( '.nfd-notifications' )
.contains( '.nfd-notification', 'Coming soon deactivated' )
Expand All @@ -55,8 +55,8 @@ describe( 'Coming Soon', function () {
cy.get( '[data-id="coming-soon-toggle"]' )
.should( 'have.attr', 'aria-checked' )
.and( 'include', 'true' );
cy.get( '#wp-toolbar #wp-admin-bar-site-status' )
.contains( 'span', 'Coming Soon' )
cy.get( '#wp-toolbar #wp-admin-bar-site-status #nfd-site-status-coming-soon' )
.scrollIntoView()
.should( 'be.visible' );
cy.get( '.nfd-notifications' )
.contains( '.nfd-notification', 'Coming soon activated' )
Expand All @@ -69,9 +69,11 @@ describe( 'Coming Soon', function () {
.contains( 'div', 'Site Status' )
.should( 'be.visible' );
// Admin bar contains status
cy.get( '#wp-toolbar #wp-admin-bar-site-status' )
.contains( 'span', 'Coming Soon' )
cy.get( '#wp-toolbar #wp-admin-bar-site-status #nfd-site-status-coming-soon' )
.scrollIntoView()
.should( 'be.visible' );
cy.get( '#wp-toolbar #wp-admin-bar-site-status #nfd-site-status-live' )
.should( 'not.be.visible' );
} );

it( 'Has Coming Soon Section on Home', () => {
Expand Down

0 comments on commit 0c0126b

Please sign in to comment.