Skip to content

Commit

Permalink
[APP 705] add connect module, settings and notification component (#112)
Browse files Browse the repository at this point in the history
* Initial refactor commit

* ✅ Added build and tests CI/CD

* update: add src for admin settings

* update: incorrect constant names

* update: namespace

* add: accessibility settings

* update: webpack to output files inside a folder

* update: build output folders

* update: removed commented code

* update: npm scripts

* add: webpack config

* add: hooks

* update: move admin setting to the module folder

* update: assets loading logic

* update: add rule to move jsx props to multiline imporving readability

* add: connect modal

* update: hooks import for better readability

* update: replace functions with hooks

* add: connect module

* add: settings and get settings route

* add: hooks and contexts to get settings

* add: hooks

* add: notification component

* add: data api

* add: settings provider and connect settings

* add: husky

* fix: formatting and text-domain

* update: filter names

* fix: hook import

* add: set function for settings

* add: prop-types package

* update: refactor notification component and context

* update: remove filter for authorize url

* update: imports and exports of hooks

* update: plugin settings context filename and relevant imports

---------

Co-authored-by: Ohad <[email protected]>
  • Loading branch information
nirbhayel and bainternet authored Nov 13, 2024
1 parent 942076b commit 9056e59
Show file tree
Hide file tree
Showing 33 changed files with 1,730 additions and 8 deletions.
1 change: 1 addition & 0 deletions includes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ final class Manager {
public static function get_module_list(): array {
return [
'Legacy',
'Connect',
'Settings',
];
}
Expand Down
35 changes: 35 additions & 0 deletions modules/connect/classes/basic-enum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace EA11y\Modules\Connect\Classes;

use ReflectionClass;
use ReflectionException;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

abstract class Basic_Enum {
private static array $entries = [];

/**
* @throws ReflectionException
*/
public static function get_values(): array {
return array_values( self::get_entries() );
}

/**
* @throws ReflectionException
*/
protected static function get_entries(): array {
$caller = get_called_class();

if ( ! array_key_exists( $caller, self::$entries ) ) {
$reflect = new ReflectionClass( $caller );
self::$entries[ $caller ] = $reflect->getConstants();
}

return self::$entries[ $caller ];
}
}
22 changes: 22 additions & 0 deletions modules/connect/classes/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace EA11y\Modules\Connect\Classes;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

/**
* Class Config
*/
class Config {
const APP_NAME = 'once-click-accessibility';
const APP_PREFIX = 'ea11y';
const APP_REST_NAMESPACE = 'ea11y';
const BASE_URL = 'https://my.elementor.com/connect';
const ADMIN_PAGE = 'accessibility-settings-2';
const APP_TYPE = 'app_mailer';
const SCOPES = 'openid offline_access';
const STATE_NONCE = 'ea11y_auth_nonce';
const CONNECT_MODE = 'site';
}
Loading

0 comments on commit 9056e59

Please sign in to comment.