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

OSOE-588: Upgrade to 1.5.0 #35

Merged
merged 15 commits into from
Apr 2, 2023
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
obj/
bin/
*.user
# Temporarily adding wwwroot to the version control.
# wwwroot/
.vs/
wwwroot/
node_modules/
.eslintrc.js
.stylelintrc.js
3 changes: 0 additions & 3 deletions Lombiq.ContentEditors.Samples/Gulpfile.js

This file was deleted.

28 changes: 18 additions & 10 deletions Lombiq.ContentEditors.Samples/Lombiq.ContentEditors.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.props" />

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
Expand All @@ -23,26 +25,32 @@
<None Include="NuGetIcon.png" Pack="true" PackagePath="" />
</ItemGroup>

<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.Npm.Targets\Lombiq.Npm.Targets.props"/>
<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.Npm.Targets\Lombiq.Npm.Targets.targets"/>
<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.Gulp.Extensions\Lombiq.Gulp.Extensions.targets"/>

<ItemGroup>
<None Remove="node_modules\**"/>
<None Remove="Tests\**"/>
<None Remove="node_modules\**" />
<None Remove="Tests\**" />
</ItemGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="OrchardCore.Module.Targets" Version="1.4.0"/>
<PackageReference Include="OrchardCore.Contents" Version="1.4.0"/>
<PackageReference Include="OrchardCore.Module.Targets" Version="1.5.0" />
<PackageReference Include="OrchardCore.Contents" Version="1.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Lombiq.ContentEditors\Lombiq.ContentEditors.csproj"/>
<ProjectReference Include="..\Lombiq.ContentEditors\Lombiq.ContentEditors.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' != 'true'">
<ProjectReference Include="..\..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.NodeJs.Extensions" Version="1.2.0" />
</ItemGroup>

<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.targets" />

</Project>
10 changes: 0 additions & 10 deletions Lombiq.ContentEditors.Samples/package-lock.json

This file was deleted.

15 changes: 8 additions & 7 deletions Lombiq.ContentEditors.Samples/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"private": true,
"scripts": {
"dotnet-prebuild": "gulp",
"dotnet-postclean": "gulp clean"
}
}
{
"private": true,
"scripts": {
"build": "npm explore nodejs-extensions -- pnpm build",
"clean": "npm explore nodejs-extensions -- pnpm clean",
"watch": "npm explore nodejs-extensions -- pnpm watch"
}
}
5 changes: 0 additions & 5 deletions Lombiq.ContentEditors.Samples/wwwroot/js/sample/sample.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using OpenQA.Selenium;
using System.Threading.Tasks;
namespace Lombiq.ContentEditors.Tests.UI.Extensions;
public static class BasicAsyncEditorTestingUITestContextExtensions
{
public static Task EnableContentEditorsSamplesFeatureAsync(this UITestContext context) =>
context.EnableFeatureDirectlyAsync("Lombiq.ContentEditors.Samples");
public static async Task<UITestContext> TestDemoAsyncEditorLoadOnAdminAsync(this UITestContext context)
{
await context.GoToRelativeUrlAsync("/Admin/ContentItemAsyncEditor/EmployeeAsyncEditorProvider/Employee");
context.Exists(By.XPath("//label[. = 'Name']"));
context.Exists(By.XPath("//*[contains(@class, 'asyncEditor__groupLink') and contains(., 'Personal Details')]"));
context.Exists(By.XPath("//*[contains(@class, 'asyncEditor__groupLink') and contains(., 'Employment Details')]"));
return context;
}
}
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using OpenQA.Selenium;
using System.Threading.Tasks;

namespace Lombiq.ContentEditors.Tests.UI.Extensions;

public static class BasicAsyncEditorTestingUITestContextExtensions
{
public static Task EnableContentEditorsSamplesFeatureAsync(this UITestContext context) =>
context.EnableFeatureDirectlyAsync("Lombiq.ContentEditors.Samples");

public static async Task<UITestContext> TestDemoAsyncEditorLoadOnAdminAsync(this UITestContext context)
{
await context.GoToRelativeUrlAsync("/Admin/ContentItemAsyncEditor/EmployeeAsyncEditorProvider/Employee");

context.Exists(By.XPath("//label[. = 'Name']"));
context.Exists(By.XPath("//*[contains(@class, 'asyncEditor__groupLink') and contains(., 'Personal Details')]"));
context.Exists(By.XPath("//*[contains(@class, 'asyncEditor__groupLink') and contains(., 'Employment Details')]"));

return context;
}
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<Title>Lombiq Content Editors for Orchard Core - UI Test Extensions</Title>
<Authors>Lombiq Technologies</Authors>
<Copyright>Copyright © 2022, Lombiq Technologies Ltd.</Copyright>
<Description>Lombiq Content Editors for Orchard Core - UI Test Extensions: Extensions to aid in UI testing Lombiq Content Editors for Orchard Core.</Description>
<PackageIcon>NuGetIcon.png</PackageIcon>
<PackageTags>OrchardCore;Lombiq;AspNetCore</PackageTags>
<RepositoryUrl>https://github.com/Lombiq/Orchard-Content-Editors</RepositoryUrl>
<PackageProjectUrl>https://github.com/Lombiq/Orchard-Content-Editors</PackageProjectUrl>
<PackageLicenseFile>License.md</PackageLicenseFile>
</PropertyGroup>
<ItemGroup Condition="'$(NuGetBuild)' != 'true'">
<ProjectReference Include="..\..\..\..\..\..\test\Lombiq.UITestingToolbox\Lombiq.Tests.UI\Lombiq.Tests.UI.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="4.0.2-alpha.0.osoe-412" />
</ItemGroup>
<ItemGroup>
<None Include="License.md" Pack="true" PackagePath="" />
<None Include="NuGetIcon.png" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<Title>Lombiq Content Editors for Orchard Core - UI Test Extensions</Title>
<Authors>Lombiq Technologies</Authors>
<Copyright>Copyright © 2022, Lombiq Technologies Ltd.</Copyright>
<Description>Lombiq Content Editors for Orchard Core - UI Test Extensions: Extensions to aid in UI testing Lombiq Content Editors for Orchard Core.</Description>
<PackageIcon>NuGetIcon.png</PackageIcon>
<PackageTags>OrchardCore;Lombiq;AspNetCore</PackageTags>
<RepositoryUrl>https://github.com/Lombiq/Orchard-Content-Editors</RepositoryUrl>
<PackageProjectUrl>https://github.com/Lombiq/Orchard-Content-Editors</PackageProjectUrl>
<PackageLicenseFile>License.md</PackageLicenseFile>
</PropertyGroup>

<ItemGroup Condition="'$(NuGetBuild)' != 'true'">
<ProjectReference Include="..\..\..\..\test\Lombiq.UITestingToolbox\Lombiq.Tests.UI\Lombiq.Tests.UI.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<None Include="License.md" Pack="true" PackagePath="" />
<None Include="NuGetIcon.png" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
33 changes: 21 additions & 12 deletions Lombiq.ContentEditors.sln
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lombiq.ContentEditors", "Lombiq.ContentEditors\Lombiq.ContentEditors.csproj", "{E5811732-2DBB-4467-A98F-7257878BFA7D}"
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.ContentEditors", "Lombiq.ContentEditors\Lombiq.ContentEditors.csproj", "{E5811732-2DBB-4467-A98F-7257878BFA7D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lombiq.ContentEditors.Samples", "Lombiq.ContentEditors.Samples\Lombiq.ContentEditors.Samples.csproj", "{F106CEB9-8391-4E64-BA49-930EFB3BFC54}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lombiq.ContentEditors.Tests.UI", "Lombiq.ContentEditors\Tests\Lombiq.ContentEditors.Tests.UI\Lombiq.ContentEditors.Tests.UI.csproj", "{28DECF2B-DFD7-411C-A21C-086BAF4E06E2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.ContentEditors.Samples", "Lombiq.ContentEditors.Samples\Lombiq.ContentEditors.Samples.csproj", "{F106CEB9-8391-4E64-BA49-930EFB3BFC54}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C39430D6-A0D7-4A0A-9772-E12AFCA4B9FA}"
ProjectSection(SolutionItems) = preProject
Readme.md = Readme.md
.github\workflows\publish-nuget.yml = .github\workflows\publish-nuget.yml
.gitignore = .gitignore
.github\workflows\create-jira-issues-for-community-activities.yml = .github\workflows\create-jira-issues-for-community-activities.yml
.github\workflows\verify-submodule-pull-request.yml = .github\workflows\verify-submodule-pull-request.yml
License.md = License.md
.gitignore = .gitignore
.github\workflows\publish-nuget.yml = .github\workflows\publish-nuget.yml
Readme.md = Readme.md
.github\workflows\verify-submodule-pull-request.yml = .github\workflows\verify-submodule-pull-request.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.ContentEditors.Tests.UI", "Lombiq.ContentEditors.Tests.UI\Lombiq.ContentEditors.Tests.UI.csproj", "{04E3BC71-490A-44CF-820E-D40C7FA2C78F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -30,9 +33,15 @@ Global
{F106CEB9-8391-4E64-BA49-930EFB3BFC54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F106CEB9-8391-4E64-BA49-930EFB3BFC54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F106CEB9-8391-4E64-BA49-930EFB3BFC54}.Release|Any CPU.Build.0 = Release|Any CPU
{28DECF2B-DFD7-411C-A21C-086BAF4E06E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28DECF2B-DFD7-411C-A21C-086BAF4E06E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28DECF2B-DFD7-411C-A21C-086BAF4E06E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28DECF2B-DFD7-411C-A21C-086BAF4E06E2}.Release|Any CPU.Build.0 = Release|Any CPU
{04E3BC71-490A-44CF-820E-D40C7FA2C78F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04E3BC71-490A-44CF-820E-D40C7FA2C78F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04E3BC71-490A-44CF-820E-D40C7FA2C78F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04E3BC71-490A-44CF-820E-D40C7FA2C78F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2EC75216-B448-4DCA-9D0F-A6DF3216CE80}
EndGlobalSection
EndGlobal
23 changes: 12 additions & 11 deletions Lombiq.ContentEditors/Assets/Scripts/async-editor/async-editor.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* global Vue */
/* global VueRouter */
/* global DomParser */

if (!window.asyncEditor) window.asyncEditor = { editors: [] }
if (!window.asyncEditor) window.asyncEditor = { editors: [] };

class AsyncEditorApiClient {
constructor(parameters) {
Expand Down Expand Up @@ -33,7 +32,7 @@ class AsyncEditorApiClient {
const submittedEditorEvent = new CustomEvent('asyncEditorSubmittedEditor', {
bubbles: true,
cancelable: true,
detail: { asyncEditor: window.asyncEditor }
detail: { asyncEditor: window.asyncEditor },
});
document.dispatchEvent(submittedEditorEvent);
})
Expand Down Expand Up @@ -99,7 +98,9 @@ window.asyncEditor.editor = {
.parseFromString(self.scriptsHtml, 'text/html')
.getElementsByTagName('script');
for (let i = 0; i < scripts.length; i++) {
window.eval(scripts[i].text);
const script = document.createElement('script');
script.text = scripts[i].text;
document.head.appendChild(script).parentNode.removeChild(script);
}

self.scriptsHtml = '';
Expand Down Expand Up @@ -132,11 +133,11 @@ window.asyncEditor.editor = {
const submittingEditorEvent = new CustomEvent('asyncEditorSubmittingEditor', {
bubbles: true,
cancelable: true,
detail: { asyncEditor: window.asyncEditor }
detail: { asyncEditor: window.asyncEditor },
});

var success = document.dispatchEvent(submittingEditorEvent);
if (success) {
const successful = document.dispatchEvent(submittingEditorEvent);
if (successful) {
self.api.submitEditor(
self.contentId,
self.editorGroup,
Expand Down Expand Up @@ -183,14 +184,14 @@ window.asyncEditor.editor = {
let shouldLoadEditor = false;

const contentIdKey = self.asyncEditorId + '.contentId';
if (self.$route.query.hasOwnProperty(contentIdKey) &&
if (Object.prototype.hasOwnProperty.call(self.$route.query, contentIdKey) &&
self.$route.query[contentIdKey] !== self.contentId) {
self.contentId = self.$route.query[contentIdKey];
shouldLoadEditor = true;
}

const editorGroupKey = self.asyncEditorId + '.editorGroup';
if (self.$route.query.hasOwnProperty(editorGroupKey) &&
if (Object.prototype.hasOwnProperty.call(self.$route.query, editorGroupKey) &&
self.$route.query[editorGroupKey] !== self.editorGroup) {
self.editorGroup = self.$route.query[editorGroupKey];
shouldLoadEditor = true;
Expand Down Expand Up @@ -226,12 +227,12 @@ window.asyncEditor.editor = {
const index = editorGroups.indexOf(editorGroup ?? this.editorGroup);

return editorGroups[index + 1];
}
},
},
};

window.initAsyncEditor = (asyncEditorId, parameters) => {
if (!parameters) return window.asyncEditor.editors[asyncEditorId];
if (!parameters) return;
Piedone marked this conversation as resolved.
Show resolved Hide resolved

window.asyncEditor.editors[asyncEditorId] = new Vue({
el: parameters.element,
Expand Down
7 changes: 0 additions & 7 deletions Lombiq.ContentEditors/Gulpfile.js

This file was deleted.

26 changes: 14 additions & 12 deletions Lombiq.ContentEditors/Lombiq.ContentEditors.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.props" />

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
Expand Down Expand Up @@ -27,18 +29,14 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.Npm.Targets\Lombiq.Npm.Targets.props" />
<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.Npm.Targets\Lombiq.Npm.Targets.targets" />
<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.Gulp.Extensions\Lombiq.Gulp.Extensions.targets" />

<ItemGroup>
<PackageReference Include="OrchardCore.Module.Targets" Version="1.4.0" />
<PackageReference Include="OrchardCore.ContentFields" Version="1.4.0" />
<PackageReference Include="OrchardCore.ContentManagement" Version="1.4.0" />
<PackageReference Include="OrchardCore.ContentTypes.Abstractions" Version="1.4.0" />
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.4.0" />
<PackageReference Include="OrchardCore.Media" Version="1.4.0" />
<PackageReference Include="OrchardCore.ResourceManagement" Version="1.4.0" />
<PackageReference Include="OrchardCore.Module.Targets" Version="1.5.0" />
<PackageReference Include="OrchardCore.ContentFields" Version="1.5.0" />
<PackageReference Include="OrchardCore.ContentManagement" Version="1.5.0" />
<PackageReference Include="OrchardCore.ContentTypes.Abstractions" Version="1.5.0" />
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.5.0" />
<PackageReference Include="OrchardCore.Media" Version="1.5.0" />
<PackageReference Include="OrchardCore.ResourceManagement" Version="1.5.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -48,10 +46,14 @@

<ItemGroup Condition="'$(NuGetBuild)' != 'true'">
<ProjectReference Include="..\..\..\Libraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries.OrchardCore\Lombiq.HelpfulLibraries.OrchardCore.csproj" />
<ProjectReference Include="..\..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.HelpfulLibraries.OrchardCore" Version="4.7.0" />
<PackageReference Include="Lombiq.HelpfulLibraries.OrchardCore" Version="5.1.1" />
<PackageReference Include="Lombiq.NodeJs.Extensions" Version="1.2.0" />
</ItemGroup>

<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.targets" />

</Project>
Loading