review changes

This commit is contained in:
Harminder Singh 2023-02-19 06:13:50 +05:30
parent 9a317edf17
commit 407b2f6904
9 changed files with 170 additions and 163 deletions

View File

@ -1,4 +1,4 @@
# Microsoft 365 Services Health # Service Health for Microsoft 365
## Summary ## Summary
@ -38,7 +38,18 @@ For more information about SPFx compatibility, please refer to <https://aka.ms/s
## Prerequisites ## Prerequisites
> Any special pre-requisites? - SharePoint Online tenant
- You have to provide permission in SharePoint admin for accessing Graph API on behalf of your solution. You can do it before deployment as proactive steps, or after deployment. You can refer to [steps about how to do this post-deployment](https://learn.microsoft.com/sharepoint/dev/spfx/use-aad-tutorial#deploy-the-solution-and-grant-permissions). You have to use API Access Page of SharePoint admin and add below permission for our use case.
```
"webApiPermissionRequests": [
{
"resource": "Microsoft Graph",
"scope": "ServiceHealth.Read.All"
}
]
```
## Contributors ## Contributors

View File

@ -2,12 +2,12 @@
{ {
"name": "pnp-sp-dev-spfx-web-parts-react-m365-services-health", "name": "pnp-sp-dev-spfx-web-parts-react-m365-services-health",
"source": "pnp", "source": "pnp",
"title": "Microsoft 365 Services Health", "title": "Service Health for Microsoft 365",
"shortDescription": "M365 Services Health solution show the health status for all the Microsoft 365 services", "shortDescription": "Service Health for Microsoft 365 solution show the health status for all the Microsoft 365 services",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-m365-services-health", "url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-m365-services-health",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-m365-services-health", "downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-m365-services-health",
"longDescription": [ "longDescription": [
"M365 Services Health solution show the health status for all the M365 services" "Service Health for Microsoft 365 solution show the health status for all the M365 services"
], ],
"creationDateTime": "2023-02-03", "creationDateTime": "2023-02-03",
"updateDateTime": "2023-02-03", "updateDateTime": "2023-02-03",

View File

@ -1,7 +1,7 @@
{ {
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": { "solution": {
"name": "M365 Services Health", "name": "Service Health for Microsoft 365",
"id": "f4d4b329-f1c6-49c9-a2fa-12a9816ac717", "id": "f4d4b329-f1c6-49c9-a2fa-12a9816ac717",
"version": "1.0.0.0", "version": "1.0.0.0",
"includeClientSideAssets": true, "includeClientSideAssets": true,
@ -22,10 +22,10 @@
], ],
"metadata": { "metadata": {
"shortDescription": { "shortDescription": {
"default": "M365 Services health" "default": "Service Health for Microsoft 365"
}, },
"longDescription": { "longDescription": {
"default": "M365 Services health" "default": "Service Health for Microsoft 365"
}, },
"screenshotPaths": [], "screenshotPaths": [],
"videoUrl": "", "videoUrl": "",
@ -34,7 +34,7 @@
}, },
"features": [ "features": [
{ {
"title": "M365 Services Health Feature", "title": "Service Health for Microsoft 365 Feature",
"description": "The feature that activates elements of the react-m-365-services-health solution.", "description": "The feature that activates elements of the react-m-365-services-health solution.",
"id": "9d9e7584-45be-4df4-8023-5c271402cf87", "id": "9d9e7584-45be-4df4-8023-5c271402cf87",
"version": "1.0.0.0" "version": "1.0.0.0"

View File

@ -1,3 +1,4 @@
import { ServiceHealth } from "@microsoft/microsoft-graph-types";
import { MSGraphClientV3, GraphRequest } from "@microsoft/sp-http-msgraph"; import { MSGraphClientV3, GraphRequest } from "@microsoft/sp-http-msgraph";
import { WebPartContext } from "@microsoft/sp-webpart-base"; import { WebPartContext } from "@microsoft/sp-webpart-base";
@ -12,11 +13,10 @@ export class GraphService {
return await this.context.msGraphClientFactory.getClient("3"); return await this.context.msGraphClientFactory.getClient("3");
}; };
public getHealthOverviews = async (): Promise<any> => { public getHealthOverviews = async (): Promise<ServiceHealth[]> => {
const client = await this.getClient(); const client = await this.getClient();
const request: GraphRequest = client.api("/admin/serviceAnnouncement/healthOverviews"); const request: GraphRequest = client.api("/admin/serviceAnnouncement/healthOverviews");
const response = await request.expand("issues").get(); const response = await request.expand("issues").get();
return Promise.resolve(response.value); return Promise.resolve(response.value as ServiceHealth[]);
}; };
} }

View File

@ -1,4 +1,3 @@
export namespace HelperService {
export const getFormattedDateTime = (value: string): string => { export const getFormattedDateTime = (value: string): string => {
const date = new Date(value); const date = new Date(value);
const dateString = date.toLocaleDateString("en-US", { const dateString = date.toLocaleDateString("en-US", {
@ -23,7 +22,7 @@ export namespace HelperService {
case "microsoft 365 apps": case "microsoft 365 apps":
case "microsoft 365 defender": case "microsoft 365 defender":
case "microsoft 365 for the web": case "microsoft 365 for the web":
case "microsoft mefender for cloud apps": case "microsoft defender for cloud apps":
case "privileged access": case "privileged access":
icon = "Product"; icon = "Product";
break; break;
@ -90,4 +89,3 @@ export namespace HelperService {
} }
return icon; return icon;
}; };
}

View File

@ -18,7 +18,7 @@
"preconfiguredEntries": [{ "preconfiguredEntries": [{
"groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Advanced "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Advanced
"group": { "default": "Advanced" }, "group": { "default": "Advanced" },
"title": { "default": "M365 Services Health" }, "title": { "default": "Service Health for Microsoft 365" },
"description": { "default": "m365-services-health description" }, "description": { "default": "m365-services-health description" },
"officeFabricIconFontName": "HealthSolid", "officeFabricIconFontName": "HealthSolid",
"properties": { "properties": {

View File

@ -1,7 +1,7 @@
import { ServiceHealthIssuePost } from "@microsoft/microsoft-graph-types"; import { ServiceHealthIssuePost } from "@microsoft/microsoft-graph-types";
import Style from "./IssueDetail.module.scss"; import Style from "./IssueDetail.module.scss";
import * as React from "react"; import * as React from "react";
import { HelperService } from "../../../../../common/services/HelperService"; import * as HelperService from "../../../../../common/services/HelperService";
import { Icon, Label } from "@fluentui/react"; import { Icon, Label } from "@fluentui/react";
import { IIssueDetailProps } from "../../../interfaces/ServiceHealthModels"; import { IIssueDetailProps } from "../../../interfaces/ServiceHealthModels";

View File

@ -2,7 +2,7 @@ import { DefaultButton, DetailsList, IColumn, IPanelProps, IRenderFunction, Pane
import { ServiceHealth, ServiceHealthIssue } from "@microsoft/microsoft-graph-types"; import { ServiceHealth, ServiceHealthIssue } from "@microsoft/microsoft-graph-types";
import * as React from "react"; import * as React from "react";
import { IServiceHealthOverviewItem, IServiceHealthOverviewProps, IServiceHealthOverviewState } from "../../interfaces/ServiceHealthModels"; import { IServiceHealthOverviewItem, IServiceHealthOverviewProps, IServiceHealthOverviewState } from "../../interfaces/ServiceHealthModels";
import { ListViewHelperService } from "../../services/ListViewHelperService"; import * as ListViewHelperService from "../../services/ListViewHelperService";
import { backButtonStyles, cancelButtonStyle, issueDetailPanelStyles, issueListPanelStyles } from "./Constant"; import { backButtonStyles, cancelButtonStyle, issueDetailPanelStyles, issueListPanelStyles } from "./Constant";
import { IssueDetail } from "./IssueDetail/IssueDetail"; import { IssueDetail } from "./IssueDetail/IssueDetail";
import { IssueList } from "./IssueList/IssueList"; import { IssueList } from "./IssueList/IssueList";

View File

@ -2,7 +2,6 @@ import { IServiceHealthOverviewItem } from "./../interfaces/ServiceHealthModels"
import { IColumn } from "@fluentui/react"; import { IColumn } from "@fluentui/react";
import { ServiceHealth, ServiceHealthIssue } from "@microsoft/microsoft-graph-types"; import { ServiceHealth, ServiceHealthIssue } from "@microsoft/microsoft-graph-types";
export namespace ListViewHelperService {
export const getOverviewListViewColumns = (): IColumn[] => { export const getOverviewListViewColumns = (): IColumn[] => {
const viewColumnsSchema: IColumn[] = [ const viewColumnsSchema: IColumn[] = [
{ {
@ -62,4 +61,3 @@ export namespace ListViewHelperService {
overviewItems.sort((a, b) => a.Status.localeCompare(b.Status)); overviewItems.sort((a, b) => a.Status.localeCompare(b.Status));
return overviewItems; return overviewItems;
}; };
}