Skip to content

Commit

Permalink
Sync branch [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
pirate-bot authored Feb 26, 2024
2 parents ec62ad4 + 4174852 commit 55e97cc
Show file tree
Hide file tree
Showing 24 changed files with 824 additions and 143 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
##### [Version 3.8.2](https://github.com/Codeinwp/neve/compare/v3.8.1...v3.8.2) (2024-02-22)

### Bug Fixes:
- **Improved Frombricks survey**
- **Fix display of item description**: on regular menu items inside the navigation the description will not be shown now.

### Improvements
- **Updated internal dependencies**
- **Update Google Fonts**​:​ Get the newest Google fonts from the public font library.
- **Improved Upsell messaging**: Information should be more clear on what each features provides and where it can be found.
- Updated support for future Black Friday campaigns.

##### [Version 3.8.1](https://github.com/Codeinwp/neve/compare/v3.8.0...v3.8.1) (2024-01-30)

### Improvements
Expand Down
4 changes: 2 additions & 2 deletions assets/apps/customizer-controls/src/@types/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ declare global {
remaningTime?: string;
bannerUrl?: string;
customizerBannerUrl?: string;
linkDashboard?: string;
bannerStoreUrl?: string;
linkGlobal?: string;
linkCustomizer?: string;
customizerBannerStoreUrl?: string;
customizerBannerAlt?: string;
bannerAlt?: string;
};
Expand Down
11 changes: 9 additions & 2 deletions assets/apps/customizer-controls/src/builder-upsell/Upsells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ const Upsells: React.FC<Props> = ({ control }) => {
const { params } = control;
const { title, url } = params;

if (window?.NeveReactCustomize?.deal?.active) {
if (
window?.NeveReactCustomize?.deal?.active &&
window?.NeveReactCustomize?.deal?.customizerBannerStoreUrl &&
window?.NeveReactCustomize?.deal?.customizerBannerUrl
) {
return (
<div className="upsell-inner">
<a
href={window?.NeveReactCustomize?.deal?.linkCustomizer}
href={
window?.NeveReactCustomize?.deal
?.customizerBannerStoreUrl
}
target="_blank"
rel="external noreferrer noopener"
style={{ width: '100%', lineHeight: '0' }}
Expand Down
8 changes: 6 additions & 2 deletions assets/apps/dashboard/src/Components/Deal.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
/* global neveDash */

const Deal = () => {
if (!Boolean(window.neveDash?.deal?.active)) {
if (
!Boolean(window.neveDash?.deal?.active) ||
!Boolean(neveDash?.deal?.bannerUrl) ||
!Boolean(neveDash?.deal?.bannerStoreUrl)
) {
return <></>;
}

return (
<div className="nv-deal">
<a
href={neveDash?.deal?.linkDashboard}
href={neveDash?.deal?.bannerStoreUrl}
target="_blank"
rel="external noreferrer noopener"
>
Expand Down
7 changes: 5 additions & 2 deletions assets/apps/dashboard/src/utils/survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import formbricks from '@formbricks/js';
* Take the number of days since install and convert it to a category for NPS user profile.
*
* @param {number} number - Number to convert.
* @param {number} scale - Scale to use.
* @param {number} scale - Scale to use.
* @return {number} - Converted number.
*/
const convertToCategory = (number, scale = 1) => {
Expand All @@ -34,10 +34,13 @@ if ('undefined' !== typeof window && 'undefined' !== typeof window.neveDash) {
(window.neveDash?.license?.key ??
window.neveDash?.rootUrl?.replace(/[^\w\d]*/g, '')),
attributes: {
plan: window.neveDash?.license?.type ?? 'free',
plan: window.neveDash?.pro ? window.neveDash?.license?.tier : 0,
days_since_install: convertToCategory(
window.neveDash.daysSinceInstall
),
license_status: window.neveDash?.license?.valid ?? 'invalid',
free_version: window.neveDash?.version,
pro_version: window.neveDash?.proPluginVersion,
},
});
}
14 changes: 14 additions & 0 deletions assets/customizer/css/upsells.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@
padding-top: 10px;
align-items: center;
}
.nv-simple-upsell.column-layout {
flex-direction: column;
align-items: start;
gap: 16px;
border-bottom: 1px solid #ccc;
border-top: none;
padding-bottom: 12px;
}

.nv-simple-upsell.column-layout p {
font-size: 13px;
font-weight: normal;
}

.nv-simple-upsell p {
margin: 0 10px 0 0;
font-weight: 600;
Expand Down
Binary file modified assets/img/dashboard/black-friday-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/dashboard/black-friday-customizer-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions e2e-tests/specs/customizer/hfg/hfg-menu-item-description.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { test, expect } from '@playwright/test';
import { setCustomizeSettings } from '../../../utils';
import data from '../../../fixtures/customizer/hfg/menu-item-alignment-setup.json';

test.describe('Menu item description', function () {
test.beforeAll(async ({ browser, request, baseURL }) => {
await setCustomizeSettings('hfgMenuItemAlignment', data, {
request,
baseURL,
});

const context = await browser.newContext();
const page = await context.newPage();

await page.goto('/wp-admin/edit-tags.php?taxonomy=category');
await page.getByRole('textbox', { name: 'Name' }).click();
await page
.getByRole('textbox', { name: 'Name' })
.fill('ADescriptionCat');
await page.getByRole('textbox', { name: 'Slug' }).click();
await page
.getByRole('textbox', { name: 'Slug' })
.fill('adescriptioncat');
await page.getByRole('textbox', { name: 'Description' }).click();
await page
.getByRole('textbox', { name: 'Description' })
.fill('Some Description for the category');
await page.getByRole('button', { name: 'Add New Category' }).click();
await page.goto('wp-admin/nav-menus.php');

await page
.getByRole('heading', {
name: 'Categories Press return or enter to open this section ',
})
.click();
await page
.locator('#taxonomy-category-tabs')
.getByRole('link', { name: 'View All' })
.click();
await page.getByLabel('ADescriptionCat').check();

await Promise.all([
page.waitForResponse(
(res) =>
res.url().includes('wp-admin/admin-ajax.php') &&
res.status() === 200
),
page.getByRole('button', { name: 'Add to Menu' }).click(),
]);

await page.keyboard.press('End');
await page.waitForTimeout(500);

await expect(
page.locator('#menu-to-edit li.menu-item:last-child a.item-edit')
).toBeVisible();
await page
.locator('#menu-to-edit li.menu-item:last-child a.item-edit')
.click({ force: true });
await page.waitForTimeout(500);
await page
.locator(
'#menu-to-edit li.menu-item:last-child .menu-item-settings button.menus-move-right'
)
.click({ force: true });
await page.getByRole('button', { name: 'Save Menu' }).click();
});

test.afterAll(async ({ browser, request, baseURL }) => {
const context = await browser.newContext();
const page = await context.newPage();

await page.goto('/wp-admin/edit-tags.php?taxonomy=category');

await page.getByLabel('Select ADescriptionCat').check();
await page.locator('#bulk-action-selector-top').selectOption('delete');
await page.locator('#doaction').click();
});

test('Checks up item alignment', async ({ page }) => {
await page.goto('/?test_data=hfgMenuItemAlignment');

await page
.locator(
'.primary-menu-ul.nav-ul.menu-desktop li.menu-item.menu-item-has-children:last-child'
)
.hover();
await expect(page.locator('.neve-mm-description')).toHaveCount(0);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ test.describe('Blog/Archive 1 / Default Layout', () => {
}
});

test('Post Content Order', async ({ page }) => {
test('Post Content Order', async ({ page, request, baseURL }) => {
// Make sure the default layout is set.
await setCustomizeSettings('defaultLayout', data.archive1, {
request,
baseURL,
});

await page.goto('/?test_name=defaultLayout');
const posts = await page.locator('article.post');

Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @package Neve
*/

define( 'NEVE_VERSION', '3.8.1' );
define( 'NEVE_VERSION', '3.8.2' );
define( 'NEVE_INC_DIR', trailingslashit( get_template_directory() ) . 'inc/' );
define( 'NEVE_ASSETS_URL', trailingslashit( get_template_directory_uri() ) . 'assets/' );
define( 'NEVE_MAIN_DIR', get_template_directory() . '/' );
Expand Down
1 change: 1 addition & 0 deletions inc/admin/dashboard/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ private function get_localization() {
'deal' => ! defined( 'NEVE_PRO_VERSION' ) ? $offer->get_localized_data() : array(),
'rootUrl' => get_site_url(),
'daysSinceInstall' => round( ( time() - get_option( 'neve_install', 0 ) ) / DAY_IN_SECONDS ),
'proPluginVersion' => defined( 'NEVE_PRO_VERSION' ) ? NEVE_PRO_VERSION : '',
];

if ( defined( 'NEVE_PRO_PATH' ) ) {
Expand Down
8 changes: 0 additions & 8 deletions inc/core/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,6 @@ function () {

add_action( 'rest_api_init', [ $this, 'register_rest_routes' ] );
add_filter( 'neve_pro_react_controls_localization', [ $this, 'adapt_conditional_headers' ] );


if ( ! defined( 'NEVE_PRO_VERSION' ) ) {
$offer = new Limited_Offers();
if ( $offer->can_show_dashboard_banner() && $offer->is_active() ) {
$offer->load_dashboard_hooks();
}
}
}

/**
Expand Down
Loading

0 comments on commit 55e97cc

Please sign in to comment.