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

Fix count for previews #331

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/OnboardingSPA/steps/DesignHomepageMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
themeVariations:
select( nfdOnboardingStore ).getStepPreviewData(),
};
}, [] );

Check warning on line 47 in src/OnboardingSPA/steps/DesignHomepageMenu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useSelect has a missing dependency: 'location.pathname'. Either include it or remove the dependency array

Check warning on line 47 in src/OnboardingSPA/steps/DesignHomepageMenu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useSelect has a missing dependency: 'location.pathname'. Either include it or remove the dependency array

const {
setDrawerActiveView,
Expand All @@ -56,7 +56,7 @@
useEffect( () => {
setSidebarActiveView( SIDEBAR_LEARN_MORE );
setDrawerActiveView( VIEW_NAV_DESIGN );
}, [] );

Check warning on line 59 in src/OnboardingSPA/steps/DesignHomepageMenu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'setDrawerActiveView' and 'setSidebarActiveView'. Either include them or remove the dependency array

Check warning on line 59 in src/OnboardingSPA/steps/DesignHomepageMenu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'setDrawerActiveView' and 'setSidebarActiveView'. Either include them or remove the dependency array

function refactorPatterns( homepagePatternDataResp ) {
const makeHomepagePattern = [];
Expand Down Expand Up @@ -111,7 +111,7 @@
if ( themeStatus === THEME_STATUS_ACTIVE ) {
getHomepagePatternsData();
}
}, [ themeStatus ] );

Check warning on line 114 in src/OnboardingSPA/steps/DesignHomepageMenu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'getHomepagePatternsData'. Either include it or remove the dependency array

Check warning on line 114 in src/OnboardingSPA/steps/DesignHomepageMenu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'getHomepagePatternsData'. Either include it or remove the dependency array

const content = getContents();

Expand Down Expand Up @@ -150,7 +150,7 @@
watch={ homepagePattern }
count={
themeVariations[
currentStep?.patternId
currentStep?.data?.patternId
]?.previewCount
}
callback={ buildHomepagePreviews }
Expand Down
5 changes: 3 additions & 2 deletions src/OnboardingSPA/steps/DesignThemeStyles/Menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
themeStatus: select( nfdOnboardingStore ).getThemeStatus(),
themeVariations: select( nfdOnboardingStore ).getStepPreviewData(),
};
}, [] );

Check warning on line 62 in src/OnboardingSPA/steps/DesignThemeStyles/Menu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useSelect has a missing dependency: 'location.pathname'. Either include it or remove the dependency array

Check warning on line 62 in src/OnboardingSPA/steps/DesignThemeStyles/Menu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useSelect has a missing dependency: 'location.pathname'. Either include it or remove the dependency array

const {
setDrawerActiveView,
Expand All @@ -73,7 +73,7 @@
useEffect( () => {
setSidebarActiveView( SIDEBAR_LEARN_MORE );
setDrawerActiveView( VIEW_NAV_DESIGN );
}, [] );

Check warning on line 76 in src/OnboardingSPA/steps/DesignThemeStyles/Menu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'setDrawerActiveView' and 'setSidebarActiveView'. Either include them or remove the dependency array

Check warning on line 76 in src/OnboardingSPA/steps/DesignThemeStyles/Menu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'setDrawerActiveView' and 'setSidebarActiveView'. Either include them or remove the dependency array

const getStylesAndPatterns = async () => {
const patternsResponse = await getPatterns(
Expand All @@ -99,7 +99,7 @@
if ( themeStatus === THEME_STATUS_ACTIVE ) {
getStylesAndPatterns();
}
}, [ themeStatus ] );

Check warning on line 102 in src/OnboardingSPA/steps/DesignThemeStyles/Menu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'getStylesAndPatterns'. Either include it or remove the dependency array

Check warning on line 102 in src/OnboardingSPA/steps/DesignThemeStyles/Menu/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'getStylesAndPatterns'. Either include it or remove the dependency array

const handleClick = ( idx ) => {
const selectedGlobalStyle = globalStyles[ idx ];
Expand Down Expand Up @@ -171,8 +171,9 @@
<LivePreviewSkeleton
className={ 'theme-styles-menu__list__item' }
count={
themeVariations[ currentStep?.patternId ]
?.previewCount
themeVariations[
currentStep?.data?.patternId
]?.previewCount
}
watch={ pattern && globalStyles }
callback={ buildPreviews }
Expand Down
16 changes: 8 additions & 8 deletions src/OnboardingSPA/steps/SitePages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
themeVariations:
select( nfdOnboardingStore ).getStepPreviewData(),
};
}, [] );

Check warning on line 41 in src/OnboardingSPA/steps/SitePages/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useSelect has a missing dependency: 'location.pathname'. Either include it or remove the dependency array

Check warning on line 41 in src/OnboardingSPA/steps/SitePages/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useSelect has a missing dependency: 'location.pathname'. Either include it or remove the dependency array

const {
setDrawerActiveView,
Expand All @@ -50,7 +50,7 @@
useEffect( () => {
setSidebarActiveView( SIDEBAR_LEARN_MORE );
setDrawerActiveView( VIEW_NAV_DESIGN );
}, [] );

Check warning on line 53 in src/OnboardingSPA/steps/SitePages/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'setDrawerActiveView' and 'setSidebarActiveView'. Either include them or remove the dependency array

Check warning on line 53 in src/OnboardingSPA/steps/SitePages/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'setDrawerActiveView' and 'setSidebarActiveView'. Either include them or remove the dependency array

const getSitePages = async () => {
const sitePagesResponse = await getPatterns(
Expand Down Expand Up @@ -86,13 +86,13 @@
const stateToFlowData = ( selectedPages, pages ) => {
return pages !== false
? pages?.reduce( ( newSitePages, sitePage ) => {
return selectedPages.includes( sitePage.slug )
? newSitePages.concat( {
slug: sitePage.slug,
title: sitePage.title,
} )
: newSitePages;
}, [] )
return selectedPages.includes( sitePage.slug )
? newSitePages.concat( {
slug: sitePage.slug,
title: sitePage.title,
} )
: newSitePages;
}, [] )
: undefined;
};

Expand Down Expand Up @@ -151,7 +151,7 @@
if ( themeStatus === THEME_STATUS_ACTIVE ) {
getSitePages();
}
}, [ themeStatus ] );

Check warning on line 154 in src/OnboardingSPA/steps/SitePages/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'getSitePages'. Either include it or remove the dependency array

Check warning on line 154 in src/OnboardingSPA/steps/SitePages/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'getSitePages'. Either include it or remove the dependency array

const content = getContents();

Expand All @@ -170,7 +170,7 @@
className={ 'site-pages__list__item' }
count={
themeVariations[
currentStep?.patternId
currentStep?.data?.patternId
]?.previewCount
}
watch={ sitePages }
Expand Down