From 01c36fe25f7e9526513bfce24dfc7a0c828f739a Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 2 Oct 2024 14:21:11 -0400 Subject: [PATCH] update to use buildless component --- composer.json | 1 + composer.lock | 50 +++++++++++++++- src/app/data/routes.js | 2 +- src/app/pages/solutions/index.js | 58 +++++++++++++++++++ .../{wpsolutions => solutions}/style.scss | 0 src/app/pages/wpsolutions/index.js | 21 ------- 6 files changed, 109 insertions(+), 23 deletions(-) create mode 100644 src/app/pages/solutions/index.js rename src/app/pages/{wpsolutions => solutions}/style.scss (100%) delete mode 100644 src/app/pages/wpsolutions/index.js diff --git a/composer.json b/composer.json index be79c8a95..3208128be 100644 --- a/composer.json +++ b/composer.json @@ -93,6 +93,7 @@ "newfold-labs/wp-module-performance": "2.0.1 as 1.9.9", "newfold-labs/wp-module-runtime": "^1.0.11", "newfold-labs/wp-module-secure-passwords": "^1.1.1", + "newfold-labs/wp-module-solutions": "dev-update/buildless-component", "newfold-labs/wp-module-sso": "^1.0.6", "newfold-labs/wp-module-staging": "^2.1.0", "wp-forge/wp-update-handler": "^1.0.2", diff --git a/composer.lock b/composer.lock index 24988f423..88aed476f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b1b36c7b3a5d00dd3305d0769b6f80c4", + "content-hash": "cd36857f0019c125c67cafa8ea9862d3", "packages": [ { "name": "doctrine/inflector", @@ -1905,6 +1905,53 @@ }, "time": "2024-01-31T18:14:24+00:00" }, + { + "name": "newfold-labs/wp-module-solutions", + "version": "dev-update/buildless-component", + "source": { + "type": "git", + "url": "git@github.com:newfold-labs/wp-module-solutions.git", + "reference": "835364c1bd3117c8fabb6b3fc07c60ff5b4655b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/newfold-labs/wp-module-solutions/zipball/835364c1bd3117c8fabb6b3fc07c60ff5b4655b5", + "reference": "835364c1bd3117c8fabb6b3fc07c60ff5b4655b5", + "shasum": "" + }, + "require": { + "newfold-labs/wp-module-data": "^2.6.3", + "newfold-labs/wp-module-loader": "^1.0.10" + }, + "require-dev": { + "newfold-labs/wp-php-standards": "^1.2", + "wp-cli/i18n-command": "^2.4.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "NewfoldLabs\\WP\\Module\\Solutions\\": "includes" + }, + "files": [ + "bootstrap.php" + ] + }, + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "arati bhandare AKA aratidgr8", + "email": "aratidgr8@gmail.com" + } + ], + "description": "A Newfold module that handles integration of WordPress Solutions Addon packages (content creator/ service / ecommerce) for BlueHost & HostGator customers", + "support": { + "source": "https://github.com/newfold-labs/wp-module-solutions/tree/update/buildless-component", + "issues": "https://github.com/newfold-labs/wp-module-solutions/issues" + }, + "time": "2024-10-02T17:57:59+00:00" + }, { "name": "newfold-labs/wp-module-sso", "version": "1.0.6", @@ -4935,6 +4982,7 @@ ], "minimum-stability": "stable", "stability-flags": { + "newfold-labs/wp-module-solutions": 20, "roave/security-advisories": 20 }, "prefer-stable": false, diff --git a/src/app/data/routes.js b/src/app/data/routes.js index 148b7aea3..39f10ca74 100644 --- a/src/app/data/routes.js +++ b/src/app/data/routes.js @@ -16,7 +16,7 @@ import Home from '../pages/home'; import PagesAndPosts from '../pages/pages-and-posts'; import Store from '../pages/ecommerce/page'; import Marketplace from '../pages/marketplace'; -import WPSolution from '../pages/wpsolutions'; +import Solutions from '../pages/solutions'; import Performance from '../pages/performance'; import Settings from '../pages/settings'; import Staging from '../pages/staging'; diff --git a/src/app/pages/solutions/index.js b/src/app/pages/solutions/index.js new file mode 100644 index 000000000..58600dab4 --- /dev/null +++ b/src/app/pages/solutions/index.js @@ -0,0 +1,58 @@ +import './style.scss'; +import apiFetch from '@wordpress/api-fetch'; +import { useState, useEffect } from '@wordpress/element'; +import { useLocation, useMatch, useNavigate } from 'react-router-dom'; +import { Container, Page, Title } from '@newfold/ui-component-library'; +import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; +import { default as NewfoldEntitlements } from '@modules/wp-module-solutions/components/entitlements'; + +const Solutions = () => { + + // constants to pass to module + const moduleConstants = { + text: { + title: __( 'Solution', 'bluehost-wordpress-plugin' ), + subTitle: __( + 'Explore the entitlements available with your solution.', + 'bluehost-wordpress-plugin' + ), + error: __( + 'Oops, there was an error loading the entitlements, please try again later.', + 'bluehost-wordpress-plugin' + ), + noEntitlements: __( + 'Sorry, no current entitlements. Please, try again later.', + 'bluehost-wordpress-plugin' + ), + }, + }; + + // methods to pass to module + const moduleMethods = { + apiFetch, + classNames, + useState, + useEffect, + useLocation, + useMatch, + useNavigate, + NewfoldRuntime, + }; + + return ( + + + + + + ); +}; + +export default Solutions; diff --git a/src/app/pages/wpsolutions/style.scss b/src/app/pages/solutions/style.scss similarity index 100% rename from src/app/pages/wpsolutions/style.scss rename to src/app/pages/solutions/style.scss diff --git a/src/app/pages/wpsolutions/index.js b/src/app/pages/wpsolutions/index.js deleted file mode 100644 index 28158a00a..000000000 --- a/src/app/pages/wpsolutions/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import './styles.scss'; -import { Page } from '@newfold/ui-component-library'; -import { NewfoldSolutions } from '@newfold-labs/wp-module-solutions'; -import '@newfold-labs/wp-module-ecommerce/bluehost.css'; -import { useNavigate } from 'react-router-dom'; -import { useNotification } from '../../components/notifications'; - -const WPSolutions = () => { - - const navigate = useNavigate(); - const notify = useNotification(); - const wpModules = { navigate, notify }; - - return ( - - - - ); -}; - -export default WPSolutions;