Merge pull request #1568 from russgove/dev
This commit is contained in:
commit
a833b06a71
|
@ -21,9 +21,9 @@ React-securitygrid is an SPFX webpart that uses React and Office-UI-Fabric to re
|
|||
|
||||
![config panel](./src/images/MainDisplay.gif)
|
||||
|
||||
Empty libraries are displayed withh a black folder icon, those with items are displayed with a white folder. The user can expand a list or library by clicking on the desired row. (If the library or folder has more than 5000 items an error will be displayed ) For deeply nested folders the Title column can be resized by drag and drop. The display shows a the appropriate icpn circle if the user has the selected permission to the given list, library, file or folder. (NOTE:The grid does not currently take into account access give via membership in an active directory group-- coming soon!). IMPORTANT: The user must have permissions to access lists and enumerate permissions in order to view the grid.
|
||||
Empty libraries are displayed with a black folder icon, those with items are displayed with a white folder. The user can expand a list or library by clicking on the desired row. (If the library or folder has more than 5000 items an error will be displayed ) For deeply nested folders the Title column can be resized by drag and drop. The display shows a the appropriate icon circle if the user has the selected permission to the given list, library, file or folder. (NOTE:The grid does not currently take into account access give via membership in an active directory group-- coming soon!). IMPORTANT: The user must have permissions to access lists and enumerate permissions in order to view the grid.
|
||||
|
||||
The user can change the permission being tested by cliking the Permission in the command bar and selecting a new Permission:
|
||||
The user can change the permission being tested by clicking the Permission in the command bar and selecting a new Permission:
|
||||
|
||||
![permission panel](./src/images/selectPermissionsPopout.PNG)
|
||||
|
||||
|
@ -52,7 +52,7 @@ User Settings
|
|||
The Show Email or Name Toggle determines whether the name or email is displayed by default.
|
||||
The Show Security Groups checkbox determines whether SharePoint Security groups are included in the grid.
|
||||
The Show Users checkbox determines whether Users are included in the grid.
|
||||
The Only show users with permissions toggle determines whether the grid shold diplay all users with access to the web, or only users with the selected permission
|
||||
The Only show users with permissions toggle determines whether the grid should display all users with access to the web, or only users with the selected permission
|
||||
![config panel](./src/images/Permissions.gif)
|
||||
The Let Users Select users checkbox determines whether Users can filter the selected users in the grid.
|
||||
|
||||
|
@ -60,8 +60,8 @@ Display Settings
|
|||
|
||||
The Initial Title column width determines the initial width of the Title column(it can be resized).
|
||||
|
||||
The second configuarion pannel allows the owner to configure the List Settings
|
||||
![List Confoguration panel](./src/images/ListConfiguration.PNG)
|
||||
The second configuration panel allows the owner to configure the List Settings
|
||||
![List Configuration panel](./src/images/ListConfiguration.PNG)
|
||||
|
||||
List Settings
|
||||
|
||||
|
@ -82,7 +82,7 @@ This is a port of an Angular 1.3 SharePoint hosted App at https://github.com/rus
|
|||
|
||||
## Used SharePoint Framework Version
|
||||
|
||||
![version](https://img.shields.io/badge/version-1.10-green.svg)
|
||||
![SPFx 1.10.0](https://img.shields.io/badge/version-1.10-green.svg)
|
||||
|
||||
## Applies to
|
||||
|
||||
|
@ -103,6 +103,7 @@ Solution|Author(s)
|
|||
|
||||
Version|Date|Comments
|
||||
-------|----|--------
|
||||
1.0.0.3|October 28, 2020 | Update to office-ui-fabric-react 7.148.1, fixing icons and indentation for sub-folders
|
||||
1.0.0.2|April 5, 2021| Updates to SPFx 1.10; Allow display of multiple permissions
|
||||
1.0.0.1|April 25, 2018|Update to SPFx 1.4.1
|
||||
1.0.0.0|December 31, 2016|Initial version
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"isDomainIsolated": false,
|
||||
"name": "spsecurity-webpart-3-client-side-solution",
|
||||
"id": "788271fb-ee9b-40df-8381-eb3dc70d1982",
|
||||
"version": "1.0.0.1"
|
||||
"version": "1.0.0.3"
|
||||
},
|
||||
"paths": {
|
||||
"zippedPackage": "solution/spsecurity-webpart-3.sppkg"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -19,9 +19,10 @@
|
|||
"@types/react": "16.8.8",
|
||||
"@types/react-dom": "16.8.3",
|
||||
"@types/webpack-env": "1.13.1",
|
||||
"@uifabric/file-type-icons": "7.6.16",
|
||||
"lodash": "^4.17.4",
|
||||
"natives": "^1.1.6",
|
||||
"office-ui-fabric-react": "6.189.2",
|
||||
"office-ui-fabric-react": "7.148.1",
|
||||
"react": "16.8.5",
|
||||
"react-dom": "16.8.5"
|
||||
},
|
||||
|
|
|
@ -1,21 +1,16 @@
|
|||
import * as React from "react";
|
||||
import * as ReactDom from "react-dom";
|
||||
import { Version } from "@microsoft/sp-core-library";
|
||||
import { SPPermission } from "@microsoft/sp-page-context";
|
||||
import { PropertyFieldListPicker, PropertyFieldListPickerOrderBy } from '@pnp/spfx-property-controls/lib/PropertyFieldListPicker';
|
||||
import { PropertyFieldSelectedPermissions, IPropertyFieldSelectedPermissionsProps } from "./containers/PropertyFieldSelectedPermissions";
|
||||
import { sp } from "@pnp/sp";
|
||||
import * as strings from "spSecurityStrings";
|
||||
import SpSecurity from "./components/SpSecurity";
|
||||
import { ISpSecurityProps } from "./components/ISpSecurityProps";
|
||||
|
||||
import { ISpSecurityWebPartProps } from "./ISpSecurityWebPartProps";
|
||||
import { IPropertyPaneConfiguration, IPropertyPaneDropdownOption, PropertyPaneCheckbox, PropertyPaneDropdown, PropertyPaneSlider, PropertyPaneTextField, PropertyPaneToggle } from "@microsoft/sp-property-pane";
|
||||
import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base";
|
||||
import {
|
||||
IPropertyPaneConfiguration, PropertyPaneCheckbox,
|
||||
IPropertyPaneDropdownOption, PropertyPaneDropdown, PropertyPaneTextField,
|
||||
PropertyPaneToggle, PropertyPaneSlider
|
||||
} from "@microsoft/sp-property-pane";
|
||||
import { sp } from "@pnp/sp";
|
||||
import { PropertyFieldListPicker, PropertyFieldListPickerOrderBy } from '@pnp/spfx-property-controls/lib/PropertyFieldListPicker';
|
||||
import * as React from "react";
|
||||
import * as ReactDom from "react-dom";
|
||||
|
||||
import { ISpSecurityProps } from "./components/ISpSecurityProps";
|
||||
import SpSecurity from "./components/SpSecurity";
|
||||
import { PropertyFieldSelectedPermissions } from "./containers/PropertyFieldSelectedPermissions";
|
||||
import { ISpSecurityWebPartProps } from "./ISpSecurityWebPartProps";
|
||||
|
||||
export default class SpSecurityWebPart extends BaseClientSideWebPart<ISpSecurityWebPartProps> {
|
||||
public onInit(): Promise<void> {
|
||||
|
|
|
@ -1,33 +1,30 @@
|
|||
import * as React from "react";
|
||||
import styles from "./SpSecurity.module.scss";
|
||||
import { ISpSecurityProps } from "./ISpSecurityProps";
|
||||
import { ISpSecurityState } from "./ISpSecurityState";
|
||||
import { ILegendProps, Legend } from "./Legend";
|
||||
import SPSecurityService from "../../SPSecurityService";
|
||||
import { SPListItem, SPList, SPSiteUser, Helpers } from "../../SPSecurityService";
|
||||
import { Environment, EnvironmentType } from '@microsoft/sp-core-library';
|
||||
import { SPPermission } from "@microsoft/sp-page-context";
|
||||
import { indexOf, findIndex, find, filter, } from "lodash";
|
||||
import { DetailsList, IColumn, SelectionMode, IDetailsRowProps, Selection } from 'office-ui-fabric-react/lib/DetailsList';
|
||||
import { Icon } from 'office-ui-fabric-react/lib/Icon';
|
||||
import { getFileTypeIconProps, initializeFileTypeIcons } from '@uifabric/file-type-icons';
|
||||
import { filter, find, findIndex } from "lodash";
|
||||
import { Checkbox } from 'office-ui-fabric-react/lib/Checkbox';
|
||||
import { CommandBar } from "office-ui-fabric-react/lib/CommandBar";
|
||||
import { Stack } from "office-ui-fabric-react/lib/Stack";
|
||||
import { Spinner } from "office-ui-fabric-react/lib/Spinner";
|
||||
import { IContextualMenuItem, ContextualMenuItemType } from "office-ui-fabric-react/lib/ContextualMenu";
|
||||
import { ISelectedPermission } from "../ISpSecurityWebPartProps";
|
||||
import { ContextualMenuItemType, IContextualMenuItem } from "office-ui-fabric-react/lib/ContextualMenu";
|
||||
import { DetailsList, IColumn, Selection, SelectionMode } from 'office-ui-fabric-react/lib/DetailsList';
|
||||
import { Icon } from 'office-ui-fabric-react/lib/Icon';
|
||||
import { Panel, PanelType } from "office-ui-fabric-react/lib/Panel";
|
||||
import { Spinner } from "office-ui-fabric-react/lib/Spinner";
|
||||
import * as React from "react";
|
||||
|
||||
import SPSecurityService from "../../SPSecurityService";
|
||||
import { Helpers, SPList, SPListItem, SPSiteUser } from "../../SPSecurityService";
|
||||
import SelectedPermissionsPanel from "../containers/SelectedPermissionsPanel";
|
||||
import { css } from "@uifabric/utilities/lib/css";
|
||||
import {
|
||||
Environment,
|
||||
EnvironmentType
|
||||
} from '@microsoft/sp-core-library';
|
||||
import { ISelectedPermission } from "../ISpSecurityWebPartProps";
|
||||
import { ISpSecurityProps } from "./ISpSecurityProps";
|
||||
import { ISpSecurityState } from "./ISpSecurityState";
|
||||
import { Legend } from "./Legend";
|
||||
import styles from "./SpSecurity.module.scss";
|
||||
|
||||
/* tslint:disable */
|
||||
export default class SpSecurity extends React.Component<ISpSecurityProps, ISpSecurityState> {
|
||||
private svc: SPSecurityService = new SPSecurityService("ss");
|
||||
private userSelection = new Selection();
|
||||
private listSelection = new Selection();
|
||||
private validBrandIcons = " accdb csv docx dotx mpp mpt odp ods odt one onepkg onetoc potx ppsx pptx pub vsdx vssx vstx xls xlsx xltx xsn ";
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
this.state = {
|
||||
|
@ -54,8 +51,13 @@ export default class SpSecurity extends React.Component<ISpSecurityProps, ISpSec
|
|||
this.parentIsExpanded = this.parentIsExpanded.bind(this);
|
||||
this.renderUserSelected = this.renderUserSelected.bind(this);
|
||||
}
|
||||
public componentDidMount(): void {
|
||||
debugger;
|
||||
initializeFileTypeIcons();
|
||||
}
|
||||
public componentDidUpdate(): void {
|
||||
// disable postback of buttons. see https://github.com/SharePoint/sp-dev-docs/issues/492
|
||||
|
||||
if (Environment.type === EnvironmentType.ClassicSharePoint) {
|
||||
const buttons: NodeListOf<HTMLButtonElement> = this.props.domElement.getElementsByTagName('button');
|
||||
for (let i: number = 0; i < buttons.length; i++) {
|
||||
|
@ -203,44 +205,38 @@ export default class SpSecurity extends React.Component<ISpSecurityProps, ISpSec
|
|||
|
||||
public renderItemTitle(item?: any, index?: number, column?: IColumn): any {
|
||||
const extension = item.title.split('.').pop();
|
||||
const isValidExtension: boolean = (this.validBrandIcons.indexOf(" " + extension + " ") !== -1);
|
||||
const classname = css("ms-u-smOffset" + (item.level), isValidExtension ?
|
||||
`ms-Icon ms-BrandIcon--${extension} ms-BrandIcon--icon16`:
|
||||
`ms-Icon ms-Icon--TextDocument ${styles.themecolor}`);
|
||||
|
||||
debugger;
|
||||
const style = { marginLeft: item.level * 20 + 'px' }
|
||||
return (
|
||||
<div className={styles.itemTitle} >
|
||||
<div className={classname} />
|
||||
<div className={styles.itemTitle} style={style}>
|
||||
<Icon {...getFileTypeIconProps({ extension: extension, size: 16 })} />
|
||||
<span> {item.title}</span>
|
||||
</div>);
|
||||
}
|
||||
public renderListTitle(item?: any, index?: number, column?: IColumn): any {
|
||||
|
||||
const classname = css("ms-Icon", styles.themecolor, item.itemCount > 0 ?
|
||||
'ms-Icon ms-Icon--FabricFormLibrary':
|
||||
'ms-Icon ms-Icon--FabricFolder');
|
||||
|
||||
const iconName = item.itemCount > 0 ?
|
||||
'FabricFormLibrary' :
|
||||
'FabricFolder';
|
||||
return (
|
||||
<div className={styles.itemTitle} onClick={(e) => {
|
||||
//debugger;
|
||||
this.expandCollapseList(item);
|
||||
}}>
|
||||
<div className={classname} />
|
||||
<Icon iconName={iconName} className={styles.themecolor} />
|
||||
<span > {item.title}</span>
|
||||
</div>);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public renderFolderTitle(item?: any, index?: number, column?: IColumn): any {
|
||||
const classname = css("ms-u-smOffset" + (item.level),styles.themecolor, item.itemCount > 0 ?
|
||||
'ms-Icon ms-Icon--FabricFormLibrary':
|
||||
'ms-Icon ms-Icon--FabricFolder');
|
||||
const style = { marginLeft: item.level * 20 + 'px' }
|
||||
const iconName = item.itemCount > 0 ?
|
||||
'FabricFormLibrary' :
|
||||
'FabricFolder';
|
||||
|
||||
return (
|
||||
<div className={styles.itemTitle} onClick={(e) => {
|
||||
this.expandCollapseList(item);
|
||||
}}>
|
||||
<div className={classname} />
|
||||
<Icon iconName={iconName} style={style} className={styles.themecolor} />
|
||||
<span > {item.title}</span>
|
||||
</div>);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue