Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable add-ons for Omnisend discoverability #66

Merged
merged 26 commits into from
Mar 25, 2024
Merged

Enable add-ons for Omnisend discoverability #66

merged 26 commits into from
Mar 25, 2024

Conversation

Gabiermi
Copy link
Contributor

@Gabiermi Gabiermi commented Mar 19, 2024

arnas
arnas previously approved these changes Mar 22, 2024

public static function omnisend_post_connection() {
$connected = Options::is_store_connected();
// phpcs:ignore WordPress.WP.CapitalPDangit.MisspelledInText
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add some comment why this ignore is used

omnisend/src/connection/components/connection-steps.js Outdated Show resolved Hide resolved
3. Paste created API key here:
</div>
</div>
<Flex align={"'start'"} gap={4} wrap="true">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Flex align={"'start'"} gap={4} wrap="true">
<Flex align="align" gap={4} wrap="true">

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?


return (
<>
<div className="omnisend-spacing-mv-8">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we not using lib spacer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import ConnectionLogos from './connection-logos';
import ConnectionFeatures from './connection-features';
import ConnectionSteps from './connection-steps';
import { useState } from '@wordpress/element';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: we probably can import react directly instead using this wrapper WordPress/gutenberg#54074 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'react' should be listed in the project's dependencies.
In our case, it is only peerDependencies

const [error, setError] = useState(null);
const [loading, setLoading] = useState(null);

const connect = (apiKey) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connect => handleSiteConnection

.then((response) => response.json())
.then((data) => {
if (data.success) {
location.reload();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer to start using react router and simply redirect instead of have both react & php routing

}
})
.catch((e) => {
setError(e.message || e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error sholuld be clear for the user, wont this result in some unclear timeout error?

{
"name": "wp-omnisend",
"version": "1.0.0",
"description": "A pre-publish checklist for content that includes a customizable settings page.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update description

Co-authored-by: Arnas Gečas <13507001+arnas@users.noreply.github.com>
@nerijuszaniauskas nerijuszaniauskas changed the title initial version Enable add-ons for Omnisend discoverability Mar 22, 2024

add_action( 'admin_notices', 'Omnisend_Core_Bootstrap::admin_notices' );
add_action( 'admin_menu', 'Omnisend_Core_Bootstrap::add_admin_menu' );
add_action( 'admin_enqueue_scripts', 'Omnisend_Core_Bootstrap::load_omnisend_admin_styles' );

add_action( 'admin_init', 'Omnisend\Internal\Connection::connect_with_omnisend_for_woo_plugin' );

add_action(
'admin_enqueue_scripts',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this three can be extracted to function?

@@ -72,6 +133,21 @@ function ( $user_login, $user ) {
}
}


public static function omnisend_app_market() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacing not correct.

);

if (!response.ok) {
throw new Error('Failed to load apps');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can er display apps from local file instead of error?

@Gabiermi Gabiermi marked this pull request as ready for review March 25, 2024 14:09
@Gabiermi Gabiermi requested a review from a team as a code owner March 25, 2024 14:09
@Gabiermi Gabiermi merged commit 61b686b into main Mar 25, 2024
1 check passed
@Gabiermi Gabiermi deleted the apps-list branch March 25, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants