Merge pull request #5213 from HarminderSethi/main
This commit is contained in:
commit
bf9ba731fd
|
@ -7,7 +7,7 @@
|
|||
"@microsoft/microsoft-graph-client": "3.0.2",
|
||||
"@microsoft/teams-js": "2.12.2"
|
||||
},
|
||||
"version": "1.18.2",
|
||||
"version": "1.19.0",
|
||||
"libraryName": "holidays-calendar",
|
||||
"libraryId": "c85f1137-142e-4570-b3c9-3cdc47580452",
|
||||
"environment": "spo",
|
||||
|
|
|
@ -19,18 +19,18 @@ ACE card extension provides below functionalities
|
|||
|
||||
## Compatibility
|
||||
|
||||
| :warning: Important |
|
||||
|:---------------------------|
|
||||
| Every SPFx version is only compatible with specific version(s) of Node.js. In order to be able to build this sample, please ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.|
|
||||
|Refer to <https://aka.ms/spfx-matrix> for more information on SPFx compatibility. |
|
||||
| :warning: Important |
|
||||
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Every SPFx version is only compatible with specific version(s) of Node.js. In order to be able to build this sample, please ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node. |
|
||||
| Refer to <https://aka.ms/spfx-matrix> for more information on SPFx compatibility. |
|
||||
|
||||
This sample is optimally compatible with the following environment configuration:
|
||||
|
||||
![SPFx 1.18.2](https://img.shields.io/badge/SPFx-1.18.2-green.svg)
|
||||
![SPFx 1.19.0](https://img.shields.io/badge/SPFx-1.19.0-green.svg)
|
||||
![Node.js v18 | v18](https://img.shields.io/badge/Node.js-v18%20%7C%20v16-green.svg)
|
||||
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
|
||||
![Does not work with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Incompatible-red.svg "SharePoint Server 2019 requires SPFx 1.4.1 or lower")
|
||||
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
|
||||
![Does not work with SharePoint 2016 (Feature Pack 2)](<https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg> "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
|
||||
![Local Workbench Unsupported](https://img.shields.io/badge/Local%20Workbench-Unsupported-red.svg "Local workbench is no longer available as of SPFx 1.13 and above")
|
||||
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
|
||||
![Compatible with Remote Containers](https://img.shields.io/badge/Remote%20Containers-Compatible-green.svg)
|
||||
|
@ -39,8 +39,8 @@ For more information about SPFx compatibility, please refer to <https://aka.ms/s
|
|||
|
||||
## Applies to
|
||||
|
||||
* [SharePoint Framework](https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
|
||||
* [Microsoft 365 tenant](https://learn.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment)
|
||||
- [SharePoint Framework](https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
|
||||
- [Microsoft 365 tenant](https://learn.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment)
|
||||
|
||||
> Get your own free development tenant by subscribing to [Microsoft 365 developer program](https://aka.ms/m365/devprogram)
|
||||
|
||||
|
@ -51,26 +51,26 @@ For more information about SPFx compatibility, please refer to <https://aka.ms/s
|
|||
|
||||
## Contributors
|
||||
|
||||
* [Harminder Singh](https://github.com/HarminderSethi)
|
||||
- [Harminder Singh](https://github.com/HarminderSethi)
|
||||
|
||||
## Version history
|
||||
|
||||
| Version | Date | Comments |
|
||||
| ------- | ---------------- | --------------- |
|
||||
| 1.0 | January 29, 2021 | Initial release |
|
||||
| Version | Date | Comments |
|
||||
| ------- | ----------------- | ----------------------- |
|
||||
| 1.0 | January 29, 2021 | Initial release |
|
||||
| 1.1 | November 30, 2023 | Upgraded to SPFx 1.18.2 |
|
||||
| 1.2 | August 26, 2024 | Upgraded to SPFx 1.19.0 |
|
||||
|
||||
## Minimal Path to Awesome
|
||||
|
||||
* Clone this repository (or [download this solution as a .ZIP file](https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/REACT-HOLIDAYS-CALENDAR) then unzip it)
|
||||
* From your command line, change your current directory to the directory containing this sample (`REACT-HOLIDAYS-CALENDAR`, located under `samples`)
|
||||
* in the command line run:
|
||||
* `npm install`
|
||||
* `gulp serve`
|
||||
- Clone this repository (or [download this solution as a .ZIP file](https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/REACT-HOLIDAYS-CALENDAR) then unzip it)
|
||||
- From your command line, change your current directory to the directory containing this sample (`REACT-HOLIDAYS-CALENDAR`, located under `samples`)
|
||||
- in the command line run:
|
||||
- `npm install`
|
||||
- `gulp serve`
|
||||
|
||||
> This sample can also be opened with [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). Visit <https://aka.ms/spfx-devcontainer> for further instructions.
|
||||
|
||||
|
||||
## Features
|
||||
|
||||
1. Provides the functionality to add the holiday as an event in the calendar
|
||||
|
@ -87,7 +87,7 @@ For more information about SPFx compatibility, please refer to <https://aka.ms/s
|
|||
|
||||
## Help
|
||||
|
||||
We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.
|
||||
We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.
|
||||
|
||||
If you're having issues building the solution, please run [spfx doctor](https://pnp.github.io/cli-microsoft365/cmd/spfx/spfx-doctor/) from within the solution folder to diagnose incompatibility issues with your environment.
|
||||
|
||||
|
@ -103,7 +103,6 @@ Finally, if you have an idea for improvement, [make a suggestion](https://github
|
|||
|
||||
## 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.**
|
||||
|
||||
<img src="https://m365-visitor-stats.azurewebsites.net/sp-dev-fx-webparts/samples/REACT-HOLIDAYS-CALENDAR" />
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"websiteUrl": "https://github.com/HarminderSethi",
|
||||
"privacyUrl": "",
|
||||
"termsOfUseUrl": "",
|
||||
"mpnId": "Undefined-1.16.1"
|
||||
"mpnId": "Undefined-1.19.0"
|
||||
},
|
||||
"metadata": {
|
||||
"shortDescription": {
|
||||
|
@ -38,7 +38,6 @@
|
|||
"screenshotPaths": [],
|
||||
"videoUrl": "",
|
||||
"categories": []
|
||||
|
||||
},
|
||||
"features": [
|
||||
{
|
||||
|
@ -46,7 +45,6 @@
|
|||
"description": "The feature that activates elements of the holidays-calendar solution.",
|
||||
"id": "182f7879-26d6-4fb6-b5ad-9f34a54ba79d",
|
||||
"version": "1.1.0.0"
|
||||
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "holidays-calendar",
|
||||
"version": "1.1",
|
||||
"version": "1.2",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=16.13.0 <17.0.0 || >=18.17.1 <19.0.0"
|
||||
|
@ -14,14 +14,14 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@fluentui/react": "8.106.4",
|
||||
"@fluentui/react-components": "^9.42.0",
|
||||
"@microsoft/generator-sharepoint": "^1.18.2",
|
||||
"@microsoft/sp-adaptive-card-extension-base": "1.18.2",
|
||||
"@microsoft/sp-core-library": "1.18.2",
|
||||
"@microsoft/sp-lodash-subset": "1.18.2",
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.18.2",
|
||||
"@microsoft/sp-property-pane": "1.18.2",
|
||||
"@microsoft/sp-webpart-base": "1.18.2",
|
||||
"@fluentui/react-components": "^9.54.13",
|
||||
"@microsoft/generator-sharepoint": "^1.19.0",
|
||||
"@microsoft/sp-adaptive-card-extension-base": "1.19.0",
|
||||
"@microsoft/sp-core-library": "1.19.0",
|
||||
"@microsoft/sp-lodash-subset": "1.19.0",
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.19.0",
|
||||
"@microsoft/sp-property-pane": "1.19.0",
|
||||
"@microsoft/sp-webpart-base": "1.19.0",
|
||||
"@pnp/core": "^3.10.0",
|
||||
"@pnp/graph": "^3.10.0",
|
||||
"@pnp/logging": "^3.10.0",
|
||||
|
@ -35,12 +35,12 @@
|
|||
"yarn": "^1.22.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/eslint-config-spfx": "1.18.2",
|
||||
"@microsoft/eslint-plugin-spfx": "1.18.2",
|
||||
"@microsoft/eslint-config-spfx": "1.20.1",
|
||||
"@microsoft/eslint-plugin-spfx": "1.20.1",
|
||||
"@microsoft/microsoft-graph-types": "^2.40.0",
|
||||
"@microsoft/rush-stack-compiler-4.7": "0.1.0",
|
||||
"@microsoft/sp-build-web": "1.18.2",
|
||||
"@microsoft/sp-module-interfaces": "1.18.2",
|
||||
"@microsoft/sp-build-web": "1.20.1",
|
||||
"@microsoft/sp-module-interfaces": "1.20.1",
|
||||
"@rushstack/eslint-config": "2.5.1",
|
||||
"@types/react": "17.0.45",
|
||||
"@types/react-dom": "17.0.17",
|
||||
|
@ -49,7 +49,7 @@
|
|||
"eslint": "8.7.0",
|
||||
"eslint-plugin-react-hooks": "4.3.0",
|
||||
"gulp": "4.0.2",
|
||||
"spfx-fast-serve-helpers": "~1.18.2",
|
||||
"spfx-fast-serve-helpers": "^1.19.3",
|
||||
"typescript": "4.7.4"
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,39 +1,38 @@
|
|||
// For more information on how to run this SPFx project in a VS Code Remote Container, please visit https://aka.ms/spfx-devcontainer
|
||||
{
|
||||
"name": "SPFx 1.16.1",
|
||||
"image": "docker.io/m365pnp/spfx:1.16.1",
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {},
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"editorconfig.editorconfig",
|
||||
"dbaeumer.vscode-eslint"
|
||||
],
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [
|
||||
4321,
|
||||
35729
|
||||
],
|
||||
"portsAttributes": {
|
||||
"4321": {
|
||||
"protocol": "https",
|
||||
"label": "Manifest",
|
||||
"onAutoForward": "silent",
|
||||
"requireLocalPort": true
|
||||
},
|
||||
// Not needed for SPFx>= 1.12.1
|
||||
// "5432": {
|
||||
// "protocol": "https",
|
||||
// "label": "Workbench",
|
||||
// "onAutoForward": "silent"
|
||||
// },
|
||||
"35729": {
|
||||
"protocol": "https",
|
||||
"label": "LiveReload",
|
||||
"onAutoForward": "silent",
|
||||
"requireLocalPort": true
|
||||
}
|
||||
},
|
||||
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
|
||||
"remoteUser": "node"
|
||||
}
|
||||
"name": "SPFx 1.19.0",
|
||||
"image": "docker.io/m365pnp/spfx:1.19.0",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"editorconfig.editorconfig",
|
||||
"dbaeumer.vscode-eslint"
|
||||
]
|
||||
}
|
||||
},
|
||||
"forwardPorts": [
|
||||
4321,
|
||||
35729,
|
||||
5432
|
||||
],
|
||||
"portsAttributes": {
|
||||
"4321": {
|
||||
"protocol": "https",
|
||||
"label": "Manifest",
|
||||
"onAutoForward": "silent",
|
||||
"requireLocalPort": true
|
||||
},
|
||||
"5432": {
|
||||
"protocol": "https",
|
||||
"label": "Workbench",
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"35729": {
|
||||
"protocol": "https",
|
||||
"label": "LiveReload",
|
||||
"onAutoForward": "silent",
|
||||
"requireLocalPort": true
|
||||
}
|
||||
},
|
||||
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
|
||||
"remoteUser": "node"
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
v18.17.1
|
|
@ -5,9 +5,9 @@
|
|||
"nodeVersion": "16.16.0",
|
||||
"sdksVersions": {
|
||||
"@microsoft/microsoft-graph-client": "3.0.2",
|
||||
"@microsoft/teams-js": "2.4.1"
|
||||
"@microsoft/teams-js": "2.12.0"
|
||||
},
|
||||
"version": "1.16.1",
|
||||
"version": "1.19.0",
|
||||
"libraryName": "react-my-one-drive-info",
|
||||
"libraryId": "a07f3777-40b2-413e-b024-23234e5142e3",
|
||||
"environment": "spo",
|
||||
|
|
|
@ -15,16 +15,16 @@ MyOneDriveInfo solution contains Adaptive card extension for Viva connection wit
|
|||
|
||||
| :warning: Important |
|
||||
|:---------------------------|
|
||||
| Every SPFx version is only compatible with specific version(s) of Node.js. In order to be able to build this sample, please ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.|
|
||||
| Every SPFx version is optimally compatible with specific versions of Node.js. In order to be able to build this sample, you need to ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.|
|
||||
|Refer to <https://aka.ms/spfx-matrix> for more information on SPFx compatibility. |
|
||||
|
||||
This sample is optimally compatible with the following environment configuration:
|
||||
|
||||
![SPFx 1.16.1](https://img.shields.io/badge/SPFx-1.16.1-green.svg)
|
||||
![Node.js v16 | v14 | v12](https://img.shields.io/badge/Node.js-v16%20%7C%20v14%20%7C%20v12-green.svg)
|
||||
![SPFx 1.19.0](https://img.shields.io/badge/SPFx-1.19.0-green.svg)
|
||||
![Node.js v18](https://img.shields.io/badge/Node.js-v18-green.svg)
|
||||
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
|
||||
![Does not work with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Incompatible-red.svg "SharePoint Server 2019 requires SPFx 1.4.1 or lower")
|
||||
![Does not work with SharePoint 2016 (Feature Pack 2)](<https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg> "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
|
||||
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
|
||||
![Local Workbench Unsupported](https://img.shields.io/badge/Local%20Workbench-Unsupported-red.svg "Local workbench is no longer available as of SPFx 1.13 and above")
|
||||
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
|
||||
![Compatible with Remote Containers](https://img.shields.io/badge/Remote%20Containers-Compatible-green.svg)
|
||||
|
@ -38,16 +38,16 @@ For more information about SPFx compatibility, please refer to <https://aka.ms/s
|
|||
|
||||
> Get your own free development tenant by subscribing to [Microsoft 365 developer program](https://aka.ms/m365/devprogram)
|
||||
|
||||
|
||||
## Contributors
|
||||
|
||||
* [Harminder Singh](https://github.com/HarminderSethi)
|
||||
- [Harminder Singh](https://github.com/HarminderSethi)
|
||||
|
||||
## Version history
|
||||
|
||||
| Version | Date | Comments |
|
||||
| ------- | ---------------- | --------------- |
|
||||
| 1.1 | January 24, 2021 | Initial Release |
|
||||
| 1.2 | August 26, 2024 | Upgraded to SPFx 1.19.0 and @fluentui/react-components to 9.54.13 |
|
||||
|
||||
## Minimal Path to Awesome
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
"name": "pnp-sp-dev-spfx-web-parts-react-my-onedrive-info",
|
||||
"source": "pnp",
|
||||
"title": "My OneDrive Info Web Part",
|
||||
"title": "My OneDrive Info",
|
||||
"shortDescription": "MyOneDriveInfo solution contains Adaptive card extension for Viva connection with below functionalities",
|
||||
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-my-onedrive-info",
|
||||
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-my-onedrive-info",
|
||||
|
@ -10,7 +10,7 @@
|
|||
"MyOneDriveInfo solution contains Adaptive card extension for Viva connection with below functionalities"
|
||||
],
|
||||
"creationDateTime": "2023-02-03",
|
||||
"updateDateTime": "2023-02-03",
|
||||
"updateDateTime": "2024-08-26",
|
||||
"products": [
|
||||
"SharePoint"
|
||||
],
|
||||
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
{
|
||||
"key": "SPFX-VERSION",
|
||||
"value": "1.16.1"
|
||||
"value": "1.19.0"
|
||||
}
|
||||
],
|
||||
"thumbnails": [
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
|
||||
"port": 4321,
|
||||
"https": true,
|
||||
"initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx"
|
||||
"initialPage": "https://{tenantDomain}/_layouts/workbench.aspx"
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,7 +3,7 @@
|
|||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=16.13.0 <17.0.0"
|
||||
"node": ">=16.13.0 <17.0.0 || >=18.17.1 <19.0.0"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
|
@ -13,23 +13,25 @@
|
|||
"serve": "gulp bundle --custom-serve --max_old_space_size=4096 && fast-serve"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/sp-adaptive-card-extension-base": "1.16.1",
|
||||
"@microsoft/sp-core-library": "1.16.1",
|
||||
"@microsoft/sp-property-pane": "1.16.1",
|
||||
"@microsoft/sp-adaptive-card-extension-base": "1.19.0",
|
||||
"@microsoft/sp-core-library": "1.19.0",
|
||||
"@microsoft/sp-property-pane": "1.19.0",
|
||||
"tslib": "2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/eslint-config-spfx": "1.16.1",
|
||||
"@microsoft/eslint-plugin-spfx": "1.16.1",
|
||||
"@microsoft/eslint-config-spfx": "1.20.1",
|
||||
"@microsoft/eslint-plugin-spfx": "1.20.1",
|
||||
"@microsoft/microsoft-graph-types": "^2.25.0",
|
||||
"@microsoft/rush-stack-compiler-4.5": "0.2.2",
|
||||
"@microsoft/sp-build-web": "1.16.1",
|
||||
"@microsoft/sp-module-interfaces": "1.16.1",
|
||||
"@microsoft/rush-stack-compiler-4.7": "0.1.0",
|
||||
"@microsoft/sp-build-web": "1.20.1",
|
||||
"@microsoft/sp-module-interfaces": "1.20.1",
|
||||
"@rushstack/eslint-config": "2.5.1",
|
||||
"@types/webpack-env": "~1.15.2",
|
||||
"ajv": "^6.12.5",
|
||||
"eslint": "8.7.0",
|
||||
"gulp": "4.0.2",
|
||||
"spfx-fast-serve-helpers": "~1.16.0",
|
||||
"typescript": "4.5.5"
|
||||
"typescript": "4.7.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
import { ISPFxAdaptiveCard, BaseAdaptiveCardView } from "@microsoft/sp-adaptive-card-extension-base";
|
||||
import { ISPFxAdaptiveCard, BaseAdaptiveCardQuickView } from "@microsoft/sp-adaptive-card-extension-base";
|
||||
|
||||
import { IMyOneDriveInfoAdaptiveCardExtensionProps, IMyOneDriveInfoAdaptiveCardExtensionState } from "../MyOneDriveInfoAdaptiveCardExtension";
|
||||
import { HelperService } from "../services/HelperService";
|
||||
|
||||
export interface IQuickViewData {
|
||||
driveType: string;
|
||||
lastModifiedBy: string;
|
||||
lastModifiedDateTime: string;
|
||||
totalSize: string;
|
||||
deletedSize: string;
|
||||
usedSize: string;
|
||||
remainingSize: string;
|
||||
state: string;
|
||||
webUrl: string;
|
||||
driveType: string;
|
||||
lastModifiedBy: string;
|
||||
lastModifiedDateTime: string;
|
||||
totalSize: string;
|
||||
deletedSize: string;
|
||||
usedSize: string;
|
||||
remainingSize: string;
|
||||
state: string;
|
||||
webUrl: string;
|
||||
}
|
||||
|
||||
export class QuickView extends BaseAdaptiveCardView<IMyOneDriveInfoAdaptiveCardExtensionProps, IMyOneDriveInfoAdaptiveCardExtensionState, IQuickViewData> {
|
||||
public get data(): IQuickViewData {
|
||||
const driveDetails = this.state.myDriveDetails;
|
||||
return {
|
||||
driveType: driveDetails?.driveType ?? "",
|
||||
lastModifiedBy: driveDetails?.lastModifiedBy?.user?.displayName ?? "",
|
||||
lastModifiedDateTime: driveDetails?.lastModifiedDateTime ? new Date(driveDetails.lastModifiedDateTime).toLocaleString() : "",
|
||||
totalSize: driveDetails?.quota?.total ? `${HelperService.calculateSpace(driveDetails.quota.total).spaceString}` : "",
|
||||
deletedSize: driveDetails?.quota?.deleted ? `${HelperService.calculateSpace(driveDetails.quota.deleted).spaceString}` : "-",
|
||||
usedSize: driveDetails?.quota?.used ? `${HelperService.calculateSpace(driveDetails.quota.used).spaceString}` : "-",
|
||||
remainingSize: driveDetails?.quota?.remaining ? `${HelperService.calculateSpace(driveDetails.quota.remaining).spaceString}` : "-",
|
||||
state: driveDetails?.quota?.state ?? "",
|
||||
webUrl: driveDetails?.webUrl ?? "",
|
||||
};
|
||||
}
|
||||
export class QuickView extends BaseAdaptiveCardQuickView<IMyOneDriveInfoAdaptiveCardExtensionProps, IMyOneDriveInfoAdaptiveCardExtensionState, IQuickViewData> {
|
||||
public get data(): IQuickViewData {
|
||||
const driveDetails = this.state.myDriveDetails;
|
||||
return {
|
||||
driveType: driveDetails?.driveType ?? "",
|
||||
lastModifiedBy: driveDetails?.lastModifiedBy?.user?.displayName ?? "",
|
||||
lastModifiedDateTime: driveDetails?.lastModifiedDateTime ? new Date(driveDetails.lastModifiedDateTime).toLocaleString() : "",
|
||||
totalSize: driveDetails?.quota?.total ? `${HelperService.calculateSpace(driveDetails.quota.total).spaceString}` : "",
|
||||
deletedSize: driveDetails?.quota?.deleted ? `${HelperService.calculateSpace(driveDetails.quota.deleted).spaceString}` : "-",
|
||||
usedSize: driveDetails?.quota?.used ? `${HelperService.calculateSpace(driveDetails.quota.used).spaceString}` : "-",
|
||||
remainingSize: driveDetails?.quota?.remaining ? `${HelperService.calculateSpace(driveDetails.quota.remaining).spaceString}` : "-",
|
||||
state: driveDetails?.quota?.state ?? "",
|
||||
webUrl: driveDetails?.webUrl ?? "",
|
||||
};
|
||||
}
|
||||
|
||||
public get template(): ISPFxAdaptiveCard {
|
||||
return require("./template/QuickViewTemplate.json");
|
||||
}
|
||||
public get template(): ISPFxAdaptiveCard {
|
||||
return require("./template/QuickViewTemplate.json");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
import { AdaptiveCardExtensionContext } from "@microsoft/sp-adaptive-card-extension-base";
|
||||
import { MSGraphClientV3, GraphRequest } from "@microsoft/sp-http-msgraph";
|
||||
import { MSGraphClientV3 } from "@microsoft/sp-http-msgraph";
|
||||
import { Drive } from "@microsoft/microsoft-graph-types";
|
||||
export class GraphService {
|
||||
private context: AdaptiveCardExtensionContext;
|
||||
private context: AdaptiveCardExtensionContext;
|
||||
|
||||
constructor(context: AdaptiveCardExtensionContext) {
|
||||
this.context = context;
|
||||
}
|
||||
constructor(context: AdaptiveCardExtensionContext) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
private getClient = async (): Promise<MSGraphClientV3> => {
|
||||
return await this.context.msGraphClientFactory.getClient("3");
|
||||
};
|
||||
private getClient = async (): Promise<MSGraphClientV3> => {
|
||||
return await this.context.msGraphClientFactory.getClient("3");
|
||||
};
|
||||
|
||||
public getMyDriveInfo = async (): Promise<Drive> => {
|
||||
try {
|
||||
const client = await this.getClient();
|
||||
const request: GraphRequest = client.api("/me/drive");
|
||||
const driveInfo: Drive = await request.get();
|
||||
return Promise.resolve(driveInfo);
|
||||
} catch (ex) {
|
||||
return Promise.reject(ex);
|
||||
}
|
||||
};
|
||||
public getMyDriveInfo = async (): Promise<Drive> => {
|
||||
try {
|
||||
const client = await this.getClient();
|
||||
const request = client.api("/me/drive");
|
||||
const driveInfo: Drive = await request.get();
|
||||
return Promise.resolve(driveInfo);
|
||||
} catch (ex) {
|
||||
return Promise.reject(ex);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json",
|
||||
"extends": "./node_modules/@microsoft/rush-stack-compiler-4.7/includes/tsconfig-web.json",
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
|
@ -15,22 +15,9 @@
|
|||
"strictNullChecks": false,
|
||||
"noImplicitAny": true,
|
||||
|
||||
"typeRoots": [
|
||||
"./node_modules/@types",
|
||||
"./node_modules/@microsoft"
|
||||
],
|
||||
"types": [
|
||||
"webpack-env"
|
||||
],
|
||||
"lib": [
|
||||
"es5",
|
||||
"dom",
|
||||
"es2015.collection",
|
||||
"es2015.promise"
|
||||
]
|
||||
"typeRoots": ["./node_modules/@types", "./node_modules/@microsoft"],
|
||||
"types": ["webpack-env"],
|
||||
"lib": ["es5", "dom", "es2015.collection", "es2015.promise"]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx"
|
||||
]
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx"]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue