Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
3d75573
feat: boilerplate
jaredrethman Sep 24, 2024
c599556
feat: boilerplate
jaredrethman Sep 27, 2024
8dbb00f
feat: conditionally add `additional-brands` to local data
jaredrethman Oct 3, 2024
d531f93
feat: add jsdoc block to appease TS
jaredrethman Oct 3, 2024
5b473bb
feat: add wildcard `*` active menu item matching
jaredrethman Oct 3, 2024
d44cc90
feat: add request queuing and processing
jaredrethman Oct 3, 2024
e6a7c5a
refactor: label and return jsdoc type
jaredrethman Oct 3, 2024
b1d1890
feat: brand component, types
jaredrethman Oct 3, 2024
c522bcd
feat: working additional brands
jaredrethman Oct 3, 2024
abb5f5c
fix: ci / eslint, typescript
jaredrethman Oct 4, 2024
5291d1a
revert: request queing and removed early exit for `isFetching`
jaredrethman Oct 7, 2024
864ee40
feat: add conditional prop to init fetch logic
jaredrethman Oct 7, 2024
4b2782b
fix: eslint / ci
jaredrethman Oct 7, 2024
3f07212
refactor: add requests ref to track hook requests
jaredrethman Oct 8, 2024
a64031f
Merge remote-tracking branch 'origin/feat/ia-settings-display-setting…
jaredrethman Oct 8, 2024
9368d88
Merge remote-tracking branch 'origin/feat/ia-settings-display-setting…
jaredrethman Oct 10, 2024
18458a3
Merge remote-tracking branch 'origin/epic/ia' into feat/ia-settings-a…
jaredrethman Oct 14, 2024
4c86281
refactor: tweak loading title
jaredrethman Oct 14, 2024
1abb3a9
feat: add logo fetching logic & ui
jaredrethman Oct 15, 2024
3e30fef
feat: remove query args from cache key
jaredrethman Oct 17, 2024
7da9155
refactor: manage cache manually, code consolidation
jaredrethman Oct 17, 2024
945bf55
feat: add cache management
jaredrethman Oct 17, 2024
17c9ded
refactor: remove unnecessary properties from `Brand` type
jaredrethman Oct 17, 2024
dcdfc27
Merge remote-tracking branch 'origin/epic/ia' into feat/ia-settings-a…
jaredrethman Oct 17, 2024
971ec29
fix: ci / typescript, eslint
jaredrethman Oct 17, 2024
d6a9a17
Merge remote-tracking branch 'origin/feat/manual-cache-logic' into fe…
jaredrethman Oct 18, 2024
d91cde0
Merge remote-tracking branch 'origin/epic/ia' into feat/ia-settings-a…
jaredrethman Oct 18, 2024
7c51d97
refactor: component name changes + doc comments
jaredrethman Oct 21, 2024
e4715a7
refactor: replace property drill with const
jaredrethman Oct 21, 2024
0c754a2
feat: conditionally load additional-brands component
jaredrethman Oct 22, 2024
c256a23
refactor: pr feedback - update conditional
jaredrethman Oct 22, 2024
63ede23
refactor: pr feedback - placeholder
jaredrethman Oct 22, 2024
78c3e3c
refactor: move tab path to constant
jaredrethman Oct 22, 2024
cfeac38
fix: pr feedback - cancel button destination
jaredrethman Oct 22, 2024
c4d7d11
revert: name placeholder
jaredrethman Oct 22, 2024
3bd7e88
refactor: pr feedback - move slug to paceholder
jaredrethman Oct 22, 2024
75833a3
refactor: pr feedback - name placeholder
jaredrethman Oct 22, 2024
c10e4d7
feat: add error message to upsert
jaredrethman Oct 23, 2024
46b0018
fix: force add `slug` to cache
jaredrethman Oct 23, 2024
d95e89d
refactor: pr feedback - use entire `result`
jaredrethman Oct 23, 2024
920a27a
feat: pr feedback - `resetError` on location change
jaredrethman Oct 23, 2024
a9705bc
Merge remote-tracking branch 'origin/epic/ia' into feat/ia-settings-a…
jaredrethman Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 32 additions & 11 deletions includes/wizards/newspack/class-newspack-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class Newspack_Settings extends Wizard {
*/
public function get_local_data() {
$google_site_kit_url = google_site_kit_available() ? admin_url( 'admin.php?page=googlesitekit-settings#/connected-services/analytics-4' ) : admin_url( 'admin.php?page=googlesitekit-splash' );
return [
'connections' => [
$newspack_settings = [
'connections' => [
'label' => __( 'Connections', 'newspack-plugin' ),
'path' => '/',
'sections' => [
Expand Down Expand Up @@ -78,7 +78,7 @@ public function get_local_data() {
'customEvents' => $this->sections['custom-events']->get_data(),
],
],
'emails' => [
'emails' => [
'label' => __( 'Emails', 'newspack-plugin' ),
'sections' => [
'emails' => [
Expand All @@ -90,25 +90,46 @@ public function get_local_data() {
],
],
],
'social' => [
'social' => [
'label' => __( 'Social', 'newspack-plugin' ),
],
'syndication' => [
'syndication' => [
'label' => __( 'Syndication', 'newspack-plugin' ),
],
'seo' => [
'seo' => [
'label' => __( 'SEO', 'newspack-plugin' ),
],
'theme-and-brand' => [
'theme-and-brand' => [
'label' => __( 'Theme and Brand', 'newspack-plugin' ),
],
'display-settings' => [
'display-settings' => [
'label' => __( 'Display Settings', 'newspack-plugin' ),
],
'additional-brands' => [
'label' => __( 'Additional Brands', 'newspack-plugin' ),
],
];
if ( is_plugin_active( 'newspack-multibranded-site/newspack-multibranded-site.php' ) ) {
$newspack_settings['additional-brands'] = [
'label' => __( 'Additional Brands', 'newspack-plugin' ),
'activeTabPaths' => [
'/additional-brands/*',
],
'sections' => [
'additionalBrands' => [
'themeColors' => \Newspack_Multibranded_Site\Customizations\Theme_Colors::get_registered_theme_colors(),
'menuLocations' => get_registered_nav_menus(),
'menus' => array_map(
function( $menu ) {
return array(
'value' => $menu->term_id,
'label' => $menu->name,
);
},
wp_get_nav_menus()
),
],
],
];
}
return $newspack_settings;
}

/**
Expand Down
18 changes: 18 additions & 0 deletions src/wizards/newspack/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ declare module 'react' {
type WizardTab = {
label: string;
path?: string;
activeTabPaths?: string[];
sections: {
[ k: string ]: {
editLink?: string;
Expand Down Expand Up @@ -78,11 +79,28 @@ declare global {
};
};
};
'additional-brands': WizardTab & {
sections: {
additionalBrands: {
themeColors: {
color: string;
label: string;
theme_mod_name?: string;
default?: string;
}[];
menuLocations: Record< string, string >;
menus: { label: string; value: number }[];
};
};
};
'display-settings': WizardTab;
};
newspack_aux_data: {
is_debug_mode: boolean;
};
newspack_urls: {
site: string;
};
}
}

Expand Down
Loading