import React, { useEffect, useState } from 'react'; import { __, sprintf } from '@wordpress/i18n'; import apiFetch from '@wordpress/api-fetch'; import { Toaster } from '@brainstormforce/starter-templates-components'; import Button from '../../../../components/button/button'; import { useStateValue } from '../../../../store/store'; import PreviousStepLink from '../../../../components/util/previous-step-link/index'; import ICONS from '../../../../../icons'; import { checkRequiredPlugins, getDemo, } from '../../../import-site/import-utils'; const { restNonce } = starterTemplates; const LicenseValidationControls = () => { const storedState = useStateValue(); const [ { templateId, templateResponse, currentCustomizeIndex, importError, currentIndex, validateLicenseStatus, }, dispatch, ] = storedState; const [ error, setError ] = useState( '' ); const [ processing, setProcessing ] = useState( false ); const [ licenseKey, setLicenseKey ] = useState( '' ); const premiumTemplate = false; // Start the pre import process. useEffect( () => { if ( importError ) { dispatch( { type: 'set', currentIndex: currentIndex + 2, // Skip 2 steps. } ); } }, [ importError ] ); const validateKey = () => { if ( licenseKey === '' ) { setError( __( 'Please Enter License Key', 'astra-sites' ) ); return; } setProcessing( true ); apiFetch.use( apiFetch.createNonceMiddleware( restNonce ) ); apiFetch( { path: '/bsf-core/v1/license/activate', method: 'POST', data: { 'license-key': licenseKey, 'product-id': 'astra-pro-sites', }, } ).then( async ( response ) => { if ( response.success ) { await getDemo( templateId, storedState ); await checkRequiredPlugins( storedState ); dispatch( { type: 'set', licenseStatus: true, currentIndex: currentIndex + 1, } ); } else { setError( response.message ); } setProcessing( false ); } ); }; if ( premiumTemplate && '' !== astraSitesVars.license_page_builder && templateResponse[ 'astra-site-page-builder' ] !== astraSitesVars.license_page_builder && 'brizy' !== templateResponse[ 'astra-site-page-builder' ] && 'gutenberg' !== templateResponse[ 'astra-site-page-builder' ] ) { return

{ __( 'Not Valid License', 'astra-sites' ) }

; } const processingClass = processing ? 'processing' : ''; const supportLink = sprintf( //translators: %1$s Support page URL. __( ` Questions? Get in touch with our %1$ssupport team%2$s.`, 'astra-sites' ), ``, '' ); const lastStep = () => { dispatch( { type: 'set', currentCustomizeIndex: currentCustomizeIndex - 1, } ); }; const downloadLink = sprintf( //translators: %1$s Store page URL. __( `If you have purchased our Essential or Growth Bundle, please install the premium version of the plugin that you can %1$sdownload%2$s from our store.`, 'astra-sites' ), '', '' ); return ( <>

{ __( 'Already a customer?', 'astra-sites' ) }

{ validateLicenseStatus && (

{ __( 'If you have purchased our Essential or Growth Bundle, just enter your license key below to import this template.', 'astra-sites' ) }

) } { ! validateLicenseStatus && ( <>

{ __( 'Currently the free version is installed.', 'astra-sites' ) }

) }

{ validateLicenseStatus && (

{ setLicenseKey( e.target.value ); setError( '' ); } } />
) } { __( 'Back', 'astra-sites' ) } { error && ! processing && ( ) } ); }; export default LicenseValidationControls; {"id":174,"date":"2018-10-24T21:44:56","date_gmt":"2018-10-24T21:44:56","guid":{"rendered":"https:\/\/way2erp.com\/way2erp\/product\/import-placeholder-for-1070\/"},"modified":"2018-11-27T00:18:27","modified_gmt":"2018-11-26T18:48:27","slug":"sap-ecc-ehp7-grc-10-1-remote-server-access","status":"publish","type":"product","link":"https:\/\/way2erp.com\/product\/sap-ecc-ehp7-grc-10-1-remote-server-access\/","title":{"rendered":"SAP ECC.EHP7 GRC 10.1 Remote Server Access"},"content":{"rendered":"

<\/span><\/p>\n

SAP ECC.EHP7 GRC 10.1 Remote Server Access subscriptions offered in this page are shared among multiple users. This is how we bring the cost of subscriptions down. It is mostly unnoticeable that other users are working on same server. In order to avail a complete server with customizing options, please consider to opt for one of the subscriptions for dedicated SAP systems (more expensive).<\/span><\/p>\n

 <\/p>\n

SAP ECC.EHP7 GRC 10.1 Remote Server Access includes:<\/span><\/strong><\/p>\n