Skip to content

Commit

Permalink
Merge pull request #134 from david-poindexter/no-vulnerabilities-ux
Browse files Browse the repository at this point in the history
Add no vulnerabilities message and a loading message
  • Loading branch information
valadas authored Jun 18, 2023
2 parents bc2393a + b93724e commit f295222
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Services/LocalizationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ private LocalizationViewModel HydrateViewModel()
{
DnnPlatformVersion = this.GetString("DnnPlatformVersion", "UI.resx"),
DnnSecurityCenter = this.GetString("DnnSecurityCenter", "UI.resx"),
Loading = this.GetString("Loading", "UI.resx"),
NoBulletins = this.GetString("NoBulletins", "UI.resx"),

};
viewModel.UI = ui;
Expand Down
8 changes: 8 additions & 0 deletions ViewModels/LocalizationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ public class UIInfo
/// <example>DNN Security Center</example>
public string DnnSecurityCenter { get; set; }

/// <summary>Gets or sets the Loading localized text.</summary>
/// <example>Loading...</example>
public string Loading { get; set; }

/// <summary>Gets or sets the NoBulletins localized text.</summary>
/// <example>There are no known security vulnerabilities for the selected DNN Platform version.</example>
public string NoBulletins { get; set; }


}

Expand Down
10 changes: 10 additions & 0 deletions docs/rest/rest.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@
"type": "string",
"description": "Gets or sets the DnnSecurityCenter localized text.",
"example": "DNN Security Center"
},
"Loading": {
"type": "string",
"description": "Gets or sets the Loading localized text.",
"example": "Loading..."
},
"NoBulletins": {
"type": "string",
"description": "Gets or sets the NoBulletins localized text.",
"example": "There are no known security vulnerabilities for the selected DNN Platform version."
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class DnnSecurityCenter {
}

private handleSelect(event): void {
this.securityBulletins = undefined;
this.selectValue = event.target.value;
if (this.selectValue === 'All Versions') {
window.location.reload();
Expand Down Expand Up @@ -98,6 +99,12 @@ export class DnnSecurityCenter {
)}
</select>
</h3>
{this.securityBulletins === undefined &&
<div class="loading">{this.resx.uI.loading}</div>
}
{this.securityBulletins?.bulletins?.length === 0 &&
<div class="no-bulletins">{this.resx.uI.noBulletins}</div>
}
{this.securityBulletins?.bulletins?.map((bulletin, index) => {
return (
<div class="bulletins">
Expand Down
12 changes: 12 additions & 0 deletions module.web/src/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ export class UIInfo implements IUIInfo {
dnnPlatformVersion?: string | undefined;
/** Gets or sets the DnnSecurityCenter localized text. */
dnnSecurityCenter?: string | undefined;
/** Gets or sets the Loading localized text. */
loading?: string | undefined;
/** Gets or sets the NoBulletins localized text. */
noBulletins?: string | undefined;

constructor(data?: IUIInfo) {
if (data) {
Expand All @@ -262,6 +266,8 @@ export class UIInfo implements IUIInfo {
if (_data) {
this.dnnPlatformVersion = _data["DnnPlatformVersion"];
this.dnnSecurityCenter = _data["DnnSecurityCenter"];
this.loading = _data["Loading"];
this.noBulletins = _data["NoBulletins"];
}
}

Expand All @@ -276,6 +282,8 @@ export class UIInfo implements IUIInfo {
data = typeof data === 'object' ? data : {};
data["DnnPlatformVersion"] = this.dnnPlatformVersion;
data["DnnSecurityCenter"] = this.dnnSecurityCenter;
data["Loading"] = this.loading;
data["NoBulletins"] = this.noBulletins;
return data;
}
}
Expand All @@ -286,6 +294,10 @@ export interface IUIInfo {
dnnPlatformVersion?: string | undefined;
/** Gets or sets the DnnSecurityCenter localized text. */
dnnSecurityCenter?: string | undefined;
/** Gets or sets the Loading localized text. */
loading?: string | undefined;
/** Gets or sets the NoBulletins localized text. */
noBulletins?: string | undefined;
}

/** A viewmodel that represents DNN Security Bulletins. */
Expand Down
6 changes: 6 additions & 0 deletions resources/App_LocalResources/UI.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,10 @@
<data name="DnnSecurityCenter.Text" xml:space="preserve">
<value>DNN Security Center</value>
</data>
<data name="Loading.Text" xml:space="preserve">
<value>Loading...</value>
</data>
<data name="NoBulletins.Text" xml:space="preserve">
<value>There are no known security vulnerabilities for the selected DNN Platform version.</value>
</data>
</root>

0 comments on commit f295222

Please sign in to comment.