format code
This commit is contained in:
parent
bebe3b9c5e
commit
41172a784f
|
@ -24,9 +24,9 @@ export interface IGraphAppSecretExpirationWebPartProps {
|
||||||
export default class GraphAppSecretExpirationWebPart extends BaseClientSideWebPart<IGraphAppSecretExpirationWebPartProps> {
|
export default class GraphAppSecretExpirationWebPart extends BaseClientSideWebPart<IGraphAppSecretExpirationWebPartProps> {
|
||||||
private graphClient: MSGraphClient;
|
private graphClient: MSGraphClient;
|
||||||
private dropdownOptions: IPropertyPaneDropdownOption[] = [
|
private dropdownOptions: IPropertyPaneDropdownOption[] = [
|
||||||
{key:"none",text:"None"},
|
{ key: "none", text: "None" },
|
||||||
{key:"applicationId",text:"Application ID"},
|
{ key: "applicationId", text: "Application ID" },
|
||||||
{key:"type",text:"Type"}];
|
{ key: "type", text: "Type" }];
|
||||||
|
|
||||||
public onInit(): Promise<void> {
|
public onInit(): Promise<void> {
|
||||||
return new Promise<void>((resolve: () => void, reject: (error: any) => void): void => {
|
return new Promise<void>((resolve: () => void, reject: (error: any) => void): void => {
|
||||||
|
@ -79,8 +79,8 @@ export default class GraphAppSecretExpirationWebPart extends BaseClientSideWebPa
|
||||||
}),
|
}),
|
||||||
PropertyPaneToggle('expiringSoon', {
|
PropertyPaneToggle('expiringSoon', {
|
||||||
label: strings.DisplayOnlySecretsFieldLabel,
|
label: strings.DisplayOnlySecretsFieldLabel,
|
||||||
onText:"Yes",
|
onText: "Yes",
|
||||||
offText:"No"
|
offText: "No"
|
||||||
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
@ -90,8 +90,8 @@ export default class GraphAppSecretExpirationWebPart extends BaseClientSideWebPa
|
||||||
groupFields: [
|
groupFields: [
|
||||||
PropertyPaneToggle('displaySampleData', {
|
PropertyPaneToggle('displaySampleData', {
|
||||||
label: strings.DisplaySampleDataFieldLabel,
|
label: strings.DisplaySampleDataFieldLabel,
|
||||||
onText:"Yes",
|
onText: "Yes",
|
||||||
offText:"No"
|
offText: "No"
|
||||||
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
|
|
@ -73,9 +73,9 @@ export default class GraphAppSecretExpiration extends React.Component<IGraphAppS
|
||||||
|
|
||||||
|
|
||||||
public componentDidMount(): void {
|
public componentDidMount(): void {
|
||||||
if(!this.props.displaySampleData){
|
if (!this.props.displaySampleData) {
|
||||||
this._getApplications();
|
this._getApplications();
|
||||||
}else{
|
} else {
|
||||||
this._propertiesMapping(sampleApplications.applications);
|
this._propertiesMapping(sampleApplications.applications);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,10 +134,10 @@ export default class GraphAppSecretExpiration extends React.Component<IGraphAppS
|
||||||
type: "Secret",
|
type: "Secret",
|
||||||
expirationDate: (moment(pswd.endDateTime)).format('DD-MMM-YYYY'),
|
expirationDate: (moment(pswd.endDateTime)).format('DD-MMM-YYYY'),
|
||||||
daysLeft: daysBeforeExpiration > 0 ? daysBeforeExpiration : 0,
|
daysLeft: daysBeforeExpiration > 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 (this.props.expiringSoon) {
|
||||||
if(daysBeforeExpiration < 30){
|
if (daysBeforeExpiration < 30) {
|
||||||
displayedApplication.push(formatedApp);
|
displayedApplication.push(formatedApp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -152,10 +152,10 @@ export default class GraphAppSecretExpiration extends React.Component<IGraphAppS
|
||||||
type: "Certificate",
|
type: "Certificate",
|
||||||
expirationDate: (moment(keyCred.endDateTime)).format('DD-MMM-YYYY'),
|
expirationDate: (moment(keyCred.endDateTime)).format('DD-MMM-YYYY'),
|
||||||
daysLeft: daysBeforeExpiration > 0 ? daysBeforeExpiration : 0,
|
daysLeft: daysBeforeExpiration > 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 (this.props.expiringSoon) {
|
||||||
if(daysBeforeExpiration < 30){
|
if (daysBeforeExpiration < 30) {
|
||||||
displayedApplication.push(formatedApp);
|
displayedApplication.push(formatedApp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { IGrouping } from '@pnp/spfx-controls-react/lib/ListView';
|
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 {
|
export interface IGraphAppSecretExpirationState {
|
||||||
applications: IFormattedApplication[];
|
applications: IFormattedApplication[];
|
||||||
|
@ -10,4 +10,4 @@ export interface IGraphAppSecretExpirationState {
|
||||||
page: number;
|
page: number;
|
||||||
error: string;
|
error: string;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
}
|
}
|
Loading…
Reference in New Issue