Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New test project. #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ node_modules
*/bin/
*/App_Data/Logs/
*/App_Data/TEMP/
Sigmund.EnhancedDictionaryEditor.Test.Website/App_Plugins/SigmundEnhancedDictionaryEditor
6 changes: 6 additions & 0 deletions EnhancedDictionaryEditor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.27130.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sigmund.EnhancedDictionaryEditor", "Sigmund.EnhancedDictionaryEditor\Sigmund.EnhancedDictionaryEditor.csproj", "{7B669893-2EC4-4BD6-BB83-273F8F818052}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sigmund.EnhancedDictionaryEditor.Test.Website", "Sigmund.EnhancedDictionaryEditor.Test.Website\Sigmund.EnhancedDictionaryEditor.Test.Website.csproj", "{2B907140-BFD0-4E75-B4B9-F23EADEEE792}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{7B669893-2EC4-4BD6-BB83-273F8F818052}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B669893-2EC4-4BD6-BB83-273F8F818052}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B669893-2EC4-4BD6-BB83-273F8F818052}.Release|Any CPU.Build.0 = Release|Any CPU
{2B907140-BFD0-4E75-B4B9-F23EADEEE792}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B907140-BFD0-4E75-B4B9-F23EADEEE792}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B907140-BFD0-4E75-B4B9-F23EADEEE792}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B907140-BFD0-4E75-B4B9-F23EADEEE792}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<browsers>

<browser refID="Default">
<controlAdapters>
<adapter controlType="System.Web.UI.HtmlControls.HtmlForm"
adapterType="umbraco.presentation.urlRewriter.FormRewriterControlAdapter" />
</controlAdapters>
</browser>

</browsers>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<browsers>
<!--
Browser capability file for the w3c validator

sample UA: "W3C_Validator/1.305.2.148 libwww-perl/5.803"
-->
<browser id="w3cValidator" parentID="default">
<identification>
<userAgent match="^W3C_Validator" />
</identification>

<capture>
<userAgent match="^W3C_Validator/(?'version'(?'major'\d+)(?'minor'\.\d+)\w*).*" />
</capture>

<capabilities>
<capability name="browser" value="w3cValidator" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="version" value="${version}" />
<capability name="w3cdomversion" value="1.0" />
<capability name="xml" value="true" />
<capability name="tagWriter" value="System.Web.UI.HtmlTextWriter" />
</capabilities>
</browser>
</browsers>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
function modelsBuilderController($scope, umbRequestHelper, $log, $http, modelsBuilderResource) {

$scope.generate = function() {
$scope.generating = true;
umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("modelsBuilderBaseUrl", "BuildModels")),
'Failed to generate.')
.then(function (result) {
$scope.generating = false;
$scope.dashboard = result;
});
};

$scope.reload = function () {
$scope.ready = false;
modelsBuilderResource.getDashboard().then(function (result) {
$scope.dashboard = result;
$scope.ready = true;
});
};

function init() {
modelsBuilderResource.getDashboard().then(function(result) {
$scope.dashboard = result;
$scope.ready = true;
});
}

init();
}
angular.module("umbraco").controller("Umbraco.Dashboard.ModelsBuilderController", modelsBuilderController);
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<div id="modelsBuilder" ng-controller="Umbraco.Dashboard.ModelsBuilderController">

<div ng-show="ready" style="float: right;">
<button type="button" class="btn" ng-click="reload()"><span>Reload</span></button>
</div>

<h3>Models Builder</h3>

<div ng-show="!ready">
Loading...
</div>

<div ng-show="ready">
<div ng-bind-html-unsafe="dashboard.text"></div>

<div ng-if="dashboard.outOfDateModels">
<p>Models are <strong>out-of-date</strong>.
</p>
</div>

<div ng-if="dashboard.canGenerate">
<div ng-if="dashboard.generateCausesRestart">
<p style="color: red; font-weight: bold;">Generating models will restart the application.</p>
</div>
<div ng-show="!generating">
<button type="button" ng-click="generate()" class="btn btn-danger">
<span>Generate models</span>
</button>
</div>
<div class="umb-loader-wrapper" ng-show="generating">
<div class="umb-loader"></div>
</div>
</div>

<div ng-if="dashboard.lastError" style="margin-top: 32px;" ng-show="!generating">
<span style="color: red; font-weight: bold;">Last generation failed with the following error:</span>
<pre style="width: 80%; white-space: pre-line; background: #f8f8f8; padding: 4px; font-size: small;">{{dashboard.lastError}}</pre>
</div>
</div>

</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function modelsBuilderResource($q, $http, umbRequestHelper) {

return {
getModelsOutOfDateStatus: function () {
return umbRequestHelper.resourcePromise(
$http.get(umbRequestHelper.getApiUrl("modelsBuilderBaseUrl", "GetModelsOutOfDateStatus")),
"Failed to get models out-of-date status");
},

buildModels: function () {
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("modelsBuilderBaseUrl", "BuildModels")),
"Failed to build models");
},

getDashboard: function () {
return umbRequestHelper.resourcePromise(
$http.get(umbRequestHelper.getApiUrl("modelsBuilderBaseUrl", "GetDashboard")),
"Failed to get dashboard");
}
};
}
angular.module("umbraco.resources").factory("modelsBuilderResource", modelsBuilderResource);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
//array of files we want to inject into the application on app_start
javascript: [
'~/App_Plugins/ModelsBuilder/modelsbuilder.controller.js',
'~/App_Plugins/ModelsBuilder/modelsbuilder.resource.js'
]
}
2 changes: 2 additions & 0 deletions Sigmund.EnhancedDictionaryEditor.Test.Website/Global.asax
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<%@ Application Inherits="Umbraco.Web.UmbracoApplication" Language="C#" %>

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<clear />
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Sigmund.EnhancedDictionaryEditor.Test.Website")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sigmund.EnhancedDictionaryEditor.Test.Website")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2b907140-bfd0-4e75-b4b9-f23eadeee792")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading