Merge pull request #1537 from joaojmendes/update-react-manage-profile-card-properties

update fix warning message on build - react-manage-profile-card-properties
This commit is contained in:
Hugo Bernier 2020-10-08 00:55:42 -04:00 committed by GitHub
commit 3a5951b3a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 296 additions and 92 deletions

View File

@ -1,6 +1,7 @@
# React Manage Profile Card Properties # React Manage Profile Card Properties
## Summary ## Summary
This web part allows tenant administrators to manage profile card properties. This web part allows tenant administrators to manage profile card properties.
We can create, edit, delete, directory properties that can be add to profile card. We can create, edit, delete, directory properties that can be add to profile card.
@ -19,10 +20,8 @@ Only users with Tenant Admin Role are allowed to managed profile card properties
![manageProps](assets/Screenshot5.png) ![manageProps](assets/Screenshot5.png)
## Used SharePoint Framework Version ## Used SharePoint Framework Version
![SPFx 1.11.0](https://img.shields.io/badge/version-1.11.0-green.svg) ![SPFx 1.11.0](https://img.shields.io/badge/version-1.11.0-green.svg)
## Applies to ## Applies to
@ -38,6 +37,7 @@ WebPart Title| Text| no|
## Solution ## Solution
The Web Part Use Microsoft Graph API, Fluent-UI components. The Web Part Use Microsoft Graph API, Fluent-UI components.
Solution|Author(s) Solution|Author(s)
@ -49,8 +49,10 @@ Manage Profile Card Properties |João Mendes
Version|Date|Comments Version|Date|Comments
-------|----|-------- -------|----|--------
1.0.0|July 28, 2020|Initial release 1.0.0|July 28, 2020|Initial release
1.0.1|October 5, 2020|Initial release
## Disclaimer ## Disclaimer
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** **THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
--- ---

View File

@ -3,7 +3,7 @@
"solution": { "solution": {
"name": "react-manage-profile-card-properties-client-side-solution", "name": "react-manage-profile-card-properties-client-side-solution",
"id": "a53e4c14-1c0e-4a54-810f-eb5cdf42005b", "id": "a53e4c14-1c0e-4a54-810f-eb5cdf42005b",
"version": "1.0.0.0", "version": "1.0.1.0",
"includeClientSideAssets": true, "includeClientSideAssets": true,
"skipFeatureDeployment": true, "skipFeatureDeployment": true,
"isDomainIsolated": false, "isDomainIsolated": false,

View File

@ -31,14 +31,46 @@
} }
}, },
"@fluentui/date-time-utilities": { "@fluentui/date-time-utilities": {
"version": "7.1.2", "version": "7.9.0",
"resolved": "https://registry.npmjs.org/@fluentui/date-time-utilities/-/date-time-utilities-7.1.2.tgz", "resolved": "https://registry.npmjs.org/@fluentui/date-time-utilities/-/date-time-utilities-7.9.0.tgz",
"integrity": "sha512-To3rv1y191LTE0HMncV0mPmrnDiuNiK2aN6jDEUXQ9OQcDHqa9/7wfN9DbWCqCR53aB7mapaPtRYM20yw2gGYA==", "integrity": "sha512-D8p5WWeonqRO1EgIvo7WSlX1rcm87r2VQd62zTJPQImx8rpwc77CRI+iAvfxyVHRZMdt4Qk6Jq99dUaudPWaZw==",
"requires": { "requires": {
"@uifabric/set-version": "^7.0.15", "@uifabric/set-version": "^7.0.23",
"tslib": "^1.10.0" "tslib": "^1.10.0"
}, },
"dependencies": { "dependencies": {
"@uifabric/set-version": {
"version": "7.0.23",
"resolved": "https://registry.npmjs.org/@uifabric/set-version/-/set-version-7.0.23.tgz",
"integrity": "sha512-9E+YKtnH2kyMKnK9XZZsqyM8OCxEJIIfxtaThTlQpYOzrWAGJxQADFbZ7+Usi0U2xHnWNPFROjq+B9ocEzhqMA==",
"requires": {
"tslib": "^1.10.0"
}
},
"tslib": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
"integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q=="
}
}
},
"@fluentui/dom-utilities": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@fluentui/dom-utilities/-/dom-utilities-1.1.1.tgz",
"integrity": "sha512-w40gi8fzCpwa7U8cONiuu8rszPStkVOL/weDf5pCbYEb1gdaV7MDPSNkgM6IV0Kz+k017noDgK9Fv4ru1Dwz1g==",
"requires": {
"@uifabric/set-version": "^7.0.23",
"tslib": "^1.10.0"
},
"dependencies": {
"@uifabric/set-version": {
"version": "7.0.23",
"resolved": "https://registry.npmjs.org/@uifabric/set-version/-/set-version-7.0.23.tgz",
"integrity": "sha512-9E+YKtnH2kyMKnK9XZZsqyM8OCxEJIIfxtaThTlQpYOzrWAGJxQADFbZ7+Usi0U2xHnWNPFROjq+B9ocEzhqMA==",
"requires": {
"tslib": "^1.10.0"
}
},
"tslib": { "tslib": {
"version": "1.13.0", "version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
@ -47,9 +79,9 @@
} }
}, },
"@fluentui/keyboard-key": { "@fluentui/keyboard-key": {
"version": "0.2.4", "version": "0.2.12",
"resolved": "https://registry.npmjs.org/@fluentui/keyboard-key/-/keyboard-key-0.2.4.tgz", "resolved": "https://registry.npmjs.org/@fluentui/keyboard-key/-/keyboard-key-0.2.12.tgz",
"integrity": "sha512-dkbVQBOtvUqx+B7Jd3mY+SV8SQcO9cy6BLATPkAqK5h5gMg9clb1ny4V2OYW9SZzoOGBojpe6JBN+FmqJT2jgQ==", "integrity": "sha512-t3yIbbPKJubb22vQ/FIWwS9vFAzaPYzFxKWPHVWLtxs/P+5yL+LD3B16DRtYreWAdl9CZvEbos58ChLZ0KHwSQ==",
"requires": { "requires": {
"tslib": "^1.10.0" "tslib": "^1.10.0"
}, },
@ -62,18 +94,60 @@
} }
}, },
"@fluentui/react-focus": { "@fluentui/react-focus": {
"version": "7.12.18", "version": "7.16.9",
"resolved": "https://registry.npmjs.org/@fluentui/react-focus/-/react-focus-7.12.18.tgz", "resolved": "https://registry.npmjs.org/@fluentui/react-focus/-/react-focus-7.16.9.tgz",
"integrity": "sha512-ls2mNKtdOf78H8z+i8JOJnO0Avk7yg4Hd3+djsG0piggOFOieNday5exdC/qutrTHNid79shIj370sELZEK27A==", "integrity": "sha512-XT+W3+hSQi2PzEi3biNqAcUvBj4sZqLp/ERXD+jIF1Ux+CxdlLtf8WvS36u7/0B6jjvoMaIcpdsqGjqgU+8NGA==",
"requires": { "requires": {
"@fluentui/keyboard-key": "^0.2.4", "@fluentui/keyboard-key": "^0.2.12",
"@uifabric/merge-styles": "^7.16.0", "@uifabric/merge-styles": "^7.19.1",
"@uifabric/set-version": "^7.0.15", "@uifabric/set-version": "^7.0.23",
"@uifabric/styling": "^7.14.0", "@uifabric/styling": "^7.16.9",
"@uifabric/utilities": "^7.24.0", "@uifabric/utilities": "^7.32.3",
"tslib": "^1.10.0" "tslib": "^1.10.0"
}, },
"dependencies": { "dependencies": {
"@uifabric/merge-styles": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@uifabric/merge-styles/-/merge-styles-7.19.1.tgz",
"integrity": "sha512-yqUwmk62Kgu216QNPE9vOfS3h0kiSbTvoqM5QcZi+IzpqsBOlzZx3A9Er9UiDaqHRd5lsYF5pO/jeUULmBWF/A==",
"requires": {
"@uifabric/set-version": "^7.0.23",
"tslib": "^1.10.0"
}
},
"@uifabric/set-version": {
"version": "7.0.23",
"resolved": "https://registry.npmjs.org/@uifabric/set-version/-/set-version-7.0.23.tgz",
"integrity": "sha512-9E+YKtnH2kyMKnK9XZZsqyM8OCxEJIIfxtaThTlQpYOzrWAGJxQADFbZ7+Usi0U2xHnWNPFROjq+B9ocEzhqMA==",
"requires": {
"tslib": "^1.10.0"
}
},
"@uifabric/styling": {
"version": "7.16.9",
"resolved": "https://registry.npmjs.org/@uifabric/styling/-/styling-7.16.9.tgz",
"integrity": "sha512-vouh7WeayCWvjbCo4VlqJfEYRvkRwq2fL9YyicPIJomIvKxs9lmkJJP+drUOxX78TV9DoGIMnbr+DMFpNsGcdA==",
"requires": {
"@fluentui/theme": "^1.2.1",
"@microsoft/load-themed-styles": "^1.10.26",
"@uifabric/merge-styles": "^7.19.1",
"@uifabric/set-version": "^7.0.23",
"@uifabric/utilities": "^7.32.3",
"tslib": "^1.10.0"
}
},
"@uifabric/utilities": {
"version": "7.32.3",
"resolved": "https://registry.npmjs.org/@uifabric/utilities/-/utilities-7.32.3.tgz",
"integrity": "sha512-H0SWX6X0yZAd1XcdS/ZcPLKw3BWnT6/4eavVOD0NdWO+Dd168exfMHmV/nwgJ1yJjsUsG1o7x7x22QPRl6NQ6Q==",
"requires": {
"@fluentui/dom-utilities": "^1.1.1",
"@uifabric/merge-styles": "^7.19.1",
"@uifabric/set-version": "^7.0.23",
"prop-types": "^15.7.2",
"tslib": "^1.10.0"
}
},
"tslib": { "tslib": {
"version": "1.13.0", "version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
@ -81,17 +155,70 @@
} }
} }
}, },
"@fluentui/react-icons": { "@fluentui/react-window-provider": {
"version": "0.1.35", "version": "0.3.3",
"resolved": "https://registry.npmjs.org/@fluentui/react-icons/-/react-icons-0.1.35.tgz", "resolved": "https://registry.npmjs.org/@fluentui/react-window-provider/-/react-window-provider-0.3.3.tgz",
"integrity": "sha512-ZFn+KnCk8fPrO+i5ARimI+kPy84TTz+uUYMq3dFGrxQsvusoH3UZHch18JvvPcjrG5R6xeghZTRf+DYBBmahBA==", "integrity": "sha512-MVPf2hqOQ17LAZsuvGcr3oOHksAskUm+fCYdXFhbVoAgsCDVTIuH6i8XgHFd6YjBtzjZmI4+k/3NTQfDqBX8EQ==",
"requires": { "requires": {
"@microsoft/load-themed-styles": "^1.10.26", "@uifabric/set-version": "^7.0.23",
"@uifabric/set-version": "^7.0.15",
"@uifabric/utilities": "^7.24.0",
"tslib": "^1.10.0" "tslib": "^1.10.0"
}, },
"dependencies": { "dependencies": {
"@uifabric/set-version": {
"version": "7.0.23",
"resolved": "https://registry.npmjs.org/@uifabric/set-version/-/set-version-7.0.23.tgz",
"integrity": "sha512-9E+YKtnH2kyMKnK9XZZsqyM8OCxEJIIfxtaThTlQpYOzrWAGJxQADFbZ7+Usi0U2xHnWNPFROjq+B9ocEzhqMA==",
"requires": {
"tslib": "^1.10.0"
}
},
"tslib": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
"integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q=="
}
}
},
"@fluentui/theme": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@fluentui/theme/-/theme-1.2.1.tgz",
"integrity": "sha512-18biLzW/E48HKgN1e5APP0znhMgUVpXq7h4B0LJjI7TTQZPuPTR96FA/LcHDwcTL3YR1rEMmnGgCFitWtsbA2A==",
"requires": {
"@uifabric/merge-styles": "^7.19.1",
"@uifabric/set-version": "^7.0.23",
"@uifabric/utilities": "^7.32.3",
"tslib": "^1.10.0"
},
"dependencies": {
"@uifabric/merge-styles": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@uifabric/merge-styles/-/merge-styles-7.19.1.tgz",
"integrity": "sha512-yqUwmk62Kgu216QNPE9vOfS3h0kiSbTvoqM5QcZi+IzpqsBOlzZx3A9Er9UiDaqHRd5lsYF5pO/jeUULmBWF/A==",
"requires": {
"@uifabric/set-version": "^7.0.23",
"tslib": "^1.10.0"
}
},
"@uifabric/set-version": {
"version": "7.0.23",
"resolved": "https://registry.npmjs.org/@uifabric/set-version/-/set-version-7.0.23.tgz",
"integrity": "sha512-9E+YKtnH2kyMKnK9XZZsqyM8OCxEJIIfxtaThTlQpYOzrWAGJxQADFbZ7+Usi0U2xHnWNPFROjq+B9ocEzhqMA==",
"requires": {
"tslib": "^1.10.0"
}
},
"@uifabric/utilities": {
"version": "7.32.3",
"resolved": "https://registry.npmjs.org/@uifabric/utilities/-/utilities-7.32.3.tgz",
"integrity": "sha512-H0SWX6X0yZAd1XcdS/ZcPLKw3BWnT6/4eavVOD0NdWO+Dd168exfMHmV/nwgJ1yJjsUsG1o7x7x22QPRl6NQ6Q==",
"requires": {
"@fluentui/dom-utilities": "^1.1.1",
"@uifabric/merge-styles": "^7.19.1",
"@uifabric/set-version": "^7.0.23",
"prop-types": "^15.7.2",
"tslib": "^1.10.0"
}
},
"tslib": { "tslib": {
"version": "1.13.0", "version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
@ -14641,32 +14768,97 @@
"integrity": "sha512-gcBs5HHr7tjkvk/+Ls10ttb3jEllRn7SvJitX/kx/gQq8BiFMSMKr1w+oNqXlh4EgkBHWUlJVPrYUu1KW/jVaQ==" "integrity": "sha512-gcBs5HHr7tjkvk/+Ls10ttb3jEllRn7SvJitX/kx/gQq8BiFMSMKr1w+oNqXlh4EgkBHWUlJVPrYUu1KW/jVaQ=="
}, },
"office-ui-fabric-react": { "office-ui-fabric-react": {
"version": "7.121.12", "version": "7.144.2",
"resolved": "https://registry.npmjs.org/office-ui-fabric-react/-/office-ui-fabric-react-7.121.12.tgz", "resolved": "https://registry.npmjs.org/office-ui-fabric-react/-/office-ui-fabric-react-7.144.2.tgz",
"integrity": "sha512-aI99eq7KFFj3eATT8MO3salOYnFvfhL3sq2nHFFL7btXqimVHd772jTMCIrUtAI4YHCbBeiBgh5pgIJZTXdGuQ==", "integrity": "sha512-okn1iubHJJmSETIZW89pV4xMVRiVeD9k7qxH+xlNmMDgofE2NAv6XwxdeaR0rXMYMVkRNGgc/B+2iSM24rEXhg==",
"requires": { "requires": {
"@fluentui/date-time-utilities": "^7.1.2", "@fluentui/date-time-utilities": "^7.9.0",
"@fluentui/react-focus": "^7.12.18", "@fluentui/react-focus": "^7.16.9",
"@fluentui/react-icons": "^0.1.35", "@fluentui/react-window-provider": "^0.3.3",
"@microsoft/load-themed-styles": "^1.10.26", "@microsoft/load-themed-styles": "^1.10.26",
"@uifabric/foundation": "^7.7.34", "@uifabric/foundation": "^7.9.9",
"@uifabric/icons": "^7.3.60", "@uifabric/icons": "^7.5.8",
"@uifabric/merge-styles": "^7.16.0", "@uifabric/merge-styles": "^7.19.1",
"@uifabric/react-hooks": "^7.4.13", "@uifabric/react-hooks": "^7.13.5",
"@uifabric/set-version": "^7.0.15", "@uifabric/set-version": "^7.0.23",
"@uifabric/styling": "^7.14.0", "@uifabric/styling": "^7.16.9",
"@uifabric/utilities": "^7.24.0", "@uifabric/utilities": "^7.32.3",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"tslib": "^1.10.0" "tslib": "^1.10.0"
}, },
"dependencies": { "dependencies": {
"@uifabric/icons": { "@uifabric/foundation": {
"version": "7.3.60", "version": "7.9.9",
"resolved": "https://registry.npmjs.org/@uifabric/icons/-/icons-7.3.60.tgz", "resolved": "https://registry.npmjs.org/@uifabric/foundation/-/foundation-7.9.9.tgz",
"integrity": "sha512-OnhZT5pwE85RaNPBiApNpQfEQGym0ilFC+yFXHi/dkLvDN7Q9Tocbh8nrdSO+w0TZFl8wt9rIVlE0MCKOLL9UA==", "integrity": "sha512-cpFsDrHIG3f952+WsBCLLPKT+06ywoMBTi0Z42KFBxAeQjFfJFZ4YnHRztXZMrFbwHsvokzV8GmOm+Nc2kectQ==",
"requires": { "requires": {
"@uifabric/set-version": "^7.0.15", "@uifabric/merge-styles": "^7.19.1",
"@uifabric/styling": "^7.14.0", "@uifabric/set-version": "^7.0.23",
"@uifabric/styling": "^7.16.9",
"@uifabric/utilities": "^7.32.3",
"tslib": "^1.10.0"
}
},
"@uifabric/icons": {
"version": "7.5.8",
"resolved": "https://registry.npmjs.org/@uifabric/icons/-/icons-7.5.8.tgz",
"integrity": "sha512-3YIp2nKHpuKeqPQnyOUPUvoKq18N81t1+2c/NVJXnlSOP4VyEy9PC2JXCmxoZZOdrGKwQ1Is99PfLY0XsIssEQ==",
"requires": {
"@uifabric/set-version": "^7.0.23",
"@uifabric/styling": "^7.16.9",
"tslib": "^1.10.0"
}
},
"@uifabric/merge-styles": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@uifabric/merge-styles/-/merge-styles-7.19.1.tgz",
"integrity": "sha512-yqUwmk62Kgu216QNPE9vOfS3h0kiSbTvoqM5QcZi+IzpqsBOlzZx3A9Er9UiDaqHRd5lsYF5pO/jeUULmBWF/A==",
"requires": {
"@uifabric/set-version": "^7.0.23",
"tslib": "^1.10.0"
}
},
"@uifabric/react-hooks": {
"version": "7.13.5",
"resolved": "https://registry.npmjs.org/@uifabric/react-hooks/-/react-hooks-7.13.5.tgz",
"integrity": "sha512-5Ucq3wH5bZud/TCKZE6IS+v1XpaxP65iiSk3ZxPi+RAi5Gt8NeKwmaMZTPWgLrRjkOTwy59jR4dJ6MzZVmSe7A==",
"requires": {
"@fluentui/react-window-provider": "^0.3.3",
"@uifabric/set-version": "^7.0.23",
"@uifabric/utilities": "^7.32.3",
"tslib": "^1.10.0"
}
},
"@uifabric/set-version": {
"version": "7.0.23",
"resolved": "https://registry.npmjs.org/@uifabric/set-version/-/set-version-7.0.23.tgz",
"integrity": "sha512-9E+YKtnH2kyMKnK9XZZsqyM8OCxEJIIfxtaThTlQpYOzrWAGJxQADFbZ7+Usi0U2xHnWNPFROjq+B9ocEzhqMA==",
"requires": {
"tslib": "^1.10.0"
}
},
"@uifabric/styling": {
"version": "7.16.9",
"resolved": "https://registry.npmjs.org/@uifabric/styling/-/styling-7.16.9.tgz",
"integrity": "sha512-vouh7WeayCWvjbCo4VlqJfEYRvkRwq2fL9YyicPIJomIvKxs9lmkJJP+drUOxX78TV9DoGIMnbr+DMFpNsGcdA==",
"requires": {
"@fluentui/theme": "^1.2.1",
"@microsoft/load-themed-styles": "^1.10.26",
"@uifabric/merge-styles": "^7.19.1",
"@uifabric/set-version": "^7.0.23",
"@uifabric/utilities": "^7.32.3",
"tslib": "^1.10.0"
}
},
"@uifabric/utilities": {
"version": "7.32.3",
"resolved": "https://registry.npmjs.org/@uifabric/utilities/-/utilities-7.32.3.tgz",
"integrity": "sha512-H0SWX6X0yZAd1XcdS/ZcPLKw3BWnT6/4eavVOD0NdWO+Dd168exfMHmV/nwgJ1yJjsUsG1o7x7x22QPRl6NQ6Q==",
"requires": {
"@fluentui/dom-utilities": "^1.1.1",
"@uifabric/merge-styles": "^7.19.1",
"@uifabric/set-version": "^7.0.23",
"prop-types": "^15.7.2",
"tslib": "^1.10.0" "tslib": "^1.10.0"
} }
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "react-manage-profile-card-properties", "name": "react-manage-profile-card-properties",
"version": "0.0.1", "version": "1.0.1",
"private": true, "private": true,
"main": "lib/index.js", "main": "lib/index.js",
"engines": { "engines": {
@ -30,7 +30,7 @@
"@types/webpack-env": "1.13.1", "@types/webpack-env": "1.13.1",
"axios": "^0.19.2", "axios": "^0.19.2",
"jquery": "^3.5.1", "jquery": "^3.5.1",
"office-ui-fabric-react": "^7.121.12", "office-ui-fabric-react": "^7.144.2",
"react": "16.8.5", "react": "16.8.5",
"react-dom": "16.8.5", "react-dom": "16.8.5",
"react-hook-form": "^6.0.5" "react-hook-form": "^6.0.5"

View File

@ -1,39 +1,57 @@
import { AppContext, IAppContextProps } from "../../Common/AppContextProps"; import React, {
import { IProfileCardProperty } from "../../Entities/IProfileCardProperty"; useContext,
import { IAnnotation, ILocalization } from "../../Entities/IAnnotations"; useEffect
import { languages } from "../../Common/constants"; } from "react";
import {
DefaultButton,
PrimaryButton,
} from "office-ui-fabric-react/lib/Button";
import { Panel, PanelType } from "office-ui-fabric-react/lib/Panel";
import { useConstCallback } from "@uifabric/react-hooks";
import React, { useContext, useEffect } from "react";
import { useProfileCardProperties } from "../../hooks/useProfileCardProperties";
import { IEditProfileCardPropertyProps } from "../EditProfileCardProperty/IEditProfileCardPropertyProps";
import { IEditProfileCardPropertyState } from "../EditProfileCardProperty/IEditProfileCardPropertyState";
import * as _ from "lodash"; import * as _ from "lodash";
import strings from "ManageProfileCardPropertiesWebPartStrings";
import { import {
Stack,
ComboBox, ComboBox,
TextField,
Label,
Icon,
IComboBox,
CommandButton, CommandButton,
IIconProps, IComboBox,
initializeIcons,
IComboBoxOption, IComboBoxOption,
mergeStyleSets, Icon,
IIconProps,
IIconStyles, IIconStyles,
ILabelStyles, ILabelStyles,
Spinner, Label,
SpinnerSize, mergeStyleSets,
MessageBar, MessageBar,
MessageBarType, MessageBarType,
Spinner,
SpinnerSize,
Stack,
TextField
} from "office-ui-fabric-react"; } from "office-ui-fabric-react";
import {
DefaultButton,
PrimaryButton
} from "office-ui-fabric-react/lib/Button";
import {
Panel,
PanelType
} from "office-ui-fabric-react/lib/Panel";
import { useConstCallback } from "@uifabric/react-hooks";
import {
AppContext,
IAppContextProps
} from "../../Common/AppContextProps";
import { languages } from "../../Common/constants";
import {
IAnnotation,
ILocalization
} from "../../Entities/IAnnotations";
import { ILocalizationExtended } from "../../Entities/IlocalizationExtended"; import { ILocalizationExtended } from "../../Entities/IlocalizationExtended";
import strings from "ManageProfileCardPropertiesWebPartStrings"; import { IProfileCardProperty } from "../../Entities/IProfileCardProperty";
import { useProfileCardProperties } from "../../hooks/useProfileCardProperties";
import {
IEditProfileCardPropertyProps
} from "../EditProfileCardProperty/IEditProfileCardPropertyProps";
import {
IEditProfileCardPropertyState
} from "../EditProfileCardProperty/IEditProfileCardPropertyState";
// Component // Component
// Edit Profile Property Component // Edit Profile Property Component
@ -381,14 +399,14 @@ export const EditProfileCardProperty: React.FunctionComponent<IEditProfileCardPr
) => { ) => {
ev.preventDefault(); ev.preventDefault();
let { profileCardProperties } = state; let { profileCardProperties } = state;
let { localizations } = profileCardProperties.annotations[0]; let _localizations = profileCardProperties.annotations[0].localizations;
const _languageTagIndex: HTMLElement = ev.target as HTMLElement; const _languageTagIndex: HTMLElement = ev.target as HTMLElement;
const _index: number = Number( const _index: number = Number(
_languageTagIndex.getAttribute("data-language-tag-index") _languageTagIndex.getAttribute("data-language-tag-index")
); );
localizations[_index] = { ...localizations[_index], displayName: newValue }; _localizations[_index] = { ..._localizations[_index], displayName: newValue };
profileCardProperties.annotations[0].localizations = localizations; profileCardProperties.annotations[0].localizations = _localizations;
setState({ ...state, profileCardProperties: profileCardProperties }); setState({ ...state, profileCardProperties: profileCardProperties });
console.log(state); console.log(state);
}; };

View File

@ -1,12 +1,12 @@
import { WebPartContext } from "@microsoft/sp-webpart-base"; import { MSGraphClient } from "@microsoft/sp-http";
import {
IProfileCardPropertiesResults
} from "../Entities/IProfileCardPropertiesResults";
import { IProfileCardProperty } from "../Entities/IProfileCardProperty"; import { IProfileCardProperty } from "../Entities/IProfileCardProperty";
import { MSGraphClient, AadTokenProvider } from "@microsoft/sp-http"; import {
import { useGetOrganization } from "./useGetOrganizationInfo"; IUpdateProfileCardProperty
import { IOrganization } from "../Entities/IOrganization"; } from "../Entities/IUpdateProfileCardProperty";
import axios, { AxiosRequestConfig } from "axios";
import { IProfileCardPropertiesResults } from "../Entities/IProfileCardPropertiesResults";
import { IAnnotation } from "../Entities/IAnnotations";
import { IUpdateProfileCardProperty } from "../Entities/IUpdateProfileCardProperty";
const ADMIN_ROLETEMPLATE_ID = "62e90394-69f5-4237-9190-012177145e10"; const ADMIN_ROLETEMPLATE_ID = "62e90394-69f5-4237-9190-012177145e10";
@ -23,15 +23,7 @@ export const useProfileCardProperties = () => {
.orderby("directoryPropertyName") .orderby("directoryPropertyName")
.get(); .get();
/* const t = await msGraphClient.getToken('https://graph.microsoft.com');
const options : AxiosRequestConfig = {
method: 'get',
headers: { 'content-type': 'application/json', 'accept': 'application/json' , 'authorization': `bearer ${t}`},
url: `https://graph.microsoft.com/beta/organization/${organizationId}/settings/profileCardProperties`,
};
const _rs = await axios(options);
console.log(_rs); */
return _profileProperties.value; return _profileProperties.value;
}; };