mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-02-12 07:55:08 +00:00
Merge pull request #3685 from nmtoblum/fix/3684_use_treeTop_setting_only_for_tree
This commit is contained in:
commit
90161e9004
@ -1,3 +1,4 @@
|
||||
|
||||
# Pages Hierarchy
|
||||
|
||||
## Summary
|
||||
@ -35,8 +36,8 @@ This web part allows users to create a faux page hierarchy in their pages librar
|
||||
|
||||
## Contributors
|
||||
|
||||
* [Bo George](https://github.com/bogeorge) ([@bo_george](https://twitter.com/bo_george))
|
||||
* [Nick Brown](https://github.com/techienickb) ([@techienickb](https://twitter.com/techienickb))
|
||||
* [Bo George](https://github.com/bogeorge)
|
||||
* [Nick Brown](https://github.com/techienickb)
|
||||
* [SlowRobot](https://github.com/SlowRobot)
|
||||
* [ruslan-s](https://github.com/ruslan-s)
|
||||
|
||||
@ -49,6 +50,7 @@ Version|Date|Comments
|
||||
1.3|March 31, 2022|Added a Tree View
|
||||
1.4|July 29, 2022|Updated Tree View Functionality
|
||||
1.5|March 29, 2023|Added support for non-English SitePages library paths
|
||||
1.6|May 11, Uses treeFrom/expandTo web part properties
|
||||
|
||||
## Minimal path to awesome
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
"This web part allows users to create a faux page hierarchy in their pages library and use it for page-to-page navigation."
|
||||
],
|
||||
"creationDateTime": "2020-04-30",
|
||||
"updateDateTime": "2023-03-29",
|
||||
"updateDateTime": "2023-05-11",
|
||||
"products": [
|
||||
"SharePoint"
|
||||
],
|
||||
@ -53,7 +53,12 @@
|
||||
"gitHubAccount": "ruslan-s",
|
||||
"name": "ruslan-s",
|
||||
"pictureUrl": "https://github.com/ruslan-s.png"
|
||||
}
|
||||
},
|
||||
{
|
||||
"gitHubAccount": "SlowRobot",
|
||||
"name": "SlowRobot",
|
||||
"pictureUrl": "https://github.com/SlowRobot.png"
|
||||
}
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
"name": "react-pages-hierarchy",
|
||||
"id": "89758fb6-85e2-4e2b-ac88-4f4e7e5f60cb",
|
||||
"title": "Pages Hierarchy",
|
||||
"version": "1.0.3.1",
|
||||
"version": "1.0.3.2",
|
||||
"includeClientSideAssets": true,
|
||||
"isDomainIsolated": false,
|
||||
"developer": {
|
||||
|
@ -88,7 +88,7 @@ function pagesReducer(state: PagesState, action: Action): PagesState {
|
||||
}
|
||||
}
|
||||
|
||||
export function usePageApi(currentPageId: number, pageEditFinished: boolean, context: WebPartContext, treeTop: number, treeExpandTo: number): PageApi {
|
||||
export function usePageApi(currentPageId: number, pageEditFinished: boolean, context: WebPartContext, treeTop?: number, treeExpandTo?: number): PageApi {
|
||||
const [pagesState, pagesDispatch] = useReducer(pagesReducer, {
|
||||
parentPageColumnExists: true,
|
||||
userCanManagePages: false,
|
||||
|
@ -10,7 +10,10 @@ import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder";
|
||||
import { TreeLayout } from '../Layouts/TreeLayout';
|
||||
|
||||
export const Container: React.FunctionComponent<IContainerProps> = props => {
|
||||
const pagesApi = usePageApi(props.currentPageId, props.pageEditFinished, props.context, props.treeFrom, props.treeExpandTo);
|
||||
// Use props.treeFrom / treeExpandTo value from settings only in display mode "tree"
|
||||
const treeFrom = (props.pagesToDisplay === PagesToDisplay.Tree) ? props.treeFrom : undefined;
|
||||
const treeExpandTo = (props.pagesToDisplay === PagesToDisplay.Tree) ? props.treeExpandTo : undefined;
|
||||
const pagesApi = usePageApi(props.currentPageId, props.pageEditFinished, props.context, treeFrom, treeExpandTo);
|
||||
let controlToRender = undefined;
|
||||
switch (props.pagesToDisplay) {
|
||||
case PagesToDisplay.Ancestors:
|
||||
|
Loading…
x
Reference in New Issue
Block a user