diff --git a/samples/react-manage-profile-card-properties/README.md b/samples/react-manage-profile-card-properties/README.md index 639e9ce1b..76b4a58b8 100644 --- a/samples/react-manage-profile-card-properties/README.md +++ b/samples/react-manage-profile-card-properties/README.md @@ -6,11 +6,17 @@ We can create, edit, delete, directory properties that can be add to profile car Only users with Tenant Admin Role are allowed to managed profile card properties. -## Site Designs List +## Manage Profile Card Properties -![site design list](https://github.com/joaojmendes/sp-dev-fx-webparts/blob/dev/samples/react-manage-sitedesigns/assets/screen1.jpg) +![manageProps](assets/Screenshot1.png) +![manageProps](assets/Screenshot2.png) +![manageProps](assets/Screenshot3.png) + +![manageProps](assets/Screenshot4.png) + +![manageProps](assets/Screenshot5.png) @@ -59,6 +65,7 @@ Version|Date|Comments - `gulp bundle --ship` - `gulp package-solution --ship` - `Add to AppCatalog and deploy` - - approve the required permissions (User.ReadWrite) on SharePoint Admin in App permissions + +- approve the required permissions (User.ReadWrite, Directory.AccessAsUser.All) on SharePoint Admin in App permissions - + diff --git a/samples/react-manage-profile-card-properties/assets/Screenshot1.png b/samples/react-manage-profile-card-properties/assets/Screenshot1.png new file mode 100644 index 000000000..bc76ab9dc Binary files /dev/null and b/samples/react-manage-profile-card-properties/assets/Screenshot1.png differ diff --git a/samples/react-manage-profile-card-properties/assets/Screenshot2.png b/samples/react-manage-profile-card-properties/assets/Screenshot2.png new file mode 100644 index 000000000..037d8bf57 Binary files /dev/null and b/samples/react-manage-profile-card-properties/assets/Screenshot2.png differ diff --git a/samples/react-manage-profile-card-properties/assets/Screenshot3.png b/samples/react-manage-profile-card-properties/assets/Screenshot3.png new file mode 100644 index 000000000..531fc18e8 Binary files /dev/null and b/samples/react-manage-profile-card-properties/assets/Screenshot3.png differ diff --git a/samples/react-manage-profile-card-properties/assets/Screenshot4.png b/samples/react-manage-profile-card-properties/assets/Screenshot4.png new file mode 100644 index 000000000..a3f242273 Binary files /dev/null and b/samples/react-manage-profile-card-properties/assets/Screenshot4.png differ diff --git a/samples/react-manage-profile-card-properties/assets/Screenshot5.png b/samples/react-manage-profile-card-properties/assets/Screenshot5.png new file mode 100644 index 000000000..2eaf943da Binary files /dev/null and b/samples/react-manage-profile-card-properties/assets/Screenshot5.png differ diff --git a/samples/react-manage-profile-card-properties/config/package-solution.json b/samples/react-manage-profile-card-properties/config/package-solution.json index 7d59d111c..14a193832 100644 --- a/samples/react-manage-profile-card-properties/config/package-solution.json +++ b/samples/react-manage-profile-card-properties/config/package-solution.json @@ -11,6 +11,10 @@ { "resource": "Microsoft Graph", "scope": "User.ReadWrite.All" + }, + { + "resource": "Microsoft Graph", + "scope": "Directory.AccessAsUser.All" } ] }, diff --git a/samples/react-manage-profile-card-properties/src/components/ManageProfileCardProperties/ManageProfileCardProperties.tsx b/samples/react-manage-profile-card-properties/src/components/ManageProfileCardProperties/ManageProfileCardProperties.tsx index e951c5b9a..bc38831f0 100644 --- a/samples/react-manage-profile-card-properties/src/components/ManageProfileCardProperties/ManageProfileCardProperties.tsx +++ b/samples/react-manage-profile-card-properties/src/components/ManageProfileCardProperties/ManageProfileCardProperties.tsx @@ -124,8 +124,8 @@ export default class ManageProfileCardProperties extends React.Component< name: "Directory Property Name", fieldName: "displayAttribute", isResizable: true, - maxWidth: 160, - minWidth: 50, + maxWidth: 210, + minWidth: 150, isSorted: true, isSortedDescending: false, onColumnClick: this._onColumnClick, @@ -349,6 +349,12 @@ export default class ManageProfileCardProperties extends React.Component< this._selection.setAllSelected(false); this.setState({ isLoading: true, hasError: false, errorMessage: null }); const _listItems = await this._getProfileCardProperties(); + // update Application context + this.applicationContext = { + ...this.applicationContext, + listItems: _listItems, + }; + // update State this.setState({ listItems: _listItems, selectedItem: undefined, @@ -364,9 +370,8 @@ export default class ManageProfileCardProperties extends React.Component< displayNewPanel: false, displayDeletePanel: false, }); - this._selection.setAllSelected(false); - const _listItems = await this._getProfileCardProperties(); - this.setState({ listItems: _listItems, selectedItem: undefined }); + // refresh List + await this._onRefresh(); } else { this.setState({ displayEditPanel: false, diff --git a/samples/react-manage-profile-card-properties/src/webparts/manageProfileCardProperties/ManageProfileCardPropertiesWebPart.manifest.json b/samples/react-manage-profile-card-properties/src/webparts/manageProfileCardProperties/ManageProfileCardPropertiesWebPart.manifest.json index 4ea22ed8a..dcce18fe3 100644 --- a/samples/react-manage-profile-card-properties/src/webparts/manageProfileCardProperties/ManageProfileCardPropertiesWebPart.manifest.json +++ b/samples/react-manage-profile-card-properties/src/webparts/manageProfileCardProperties/ManageProfileCardPropertiesWebPart.manifest.json @@ -20,7 +20,7 @@ "group": { "default": "Other" }, "title": { "default": "Manage Profile Card Properties" }, "description": { "default": "Manage Profile Card Properties" }, - "officeFabricIconFontName": "Page", + "officeFabricIconFontName": "TaskManager", "properties": { "title": "Manage Profile Card Properties" } diff --git a/samples/react-manage-profile-card-properties/tslint.json b/samples/react-manage-profile-card-properties/tslint.json index 6bfc75a4c..ca52439d2 100644 --- a/samples/react-manage-profile-card-properties/tslint.json +++ b/samples/react-manage-profile-card-properties/tslint.json @@ -1,30 +1,29 @@ -{ - "extends": "@microsoft/sp-tslint-rules/base-tslint.json", - "rules": { - "class-name": false, - "export-name": false, - "forin": false, - "label-position": false, - "member-access": true, - "no-arg": false, - "no-console": false, - "no-construct": false, - "no-duplicate-variable": true, - "no-eval": false, - "no-function-expression": true, - "no-internal-module": true, - "no-shadowed-variable": true, - "no-switch-case-fall-through": true, - "no-unnecessary-semicolons": true, - "no-unused-expression": true, - "no-use-before-declare": true, - "no-with-statement": true, - "semicolon": true, - "trailing-comma": false, - "typedef": false, - "typedef-whitespace": false, - "use-named-parameter": true, - "variable-name": false, - "whitespace": false - } -} \ No newline at end of file +{ + "extends": "@microsoft/sp-tslint-rules/base-tslint.json", + "rules": { + "class-name": false, + "export-name": false, + "forin": false, + "label-position": false, + "member-access": true, + "no-arg": false, + "no-console": false, + "no-construct": false, + "no-duplicate-variable": true, + "no-eval": false, + "no-function-expression": true, + "no-internal-module": true, + "no-shadowed-variable": true, + "no-switch-case-fall-through": true, + "no-unnecessary-semicolons": true, + "no-unused-expression": true, + "no-with-statement": true, + "semicolon": true, + "trailing-comma": false, + "typedef": false, + "typedef-whitespace": false, + "use-named-parameter": true, + "variable-name": false, + "whitespace": false + } +}