-
${this.translations.title}
${this.isKitchenSink
? this.kitchenSink()
: html` ${this.renderStep()} `}
@@ -454,8 +456,6 @@ export class SetupWizard extends LitElement {
`;
}
- renderControls() {}
-
kitchenSink() {
return html`
diff --git a/dt-core/admin/js/dt-shared.js b/dt-core/admin/js/dt-shared.js
index 081f88ae4..9ac4265b2 100644
--- a/dt-core/admin/js/dt-shared.js
+++ b/dt-core/admin/js/dt-shared.js
@@ -83,6 +83,15 @@ window.dt_admin_shared = {
},
`dt-admin-settings/`,
),
+ modules_update: (modules) =>
+ makeRequest(
+ 'POST',
+ 'modules-update',
+ {
+ modules,
+ },
+ `dt-admin-settings/`,
+ ),
};
jQuery(function ($) {
diff --git a/dt-core/admin/menu/menu-setup-wizard.php b/dt-core/admin/menu/menu-setup-wizard.php
index f9c03c1b9..68f57f05f 100644
--- a/dt-core/admin/menu/menu-setup-wizard.php
+++ b/dt-core/admin/menu/menu-setup-wizard.php
@@ -19,6 +19,7 @@
class DT_Setup_Wizard
{
private static $_instance = null;
+ private $root = 'setup-wizard';
public static function instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
@@ -43,20 +44,26 @@ public function __construct() {
public function enqueue_scripts(){
dt_theme_enqueue_script( 'setup-wizard', 'dt-core/admin/components/setup-wizard.js', [], true );
dt_theme_enqueue_script( 'setup-wizard-open-element', 'dt-core/admin/components/setup-wizard-open-element.js', [ 'setup-wizard' ], true );
+ dt_theme_enqueue_script( 'setup-wizard-use-cases', 'dt-core/admin/components/setup-wizard-use-cases.js', [ 'setup-wizard', 'setup-wizard-open-element' ], true );
dt_theme_enqueue_script( 'setup-wizard-modules', 'dt-core/admin/components/setup-wizard-modules.js', [ 'setup-wizard', 'setup-wizard-open-element' ], true );
dt_theme_enqueue_script( 'setup-wizard-plugins', 'dt-core/admin/components/setup-wizard-plugins.js', [ 'setup-wizard', 'setup-wizard-open-element' ], true );
dt_theme_enqueue_script( 'setup-wizard-details', 'dt-core/admin/components/setup-wizard-details.js', [ 'setup-wizard', 'setup-wizard-open-element' ], true );
dt_theme_enqueue_script( 'setup-wizard-keys', 'dt-core/admin/components/setup-wizard-keys.js', [ 'setup-wizard', 'setup-wizard-open-element' ], true );
dt_theme_enqueue_script( 'setup-wizard-controls', 'dt-core/admin/components/setup-wizard-controls.js', [ 'setup-wizard', 'setup-wizard-open-element' ], true );
+ dt_theme_enqueue_script( 'setup-wizard-intro', 'dt-core/admin/components/setup-wizard-intro.js', [ 'setup-wizard', 'setup-wizard-open-element' ], true );
+ dt_theme_enqueue_script( 'setup-wizard-celebration', 'dt-core/admin/components/setup-wizard-celebration.js', [ 'setup-wizard', 'setup-wizard-open-element' ], true );
wp_localize_script( 'setup-wizard', 'setupWizardShare', [
'translations' => [
'title' => esc_html__( 'Disciple.Tools Setup Wizard', 'disciple_tools' ),
'next' => esc_html__( 'Next', 'disciple_tools' ),
+ 'submit' => esc_html__( 'Submit', 'disciple_tools' ),
+ 'confirm' => esc_html__( 'Confirm', 'disciple_tools' ),
'back' => esc_html__( 'Back', 'disciple_tools' ),
],
'steps' => $this->setup_wizard_steps(),
'data' => $this->setup_wizard_data(),
+ 'admin_url' => admin_url(),
] );
}
@@ -110,9 +117,13 @@ public function setup_wizard_steps() {
$bloginfo = get_bloginfo();
$steps = [
[
- 'key' => 'choose_your_path',
- 'name' => 'Choose your path',
- 'component' => 'setup-wizard-modules',
+ 'key' => 'intro',
+ 'component' => 'setup-wizard-intro',
+ ],
+ [
+ 'key' => 'choose_your_use_cases',
+ 'name' => 'Choose your use cases',
+ 'component' => 'setup-wizard-use-cases',
'description' => 'How are you planning to use DT?',
'config' => [
'media',
@@ -121,31 +132,10 @@ public function setup_wizard_steps() {
]
],
[
- 'name' => 'Site details',
- 'description' => 'Fill in some site details',
- 'component' => 'setup-wizard-details',
- 'config' => [
- [
- 'type' => 'options',
- 'options' => [
- [
- 'key' => 'blogname',
- 'name' => 'Site name',
- 'value' => isset( $bloginfo['name'] ) ? $bloginfo['name'] : '',
- ],
- [
- 'key' => 'blogdescription',
- 'name' => 'Site description',
- 'value' => isset( $bloginfo['description'] ) ? $bloginfo['description'] : '',
- ],
- [
- 'key' => 'admin_email',
- 'name' => 'Admin email',
- 'value' => isset( $bloginfo['admin_email'] ) ? $bloginfo['admin_email'] : '',
- ]
- ],
- ]
- ],
+ 'key' => 'choose_your_modules',
+ 'name' => 'Choose your modules',
+ 'component' => 'setup-wizard-modules',
+ 'description' => 'What modules do you want to use?',
],
[
'name' => 'Plugins',
@@ -161,6 +151,10 @@ public function setup_wizard_steps() {
'dt_mapbox_api_key' => DT_Mapbox_API::get_key(),
],
],
+ [
+ 'key' => 'celebration',
+ 'component' => 'setup-wizard-celebration',
+ ]
];
$steps = apply_filters( 'dt_setup_wizard_steps', $steps );
@@ -199,6 +193,7 @@ public static function get_plugins_list(){
public function setup_wizard_data() : array {
+ $modules = dt_get_option( 'dt_post_type_modules' );
$plugin_data = self::get_plugins_list();
$data = [
'use_cases' => [
@@ -246,38 +241,7 @@ public function setup_wizard_data() : array {
],
],
],
- 'modules' => [
- [
- 'key' => 'ipsum',
- 'name' => 'Ipsum',
- 'description' => 'Track who is ipsuming who',
- 'details' => [
- 'fields' => [],
- 'tiles' => [],
- 'workflows' => [],
- ],
- ],
- [
- 'key' => 'dolor',
- 'name' => 'Dolor',
- 'description' => 'Track who has been dolored when, and by who',
- ],
- [
- 'key' => 'lorem',
- 'name' => 'lorem',
- 'description' => 'Track the lorem status of your contacts',
- ],
- [
- 'key' => 'foo',
- 'name' => 'Foo',
- 'description' => 'Track contacts: who is fooing up with who; reminders of who needs fooing up with',
- ],
- [
- 'key' => 'bar',
- 'name' => 'Bar',
- 'description' => 'Track bars of people and their lorem status',
- ],
- ],
+ 'modules' => $modules,
'plugins' => $plugin_data,
];
diff --git a/dt-core/configuration/config-site-defaults.php b/dt-core/configuration/config-site-defaults.php
index feec9d936..8b8a9e656 100644
--- a/dt-core/configuration/config-site-defaults.php
+++ b/dt-core/configuration/config-site-defaults.php
@@ -135,8 +135,6 @@ function dt_get_option( string $name ) {
}
return get_option( 'dt_site_options' );
- break;
-
case 'dt_site_custom_lists':
$default_custom_lists = dt_get_site_custom_lists();
@@ -154,7 +152,6 @@ function dt_get_option( string $name ) {
}
//return apply_filters( "dt_site_custom_lists", get_option( 'dt_site_custom_lists' ) );
return get_option( 'dt_site_custom_lists' );
- break;
case 'dt_field_customizations':
return get_option( 'dt_field_customizations', [
@@ -192,8 +189,6 @@ function dt_get_option( string $name ) {
else {
return get_option( 'dt_base_user' );
}
- break;
-
case 'location_levels':
$default_levels = dt_get_location_levels();
@@ -216,7 +211,6 @@ function dt_get_option( string $name ) {
$levels = get_option( 'dt_location_levels' );
}
return $levels['location_levels'];
- break;
case 'auto_location':
$setting = get_option( 'dt_auto_location' );
if ( false === $setting ) {
@@ -224,8 +218,6 @@ function dt_get_option( string $name ) {
$setting = get_option( 'dt_auto_location' );
}
return $setting;
- break;
-
case 'dt_storage_connection_id':
return get_option( 'dt_storage_connection_id', '' );
@@ -235,8 +227,6 @@ function dt_get_option( string $name ) {
update_option( 'dt_email_base_subject', 'Disciple.Tools' );
}
return $subject_base;
- break;
-
case 'dt_email_base_address_reply_to':
return get_option( 'dt_email_base_address_reply_to', '' );
case 'dt_email_base_address':
@@ -282,7 +272,6 @@ function dt_get_option( string $name ) {
default:
return false;
- break;
}
}
@@ -313,15 +302,11 @@ function dt_update_option( $name, $value, $autoload = false ) {
$levels = wp_parse_args( $levels, $default_levels );
return update_option( 'dt_location_levels', $levels, $autoload );
-
- break;
case 'auto_location':
return update_option( 'dt_auto_location', $value, $autoload );
- break;
default:
return false;
- break;
}
}