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

Merge for v2.6.0 #840

Merged
merged 74 commits into from
Mar 22, 2021
Merged
Changes from 4 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
2d365c4
fix of #648
AJIXuMuK Feb 14, 2021
2837c2f
changelog
AJIXuMuK Feb 14, 2021
d6890f1
pre-commit
AJIXuMuK Feb 14, 2021
359aa74
Fix case sensitive fluent icon search service
mbice Mar 4, 2021
4075706
Added AnimatedDialog control
anoopt Mar 6, 2021
92a0e39
merge with dev
AJIXuMuK Mar 6, 2021
ecd8830
2.6.0
AJIXuMuK Mar 6, 2021
1584760
prep for v 2.6.0
AJIXuMuK Mar 6, 2021
a58630f
pre-commit
AJIXuMuK Mar 6, 2021
1028894
Merge branch 'hotfix/icon-search-case-sensitive' of https://github.co…
AJIXuMuK Mar 6, 2021
e3a2bc4
reverting back to startsWith === false from !startsWith
AJIXuMuK Mar 6, 2021
8452f9d
Merge branch 'mbice-hotfix/icon-search-case-sensitive' into dev
AJIXuMuK Mar 6, 2021
51b0547
changelog
AJIXuMuK Mar 6, 2021
623239b
pre-commit
AJIXuMuK Mar 6, 2021
7efc2e1
Merge pull request #816 from anoopt/animated-dialog
AJIXuMuK Mar 6, 2021
63aa5ec
changelog, addinig Animated dialog control to the docs menu
AJIXuMuK Mar 6, 2021
f00b32f
pre-commit
AJIXuMuK Mar 6, 2021
982a15f
Update Carousel.md
AriGunawan Mar 7, 2021
3c51ce4
Minor improvements to Animated Dialog control
anoopt Mar 7, 2021
25e1248
Fix broken link : AccessibleAccordion
NizarGrindi Mar 8, 2021
ea696d7
Fix the "Controls" navigation node
NizarGrindi Mar 8, 2021
f36c2ca
Fixed links in documentation
anoopt Mar 8, 2021
0663c7d
Added default sort of filenames
gautamdsheth Mar 9, 2021
cd51e31
IconPicker - default search with . Additional prop to switch the sear…
AJIXuMuK Mar 10, 2021
8aa8b0b
changelog
AJIXuMuK Mar 10, 2021
cf26570
pre-commit
AJIXuMuK Mar 10, 2021
659d719
merge
AJIXuMuK Mar 10, 2021
531dda9
changelog
AJIXuMuK Mar 10, 2021
5ca4c26
pre-commit
AJIXuMuK Mar 10, 2021
e985e55
Merge pull request #817 from AriGunawan/patch-2
AJIXuMuK Mar 10, 2021
7a4f109
changelog
AJIXuMuK Mar 10, 2021
b9b7b9c
pre-commit
AJIXuMuK Mar 10, 2021
aba87e6
Merge pull request #819 from anoopt/animated-dialog
AJIXuMuK Mar 10, 2021
eb3288e
Merge branch 'dev' of https://github.com/pnp/sp-dev-fx-controls-react…
AJIXuMuK Mar 10, 2021
f343133
Merge pull request #821 from NizarGrindi/master
AJIXuMuK Mar 10, 2021
916747c
Merge branch 'dev' of https://github.com/pnp/sp-dev-fx-controls-react…
AJIXuMuK Mar 10, 2021
a8dd9dd
chagelog
AJIXuMuK Mar 10, 2021
dc37236
pre-commit
AJIXuMuK Mar 10, 2021
55fc983
Merge pull request #824 from gautamdsheth/feature/folder-file-sort
AJIXuMuK Mar 10, 2021
d4614d4
Merge branch 'dev' of https://github.com/pnp/sp-dev-fx-controls-react…
AJIXuMuK Mar 10, 2021
9c9423f
changelog
AJIXuMuK Mar 10, 2021
17f8ad9
pre-commit
AJIXuMuK Mar 10, 2021
44e1079
Accessible Accordion navigation fix
AJIXuMuK Mar 11, 2021
f732435
Updated code for Bug #829
kunj-sangani Mar 13, 2021
8d557a0
Fix null reference issues:
YannickRe Mar 13, 2021
5735056
Merge pull request #832 from YannickRe/treeview-fixnullref
AJIXuMuK Mar 14, 2021
3163f20
changelog
AJIXuMuK Mar 14, 2021
3a099be
pre-commit
AJIXuMuK Mar 14, 2021
45bae64
animated dialog animate.css reference fix
AJIXuMuK Mar 15, 2021
ef7a88b
Minor updates to documentation
anoopt Mar 16, 2021
b8ff487
Dashboard widget wrapper
Mar 16, 2021
979a760
Jest unit tests
Mar 16, 2021
50154c7
Fixed the build
Mar 16, 2021
25a48a2
Update folder explorer documentation
joelfmrodrigues Mar 16, 2021
0440d50
merge with dev
AJIXuMuK Mar 17, 2021
a88084e
Merge branch 'kunj-sangani-master' into dev
AJIXuMuK Mar 17, 2021
d056fa0
changelog
AJIXuMuK Mar 17, 2021
4aa5f7d
pre-commit
AJIXuMuK Mar 17, 2021
261f27e
Dashboard widget wrapper doc updated
Mar 17, 2021
446f6a8
Merge branch 'dev' into dashboard-error-catching-component
Mar 17, 2021
a95125e
Merge pull request #833 from anoopt/animated-dialog
AJIXuMuK Mar 19, 2021
e2520fc
Merge pull request #834 from mgwojciech/dev
AJIXuMuK Mar 19, 2021
52b2aa2
changelog
AJIXuMuK Mar 19, 2021
03e1796
pre-commit
AJIXuMuK Mar 19, 2021
1fc6151
Merge pull request #836 from Konradox/dashboard-error-catching-component
AJIXuMuK Mar 19, 2021
d05ca12
changelog
AJIXuMuK Mar 19, 2021
bbe032a
pre-commit
AJIXuMuK Mar 19, 2021
81c6c20
fix of #795
AJIXuMuK Mar 19, 2021
dbb48f3
changelog
AJIXuMuK Mar 19, 2021
8a1d35c
pre-commit
AJIXuMuK Mar 19, 2021
9e76b37
Merge pull request #835 from joelfmrodrigues/feature/update-folder-ex…
joelfmrodrigues Mar 19, 2021
866b884
update changelog
joelfmrodrigues Mar 19, 2021
81ae005
changelog
joelfmrodrigues Mar 20, 2021
fa45303
Updated changelog
estruyf Mar 22, 2021
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
5 changes: 3 additions & 2 deletions docs/documentation/docs/controls/Dashboard.md
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import { WidgetSize, Dashboard } from '@pnp/spfx-controls-react/lib/Dashboard';

- Use the `Dashboard` control in your code as follows:

```TypeSCript
```TypeScript
const linkExample = { href: "#" };
const calloutItemsExample = [
{
@@ -86,10 +86,11 @@ The Dashboard component can be configured with the following properties:

| Property | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| widgets | IWidget[] | yes | Widgtets collection. |
| widgets | IWidget[] | yes | Widgets collection. |
| allowHidingWidget | boolean | no | Specifies if widgets can be hidden from the dashboard. |
| onWidgetHiding | (widget: IWidget) => void | no | Handler of widget hiding event. |
| toolbarProps | IToolbarProps | no | Dashboard toolbar props. See [Toolbar](./Toolbar). |
| WidgetContentWrapper | React.ComponentType\<React.PropsWithChildren\<any>> | no | Optional component which wraps every Widget component. Useful for a custom error handling or styling. |

Interface `IWidget`

99 changes: 60 additions & 39 deletions src/controls/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@ import * as React from "react";
import {
ProviderConsumer as FluentUIThemeConsumer,
Box,
teamsTheme
teamsTheme,
ThemePrepared,
} from "@fluentui/react-northstar";
import {
Widget,
@@ -22,7 +23,7 @@ import { useTelemetry } from "../../common/telemetry";
*/
export interface IDashboardProps {
/**
* Widgtets collection
* Widgets collection
*/
widgets: IWidget[];
/**
@@ -37,16 +38,25 @@ export interface IDashboardProps {
* Dashboard toolbar props
*/
toolbarProps?: IToolbarProps;
/**
* Optional component which wraps every Widget component. Useful for a custom error handling or styling.
*/
WidgetContentWrapper?: React.ComponentType<React.PropsWithChildren<any>>;
}

export function Dashboard({
widgets,
allowHidingWidget,
onWidgetHiding,
toolbarProps }: IDashboardProps) {
toolbarProps,
WidgetContentWrapper: WidgetWrapperComponent,
}: IDashboardProps) {
const [stateWidgets, setWidgets] = React.useState(widgets);
const widgetRenderer = WidgetWrapperComponent
? renderWidgetWithWrappedContent
: renderWidget;

useTelemetry('ReactDashboard', {});
useTelemetry("ReactDashboard", {});

React.useEffect(() => {
setWidgets(widgets);
@@ -57,42 +67,53 @@ export function Dashboard({
if (!globalTheme || globalTheme.fontFaces.length == 0) {
globalTheme = teamsTheme;
}
return <DashboardTheme globalTheme={globalTheme}>
{toolbarProps && <Toolbar {...toolbarProps} />}
<Box className={styles.dashboardBox} >
{stateWidgets &&
stateWidgets.map(
(
widget: IWidget,
key: number
) => (
<Widget key={key} widget={widget}>
<WidgetTitle
widget={widget}
allowHidingWidget={allowHidingWidget}
onWidgetHiding={(hidingWidget: IWidget) => {
if (onWidgetHiding) {
onWidgetHiding(hidingWidget);
}
if (!hidingWidget.controlOptions) {
hidingWidget.controlOptions = {};
}
hidingWidget.controlOptions.isHidden = true;
setWidgets([...widgets]);
}}
globalTheme={globalTheme}
/>
<WidgetBody
widget={widget}
siteVariables={globalTheme.siteVariables}
/>
{widget.link && <WidgetFooter widget={widget} />}
</Widget>
)
)}
</Box>
</DashboardTheme>;
return (
<DashboardTheme globalTheme={globalTheme}>
{toolbarProps && <Toolbar {...toolbarProps} />}
<Box className={styles.dashboardBox}>
{stateWidgets && stateWidgets.map(widgetRenderer(globalTheme))}
</Box>
</DashboardTheme>
);
}}
/>
);

function renderWidgetWithWrappedContent(
globalTheme: ThemePrepared<any>
): (value?: IWidget, index?: number) => JSX.Element {
return (widget: IWidget, key: number) => {
return (
<WidgetWrapperComponent>
{renderWidget(globalTheme)(widget, key)}
</WidgetWrapperComponent>
);
};
}

function renderWidget(
globalTheme: ThemePrepared<any>
): (value?: IWidget, index?: number) => JSX.Element {
return (widget: IWidget, key: number) => (
<Widget key={key} widget={widget}>
<WidgetTitle
widget={widget}
allowHidingWidget={allowHidingWidget}
onWidgetHiding={(hidingWidget: IWidget) => {
if (onWidgetHiding) {
onWidgetHiding(hidingWidget);
}
if (!hidingWidget.controlOptions) {
hidingWidget.controlOptions = {};
}
hidingWidget.controlOptions.isHidden = true;
setWidgets([...widgets]);
}}
globalTheme={globalTheme}
/>
<WidgetBody widget={widget} siteVariables={globalTheme.siteVariables} />
{widget.link && <WidgetFooter widget={widget} />}
</Widget>
);
}
}
2 changes: 1 addition & 1 deletion src/webparts/controlsTest/components/ControlsTest.tsx
Original file line number Diff line number Diff line change
@@ -1696,7 +1696,7 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
title: "Card 6",
size: WidgetSize.Single,
link: linkExample,
},]} />
}]} />
<Toolbar actionGroups={{
'group1': {
'action1': {