-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Config loader in JS initial & SPO installer updates * Code done * . * . * Working * All working * Service imports uses MetadataRefreshMinutes
- Loading branch information
Showing
58 changed files
with
4,149 additions
and
6,876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
src/AnalyticsEngine/App.ControlPanel.Engine/SPO/SiteTrackerInstaller/Models.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using System; | ||
using DataUtils; | ||
|
||
namespace App.ControlPanel.Engine.SPO | ||
{ | ||
|
||
public class ModernAppCustomAction | ||
{ | ||
public const string DESCRIPTION = "SPO Insights ModernUI AITracker App Customizer"; | ||
public const string LOCATION = "ClientSideExtension.ApplicationCustomizer"; | ||
public ModernAppCustomAction(string appInsightsConnectionString, string cacheToken) | ||
{ | ||
this.ClientSideComponentProperties = "{\"appInsightsConnectionStringHash\": \"" + appInsightsConnectionString.Base64Encode() + "\", \"cacheToken\": \"" + cacheToken + "\"}"; | ||
} | ||
|
||
public string Name { get; } = "AiTrackerModernApplicationCustomizer"; | ||
public string Description { get; } = DESCRIPTION; | ||
public string Title { get; } = "AiTrackerModernApplicationCustomizer"; | ||
public Guid ClientSideComponentId { get; } = Guid.Parse("a4e24884-9cfd-41ac-87af-747a47055f25"); | ||
public string ClientSideComponentProperties { get; internal set; } | ||
public string Location { get; } = LOCATION; | ||
} | ||
public class ClassicPageCustomAction | ||
{ | ||
public const string DESCRIPTION = "SPO Insights AITracker"; | ||
public const string LOCATION = "ScriptLink"; | ||
public ClassicPageCustomAction(string sourceFileFQDN, string appInsightsConnectionString, string solutionWebsiteBaseUrl) | ||
{ | ||
this.ScriptBlock = "var headID = document.getElementsByTagName(\"head\")[0];" + | ||
"var newScript = document.createElement(\"script\");" + | ||
"newScript.type = \"text/javascript\";newScript.src=\"" + sourceFileFQDN + | ||
"\";headID.appendChild(newScript);" + | ||
$"var appInsightsConnectionStringHash = \"'{appInsightsConnectionString.Base64Encode()}'\";" + | ||
$"var insightsWebRootUrlHash = \"'{solutionWebsiteBaseUrl.Base64Encode()}'\";"; | ||
} | ||
|
||
public string Name { get; set; } | ||
public string Description { get; } = DESCRIPTION; | ||
public string ScriptBlock { get; set; } | ||
public string Location { get; } = LOCATION; | ||
} | ||
|
||
public class ListInfo | ||
{ | ||
public string ServerRelativeUrl { get; set; } | ||
public bool CreatedNew { get; set; } | ||
public bool EnableMinorVersions { get; set; } | ||
} | ||
|
||
public class TrackerInstallConfig | ||
{ | ||
public TrackerInstallConfig(string appInsightsConnectionString, string docLibTitle, byte[] aiTrackerContents) | ||
{ | ||
if (string.IsNullOrEmpty(appInsightsConnectionString)) | ||
{ | ||
throw new ArgumentException($"'{nameof(appInsightsConnectionString)}' cannot be null or empty.", nameof(appInsightsConnectionString)); | ||
} | ||
|
||
if (string.IsNullOrEmpty(docLibTitle)) | ||
{ | ||
throw new ArgumentException($"'{nameof(docLibTitle)}' cannot be null or empty.", nameof(docLibTitle)); | ||
} | ||
|
||
AppInsightsConnectionString = appInsightsConnectionString; | ||
DocLibTitle = docLibTitle; | ||
AiTrackerContents = aiTrackerContents ?? throw new ArgumentNullException(nameof(aiTrackerContents)); | ||
} | ||
|
||
public string AppInsightsConnectionString { get; set; } | ||
public string DocLibTitle { get; set; } | ||
public string AITrackerTitle { get; } = "AITracker.js"; | ||
|
||
public byte[] AiTrackerContents { get; set; } = null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/AnalyticsEngine/Common/Entities/Config/ImportConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace Common.Entities.Config | ||
{ | ||
public class ImportConfig | ||
{ | ||
[JsonProperty(PropertyName = "expiry")] | ||
public DateTime Expiry { get; set; } = DateTime.MinValue; | ||
|
||
[JsonProperty(PropertyName = "metadataRefreshMinutes")] | ||
public int MetadataRefreshMinutes { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.