diff --git a/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/GraphAppSecretExpirationWebPart.ts b/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/GraphAppSecretExpirationWebPart.ts index 2f331b347..fcb9bbd44 100644 --- a/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/GraphAppSecretExpirationWebPart.ts +++ b/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/GraphAppSecretExpirationWebPart.ts @@ -24,10 +24,10 @@ export interface IGraphAppSecretExpirationWebPartProps { export default class GraphAppSecretExpirationWebPart extends BaseClientSideWebPart { private graphClient: MSGraphClient; private dropdownOptions: IPropertyPaneDropdownOption[] = [ - {key:"none",text:"None"}, - {key:"applicationId",text:"Application ID"}, - {key:"type",text:"Type"}]; - + { key: "none", text: "None" }, + { key: "applicationId", text: "Application ID" }, + { key: "type", text: "Type" }]; + public onInit(): Promise { return new Promise((resolve: () => void, reject: (error: any) => void): void => { this.context.msGraphClientFactory @@ -72,28 +72,28 @@ export default class GraphAppSecretExpirationWebPart extends BaseClientSideWebPa { groupName: strings.BasicGroupName, groupFields: [ - PropertyPaneDropdown('groupByColumn', { - label: strings.DefaultGroupColumnFieldLabel, + PropertyPaneDropdown('groupByColumn', { + label: strings.DefaultGroupColumnFieldLabel, options: this.dropdownOptions, selectedKey: "none" - }), - PropertyPaneToggle('expiringSoon', { - label: strings.DisplayOnlySecretsFieldLabel, - onText:"Yes", - offText:"No" - - }) + }), + PropertyPaneToggle('expiringSoon', { + label: strings.DisplayOnlySecretsFieldLabel, + onText: "Yes", + offText: "No" + + }) ] }, { groupName: strings.OtherGroupName, groupFields: [ - PropertyPaneToggle('displaySampleData', { + PropertyPaneToggle('displaySampleData', { label: strings.DisplaySampleDataFieldLabel, - onText:"Yes", - offText:"No" - - }) + onText: "Yes", + offText: "No" + + }) ] } ] diff --git a/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/components/GraphAppSecretExpiration.tsx b/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/components/GraphAppSecretExpiration.tsx index 3cd993dd5..b290890cf 100644 --- a/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/components/GraphAppSecretExpiration.tsx +++ b/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/components/GraphAppSecretExpiration.tsx @@ -73,9 +73,9 @@ export default class GraphAppSecretExpiration extends React.Component 0 ? daysBeforeExpiration : 0, - linkTitle: "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/Credentials/appId/"+app.appId + linkTitle: "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/Credentials/appId/" + app.appId }; - if (this.props.expiringSoon){ - if(daysBeforeExpiration < 30){ + if (this.props.expiringSoon) { + if (daysBeforeExpiration < 30) { displayedApplication.push(formatedApp); } } else { displayedApplication.push(formatedApp); - } + } }); app.keyCredentials.forEach(keyCred => { let daysBeforeExpiration = moment.duration((moment(keyCred.endDateTime)).diff(today, 'days'), 'days').asDays(); @@ -152,15 +152,15 @@ export default class GraphAppSecretExpiration extends React.Component 0 ? daysBeforeExpiration : 0, - linkTitle: "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/Credentials/appId/"+app.appId + linkTitle: "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/Credentials/appId/" + app.appId }; - if (this.props.expiringSoon){ - if(daysBeforeExpiration < 30){ + if (this.props.expiringSoon) { + if (daysBeforeExpiration < 30) { displayedApplication.push(formatedApp); } } else { displayedApplication.push(formatedApp); - } + } }); }); this.setState({ diff --git a/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/components/GraphAppSecretExpirationState.ts b/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/components/GraphAppSecretExpirationState.ts index 567efe0e2..ad78ce8e7 100644 --- a/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/components/GraphAppSecretExpirationState.ts +++ b/samples/react-graph-app-secret-expiration/src/webparts/graphAppSecretExpiration/components/GraphAppSecretExpirationState.ts @@ -1,13 +1,13 @@ import { IGrouping } from '@pnp/spfx-controls-react/lib/ListView'; -import { IApplications, IApplication,IPasswordCredential,IKeyCredential,IFormattedApplication } from '../../../models/IApplication'; +import { IFormattedApplication } from '../../../models/IApplication'; export interface IGraphAppSecretExpirationState { - applications: IFormattedApplication[]; - filteredApplications: IFormattedApplication[]; - filterValue: string; - searchFilter: string; - groupByFields: IGrouping[]; - page: number; - error: string; - loading: boolean; - } \ No newline at end of file + applications: IFormattedApplication[]; + filteredApplications: IFormattedApplication[]; + filterValue: string; + searchFilter: string; + groupByFields: IGrouping[]; + page: number; + error: string; + loading: boolean; +} \ No newline at end of file