woocommerce/plugins/woocommerce-admin/client/marketing/coupons/index.js

52 lines
1.1 KiB
JavaScript
Raw Normal View History

Add Coupon feature (https://github.com/woocommerce/woocommerce-admin/pull/4526) * Handle new object for posts and recommendations * Set breadcrumb parent for woocommerce-coupons to be woocommerce-marketing * Add main coupon wrapping component * Render coupon wrapper element below coupon table using wp-admin-scripts * Finish off implementing category param for data store resolvers * Create a helper trait for legacy coupons * Add coupon related titles and descriptions * Add note for the coupons being moved * Allow for querying by note name in the notes Data Store * Revamp coupon moved trait * Add the new note only if we don't have an unactioned note and perform a redirect to ensure menu updates * set_icon is deprecated * Move coupon menu, adding a note for customers * Translate title and descriptions * Whitespace * Account for coupon functionality being disabled * Hide legacy menu before redirect * Don’t keep adding the note if customer dismisses it from inbox * Move behind feature flag * Add note if feature enabled * Add filter to override coupon feature * Tweak option name to refer to wc_admin To help with finding etc. * use css variables * Add the new note only if we don't have an unactioned note * Switch the filter logic so `false` turns off the feature This is a bit more intuitive when utilizing the filter * Remove extraneous string and add trailing new lines * Use correct posts object in tests * Revert accidental removal of where_types * Add coupons category to RecommendedExtensions * Use 1.1 api to get categorized recommendations * Add missing text domains * Fix menu handling to point to woocommerce-marketing * Only load coupon scripts on the coupon page * Rework marketing menu logic to register pages more properly * Use correct wc-admin path for marketing page * Remove separate feature flag WC Admin has existing feature flags to load enable/disable the feature * Only set the coupon parent to marketing when the feature is enabled * Only load coupon feature if marketing feature is enabled Co-authored-by: Dan Bitzer <danielbitzer@gmail.com> Co-authored-by: Jeremy Pry <jeremy.pry@gmail.com>
2020-06-16 02:30:41 +00:00
/**
* External depenencies
*/
import { __ } from '@wordpress/i18n';
/**
* WooCommerce dependencies
*/
import { getSetting } from '@woocommerce/wc-admin-settings';
/**
* Internal dependencies
*/
import './style.scss';
import RecommendedExtensions from '../components/recommended-extensions';
import KnowledgeBase from '../components/knowledge-base';
import '../data';
const CouponsOverview = () => {
const allowMarketplaceSuggestions = getSetting(
'allowMarketplaceSuggestions',
false
);
return (
<div className="woocommerce-marketing-coupons">
{ allowMarketplaceSuggestions && (
<RecommendedExtensions
title={ __(
'Recommended coupon extensions',
'woocommerce-admin'
) }
description={ __(
'Take your coupon marketing to the next level with our recommended coupon extensions.',
'woocommerce-admin'
) }
Add Coupon feature (https://github.com/woocommerce/woocommerce-admin/pull/4526) * Handle new object for posts and recommendations * Set breadcrumb parent for woocommerce-coupons to be woocommerce-marketing * Add main coupon wrapping component * Render coupon wrapper element below coupon table using wp-admin-scripts * Finish off implementing category param for data store resolvers * Create a helper trait for legacy coupons * Add coupon related titles and descriptions * Add note for the coupons being moved * Allow for querying by note name in the notes Data Store * Revamp coupon moved trait * Add the new note only if we don't have an unactioned note and perform a redirect to ensure menu updates * set_icon is deprecated * Move coupon menu, adding a note for customers * Translate title and descriptions * Whitespace * Account for coupon functionality being disabled * Hide legacy menu before redirect * Don’t keep adding the note if customer dismisses it from inbox * Move behind feature flag * Add note if feature enabled * Add filter to override coupon feature * Tweak option name to refer to wc_admin To help with finding etc. * use css variables * Add the new note only if we don't have an unactioned note * Switch the filter logic so `false` turns off the feature This is a bit more intuitive when utilizing the filter * Remove extraneous string and add trailing new lines * Use correct posts object in tests * Revert accidental removal of where_types * Add coupons category to RecommendedExtensions * Use 1.1 api to get categorized recommendations * Add missing text domains * Fix menu handling to point to woocommerce-marketing * Only load coupon scripts on the coupon page * Rework marketing menu logic to register pages more properly * Use correct wc-admin path for marketing page * Remove separate feature flag WC Admin has existing feature flags to load enable/disable the feature * Only set the coupon parent to marketing when the feature is enabled * Only load coupon feature if marketing feature is enabled Co-authored-by: Dan Bitzer <danielbitzer@gmail.com> Co-authored-by: Jeremy Pry <jeremy.pry@gmail.com>
2020-06-16 02:30:41 +00:00
category="coupons"
/>
) }
<KnowledgeBase
category="coupons"
description={ __(
'Learn the ins and outs of successful coupon marketing from the experts at WooCommerce.',
'woocommerce-admin'
) }
Add Coupon feature (https://github.com/woocommerce/woocommerce-admin/pull/4526) * Handle new object for posts and recommendations * Set breadcrumb parent for woocommerce-coupons to be woocommerce-marketing * Add main coupon wrapping component * Render coupon wrapper element below coupon table using wp-admin-scripts * Finish off implementing category param for data store resolvers * Create a helper trait for legacy coupons * Add coupon related titles and descriptions * Add note for the coupons being moved * Allow for querying by note name in the notes Data Store * Revamp coupon moved trait * Add the new note only if we don't have an unactioned note and perform a redirect to ensure menu updates * set_icon is deprecated * Move coupon menu, adding a note for customers * Translate title and descriptions * Whitespace * Account for coupon functionality being disabled * Hide legacy menu before redirect * Don’t keep adding the note if customer dismisses it from inbox * Move behind feature flag * Add note if feature enabled * Add filter to override coupon feature * Tweak option name to refer to wc_admin To help with finding etc. * use css variables * Add the new note only if we don't have an unactioned note * Switch the filter logic so `false` turns off the feature This is a bit more intuitive when utilizing the filter * Remove extraneous string and add trailing new lines * Use correct posts object in tests * Revert accidental removal of where_types * Add coupons category to RecommendedExtensions * Use 1.1 api to get categorized recommendations * Add missing text domains * Fix menu handling to point to woocommerce-marketing * Only load coupon scripts on the coupon page * Rework marketing menu logic to register pages more properly * Use correct wc-admin path for marketing page * Remove separate feature flag WC Admin has existing feature flags to load enable/disable the feature * Only set the coupon parent to marketing when the feature is enabled * Only load coupon feature if marketing feature is enabled Co-authored-by: Dan Bitzer <danielbitzer@gmail.com> Co-authored-by: Jeremy Pry <jeremy.pry@gmail.com>
2020-06-16 02:30:41 +00:00
/>
</div>
);
};
export default CouponsOverview;